feat(mcp): expose table tile alternateRowBackground in dashboard authoring schema#2718
Conversation
…oring schema Adds alternateRowBackground to the clickstack_save_dashboard builder table tile schema and a short prompt guidance line, with a handler round-trip test asserting the field persists. Depends on the external API PR it is stacked on, since the MCP save path validates and converts through the external dashboard schema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: db4a026 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryAdds zebra-striping support to MCP-authored builder table tiles.
Confidence Score: 3/5The prompt/schema mismatch should be fixed before merging because raw SQL table requests can silently lose the newly recommended setting. Builder table round-tripping is covered and correctly wired, but the general prompt guidance reaches raw SQL table authoring while packages/api/src/mcp/prompts/dashboards/content.ts and packages/api/src/mcp/tools/dashboards/schemas.ts Important Files Changed
Reviews (1): Last reviewed commit: "feat(mcp): expose table tile alternateRo..." | Re-trigger Greptile |
| 3. GROUP BY HAS NO ALIAS HOOK. The chart config's groupBy is a single expression string and the renderer uses it verbatim as the column header (tables) and as the raw column name everywhere else (CSV export, tooltips, orderBy references, onClick template references). Grouping a table by SpanAttributes['http.route'] produces a column header that reads literally as arrayElement(SpanAttributes, 'http.route'). When a top-level column carries the same semantic, prefer it: SpanName for operation, ServiceName for service, SeverityText for log severity. When the dimension exists only as a Map attribute and the column header matters, drop to a raw SQL tile (configType: "sql") and write the column with AS alias. Line, stacked_bar, and pie tiles legend by the value not the column name, so the issue is invisible on the chart itself but still bites CSV export and onClick template references. | ||
|
|
||
| 4. INVENTORY-STYLE TABLES PUT THE GROUP BY ON THE LEFT. Set groupByColumnsOnLeft: true on tables that read like a list of things (one row per service, per endpoint, per tenant). | ||
| 4. INVENTORY-STYLE TABLES PUT THE GROUP BY ON THE LEFT. Set groupByColumnsOnLeft: true on tables that read like a list of things (one row per service, per endpoint, per tenant). For wide tables that are hard to scan, set alternateRowBackground: true to zebra-stripe the rows (default false). |
There was a problem hiding this comment.
When an agent follows this unqualified guidance for a wide raw SQL table, mcpSqlTileSchema strips alternateRowBackground before the downstream schema receives it, causing the save to succeed without applying the requested zebra striping. Scope this guidance to builder tables or expose the field on the raw SQL MCP schema, which already has downstream support for it.
Knowledge Base Used: MCP server, AI assistant, and OpAMP integration
Deep Review✅ No critical issues found. This is a small, additive change: one optional boolean on the MCP builder table tile schema, a prompt guidance sentence, and a round-trip assertion. The field name, type, and 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, api-contract, agent-native, learnings-researcher. Testing gaps: MCP-path persistence of |
Summary
Stacked on #2698 (external Dashboards API); merge that first. Adds
alternateRowBackgroundto the MCPclickstack_save_dashboardbuilder table tile schema and a short prompt guidance line, so AI-authored dashboards can turn on zebra striping. The MCP save path validates and converts through the external dashboard schema, so the field only persists once #2698 lands.schemas.ts: adds the optional boolean tomcpTableTileSchema.config, next togroupByColumnsOnLeft.content.ts: one guidance sentence appended to the existing inventory-style-tables rule.alternateRowBackground: trueon the returned builder table tile.Open question for review: expose it on the raw SQL MCP tile schema too?
I kept this to the builder table tile (
mcpTableTileSchema) for now. Worth a second opinion though:alternateRowBackgroundlives on the shared chart-settings schema, so #2698 exposes it on both the builder and raw SQL external table configs, and the app (from #2519) applies striping to raw SQL table tiles as well.mcpSqlTileSchemaalready carriesnumberFormat,color, andonClick, so addingalternateRowBackgroundthere would mirroronClickexactly (a table-only field on the shared SQL schema, carried table-guarded through the external round-trip). The counterargument is keeping the MCP SQL tile schema lean. I'm happy to add it here if you want full parity across the MCP surface; left it out to keep the tool schema tight. Your call.Test plan
mcp/__tests__/dashboards/saveDashboard.int.test.ts: 59/59 pass; the multi-tile create round-trip assertsalternateRowBackground: truesurvives on the returned builder table tile.tsc --noEmitand eslint clean.Incremental scope vs the base branch is 2 files / 9 production lines (Tier 2).