feat(support): Zendesk Support dashboard section (v1 + v2)#162
feat(support): Zendesk Support dashboard section (v1 + v2)#162mozhaev-dev wants to merge 2 commits into
Conversation
…IGHT-459) New v2 dashboard section "Support" (person support activity), mirroring the collaboration/ai_adoption sections. Backend already provides the Team (…0007) / IC (…0008) bullet metric sets + metric_catalog over support_bullet_rows.* (insight #1304). Shared: - metric-registry: TEAM_BULLET_SUPPORT / IC_BULLET_SUPPORT. - catalog-client: support → support_bullet_rows prefix so transformBulletMetrics resolves the support metric_keys from the wire catalog. - ic-dashboard / team-view query layer: support added to the section map / data shape (these feed the v2 screens' data.support / bySection.support). v2: - v2/sections (Ic/Team section ids + lists, label "Support"), v2/metric-order (7 keys: active, updates, public/private comments, solved, csat, kb), queries/v2/team-extras, engineering-dashboard-v2 + team-view-v2 render, section-card preview, section-drilldown-sheet (support branch; support_csat as a percent summary, support_kb → ComingSoon). Mocks: catalog snapshot + v2 factory + handlers for the two metric sets (support_csat percent, support_kb NULL→ComingSoon). typecheck clean; vitest 79 passed. (v1 dashboard surfaces follow in the next commit.) Signed-off-by: Sergey Mozhaev <Sergey.Mozhaev@constructor.tech>
…IGHT-459) Adds the Support section to the legacy (v1) dashboards, mirroring collaboration (the v2 + shared layers landed in the previous commit): - queries/team-metrics: support in TeamMetricsSectionId + SECTIONS (IC_BULLET_SUPPORT). - screens/team-view + ic-dashboard/engineering-dashboard: render the Support section (flat list — no sub-grouping, like task_delivery); support_kb → ComingSoon, support_csat is a percent. - components/team-bullet-sections (SupportSection) + team-metrics-table (order + title key). - bullet-layout-groups: 7 support_* keys added to BULLET_DISPLAY_ORDER (no sub-groups — flat). - locales: "Support" titles (3 places). mocks/factories: v1 support mock data. typecheck clean; vitest 79 passed; no new lint. Signed-off-by: Sergey Mozhaev <Sergey.Mozhaev@constructor.tech>
📝 WalkthroughWalkthroughA new "support" bullet section backed by Zendesk metrics ( ChangesSupport (Zendesk) Bullet Section
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mocks/catalog-snapshot.json`:
- Around line 1305-1438: The catalog-snapshot.json file is missing links entries
that map query IDs to the newly added support metrics. Add corresponding links
entries for query IDs 00000000-0000-0000-0001-000000000007 and
00000000-0000-0000-0001-000000000008 that reference the metric IDs of the new
support bullet row metrics (support_active, support_updates,
support_public_comments, support_private_comments, support_solved, support_csat,
and support_kb). This will enable proper catalog-to-query resolution for these
new support section metrics in mock mode.
In `@src/mocks/factories.ts`:
- Around line 374-380: Remove the `support_kb` entry from the numeric mock data
distribution in the metrics object. Instead, add special-case handling in the
`mockTeamBulletSection` function to explicitly set `support_kb` to `value: null`
(and null stats if applicable to `RawBulletAggregateRow`) rather than allowing
it to be populated from the distribution. This ensures that mocks respect the
contract where `support_kb` should remain null until the Guide stream exists,
preventing v1 from rendering real values instead of the ComingSoon state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8377a2ba-5151-4390-b563-46f65a20a049
📒 Files selected for processing (22)
src/api/catalog-client.tssrc/api/metric-registry.tssrc/components/widgets/team-bullet-sections.tsxsrc/components/widgets/team-metrics-table.tsxsrc/components/widgets/v2/section-card.tsxsrc/components/widgets/v2/section-drilldown-sheet.tsxsrc/lib/insight/bullet-layout-groups.tssrc/lib/insight/v2/metric-order.tssrc/lib/insight/v2/sections.tssrc/locales/en/translation.jsonsrc/mocks/catalog-snapshot.jsonsrc/mocks/factories.tssrc/mocks/handlers.tssrc/mocks/v2/factories.tssrc/queries/ic-dashboard.tssrc/queries/team-metrics.tssrc/queries/team-view.tssrc/queries/v2/team-extras.tssrc/screens/ic-dashboard/engineering-dashboard-v2.tsxsrc/screens/ic-dashboard/engineering-dashboard.tsxsrc/screens/team-view-v2.tsxsrc/screens/team-view.tsx
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000001", | ||
| "metric_key": "support_bullet_rows.support_active", | ||
| "label": "Active Support Members", | ||
| "sublabel": "Zendesk · people with any support activity · period total", | ||
| "unit": "people", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 1, | ||
| "warn": 0, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000002", | ||
| "metric_key": "support_bullet_rows.support_updates", | ||
| "label": "Ticket Updates", | ||
| "sublabel": "Zendesk · ticket updates authored · period total", | ||
| "unit": "updates", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 40, | ||
| "warn": 15, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000003", | ||
| "metric_key": "support_bullet_rows.support_public_comments", | ||
| "label": "Public Comments", | ||
| "sublabel": "Zendesk · public replies to requesters · period total", | ||
| "unit": "comments", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 30, | ||
| "warn": 10, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000004", | ||
| "metric_key": "support_bullet_rows.support_private_comments", | ||
| "label": "Private Comments", | ||
| "sublabel": "Zendesk · internal notes on tickets · period total", | ||
| "unit": "comments", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 20, | ||
| "warn": 8, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000005", | ||
| "metric_key": "support_bullet_rows.support_solved", | ||
| "label": "Tickets Solved", | ||
| "sublabel": "Zendesk · tickets moved to solved · period total", | ||
| "unit": "tickets", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 15, | ||
| "warn": 5, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000006", | ||
| "metric_key": "support_bullet_rows.support_csat", | ||
| "label": "CSAT", | ||
| "sublabel": "Zendesk · customer satisfaction · % positive ratings", | ||
| "unit": "%", | ||
| "format": "percent", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 90, | ||
| "warn": 75, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, | ||
| { | ||
| "id": "019e83b1-5001-7000-a001-000000000007", | ||
| "metric_key": "support_bullet_rows.support_kb", | ||
| "label": "Knowledge Base Contributions", | ||
| "sublabel": "Zendesk Guide · KB articles created or edited · period total", | ||
| "unit": "articles", | ||
| "higher_is_better": true, | ||
| "is_member_scale": false, | ||
| "source_tags": [ | ||
| "zendesk" | ||
| ], | ||
| "schema_status": "ok", | ||
| "thresholds": { | ||
| "good": 3, | ||
| "warn": 1, | ||
| "resolved_from": "product-default", | ||
| "bounded_by_lock": false | ||
| } | ||
| }, |
There was a problem hiding this comment.
Add missing catalog link mappings for support query IDs.
The new support metric entries are present, but there are no corresponding links entries for query IDs 00000000-0000-0000-0001-000000000007 and 00000000-0000-0000-0001-000000000008. This can break catalog-to-query resolution for the new support section in mock mode.
Suggested patch
"links": [
+ {
+ "query_id": "00000000-0000-0000-0001-000000000007",
+ "catalog_metric_ids": [
+ "019e83b1-5001-7000-a001-000000000001",
+ "019e83b1-5001-7000-a001-000000000002",
+ "019e83b1-5001-7000-a001-000000000003",
+ "019e83b1-5001-7000-a001-000000000004",
+ "019e83b1-5001-7000-a001-000000000005",
+ "019e83b1-5001-7000-a001-000000000006",
+ "019e83b1-5001-7000-a001-000000000007"
+ ]
+ },
+ {
+ "query_id": "00000000-0000-0000-0001-000000000008",
+ "catalog_metric_ids": [
+ "019e83b1-5001-7000-a001-000000000001",
+ "019e83b1-5001-7000-a001-000000000002",
+ "019e83b1-5001-7000-a001-000000000003",
+ "019e83b1-5001-7000-a001-000000000004",
+ "019e83b1-5001-7000-a001-000000000005",
+ "019e83b1-5001-7000-a001-000000000006",
+ "019e83b1-5001-7000-a001-000000000007"
+ ]
+ },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/mocks/catalog-snapshot.json` around lines 1305 - 1438, The
catalog-snapshot.json file is missing links entries that map query IDs to the
newly added support metrics. Add corresponding links entries for query IDs
00000000-0000-0000-0001-000000000007 and 00000000-0000-0000-0001-000000000008
that reference the metric IDs of the new support bullet row metrics
(support_active, support_updates, support_public_comments,
support_private_comments, support_solved, support_csat, and support_kb). This
will enable proper catalog-to-query resolution for these new support section
metrics in mock mode.
| support_active: { median: 4, range_min: 0, range_max: 12 }, | ||
| support_updates: { median: 120, range_min: 0, range_max: 500 }, | ||
| support_public_comments: { median: 80, range_min: 0, range_max: 300 }, | ||
| support_private_comments: { median: 40, range_min: 0, range_max: 200 }, | ||
| support_solved: { median: 32, range_min: 0, range_max: 120 }, | ||
| support_csat: { median: 88, range_min: 0, range_max: 100 }, | ||
| support_kb: { median: 0, range_min: 0, range_max: 20 }, |
There was a problem hiding this comment.
support_kb should not be generated as numeric mock data.
Line 380 seeds support_kb as a normal numeric metric, so v1 mocks can render real values instead of ComingSoon. That diverges from the support KB contract (null/no-data until Guide stream exists).
A safer fix is to special-case support_kb in mockTeamBulletSection to emit value: null (and null stats if supported by RawBulletAggregateRow) rather than giving it a distribution entry.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/mocks/factories.ts` around lines 374 - 380, Remove the `support_kb` entry
from the numeric mock data distribution in the metrics object. Instead, add
special-case handling in the `mockTeamBulletSection` function to explicitly set
`support_kb` to `value: null` (and null stats if applicable to
`RawBulletAggregateRow`) rather than allowing it to be populated from the
distribution. This ensures that mocks respect the contract where `support_kb`
should remain null until the Guide stream exists, preventing v1 from rendering
real values instead of the ComingSoon state.
Adds a new Support dashboard section (Zendesk person-support activity) to both v1 and v2 dashboards, mirroring collaboration/ai_adoption.
Consumes the backend Support metric sets (Team
…0007/ IC…0008) +support_bullet_rows.*metric_catalog from constructorfabric/insight#1304. 7 bullets: active members, ticket updates, public/private comments, solved tickets, CSAT (% quality), KB articles (ComingSoon — no Guide stream yet).typecheck clean; vitest 79 passed. Draft — depends on #1304 (backend catalog) and live Zendesk data for end-to-end render.
Part of constructorfabric/insight#497.
🤖 Generated with Claude Code
Summary by CodeRabbit