fix(dashboards): carry dashboard chat context ids, label the chart readout, isolate repository tests - #8499
Conversation
…adout, isolate repository tests - User message contexts keep a dashboard mention's dashboardId, both in the optimistic message and when a persisted message is reopened, matching the context the server stores. - The time-series readout row has role="group", so its aria-label is exposed to assistive technology. - The revision test in the dashboard repository suite seeds its own workspace instead of depending on the previous test's row.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Follow-ups to the dashboard findings in the release review. Three findings were real and are fixed here. Five were checked and need no change; the reasons are below.
Fixed
Dashboard mention loses its
dashboardIdin user messages (release review:home/types.ts"dashboardIdis never populated")ChatMessageContextdeclaresdashboardId, andpersisted-message.tsstores it, but neither client-side mapping copied it:use-chat.ts;toDisplayContextsindisplay-message.ts, which rebuilds the contexts when a persisted chat is reopened.dashboardId, using the same pattern as the other id fields.home.tsx:318path the finding cites resolves composerChatContexts, which already carry the id.display-message.test.tsadds "keeps the dashboard id of a reopened dashboard mention". It fails without thedisplay-message.tsline.Time-series readout
aria-labelis ignored (release review:time-series-chart.tsx)aria-labelon a plaindiv.role='group', so its "<label>values" name is exposed. With no values it stays an unnamed container, so screen readers never meet an empty named group.Repository revision test depends on the test before it (release review:
repository.integration.ts)ws-arow that the first test inserts. Run on its own, it dereferencednull.ws-cdashboard.Not changed
formatChartValueprecision (lib/charts/summary.ts): this is the intended display policy, not a bug. The readout is a compact Total/Avg summary of the plotted buckets.lib/dashboards/README.mdand the function's TSDoc document it as two decimals, or three significant digits below 1, so small values never round to 0.sidebar.tsx): this matches enforcement.dashboardOperations.readanddashboardOperations.saveboth requirecapability: 'files.use'(lib/dashboards/application/operations.ts). A Files-restricted member is refused by the route as well, so hiding or locking the entry is correct.dashboardsentitlement (payload.ts): organization chats run workspace commands with an explicit--workspace IDper invocation. The worker'sextractCliWorkspaceandparse.tsrequire it. The tool then runs against that invocation's trusted workspace, and every dashboard operation re-checks availability for that workspace. The entitlement is therefore meaningful in organization chats.lib/api/contracts/dashboards.ts): the bounds belong on input. The write path enforces them. The GET response describes stored data, and adding the write bounds there could only turn an already-stored row into a response error. It would not prevent anything.'Dashboard'missing fromGENERIC_RESOURCE_TITLES(resources/types.ts): a dashboard's name is always'Dashboard'(lib/dashboards/application/dashboards.ts). There is no rename, so there is no more specific title to upgrade to.Test plan
display-message.test.ts: the new test fails before the fix and passes after it.bun run test:integration lib/dashboards/repository.integration.tspasses (2 tests).bun run lintbun run type-check(apps/sim)bun run check:audits(52 audits)