feat(api): expose table tile alternateRowBackground in the external Dashboards API - #2698
feat(api): expose table tile alternateRowBackground in the external Dashboards API#2698alex-fedotyev wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 5c81a86 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 |
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Additional context: spans packages but only 70 prod lines — under the 100-line cross-layer bar Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThis PR exposes table zebra striping through the external dashboard API and MCP dashboard authoring path. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| packages/api/src/routers/external-api/v2/utils/dashboards.ts | Adds conversion support for alternateRowBackground on builder and raw SQL table configs. |
| packages/api/src/utils/zod.ts | Adds the optional field to the external builder and raw SQL table config schemas. |
| packages/api/src/mcp/tools/dashboards/schemas.ts | Adds MCP schema support for table zebra striping on builder and raw SQL tiles. |
| packages/api/src/mcp/tests/dashboards/schema-parity.test.ts | Adds coverage to keep MCP table schemas aligned with the REST table schemas. |
| packages/api/src/routers/external-api/tests/dashboards.int.test.ts | Extends dashboard round-trip coverage for the new table striping field. |
Reviews (5): Last reviewed commit: "fix(api): expose alternateRowBackground ..." | Re-trigger Greptile
E2E Test Results✅ All tests passed • 323 passed • 1 skipped • 1301s
Tests ran across 4 shards in parallel. |
Deep Review✅ No critical issues found. This is a small, purely additive change: an optional Verified during review:
Prior-review status: every finding from the earlier deep review — the P0/P1 raw SQL MCP schema strip, the omit/explicit- One benign behavior worth noting (not a defect): the MCP raw SQL tile schema accepts Reviewers (8): correctness, adversarial, api-contract, testing, maintainability, kieran-typescript, project-standards, previous-comments. Confirmed-clean returns from correctness and api-contract; findings synthesized with an orchestrator-level trace of both converter directions, the four schema mirrors, and the integration coverage. Testing gaps: none substantive — create/update round-trips and omit/explicit- |
|
Addressed the deep-review findings in cec1359. P0/P1 (raw SQL MCP tile schema strips P2 (raw SQL omit vs explicit- P2 (MCP to REST schema parity): added P2 (changeset): the branch already carries P3 (sync-checklist comment): added the MCP tile schemas to the mirror list above P3 (unguarded read passthrough): left as is. P3 (explicit property vs lodash Also seeded a raw SQL table tile with Local: lint and typecheck clean, 580 api unit tests pass including the new parity tests. The REST and MCP integration coverage runs in the integration CI job. |
…ashboards API Follow-up to #2519, which added the Alternate Row Background display setting to table tiles in the app and internal schema. That field lives on the shared chart-settings schema, so it applies to both builder and raw SQL table tiles. This exposes it in the external REST Dashboards API on both the builder and raw SQL table chart configs, alongside the OpenAPI docs, so API consumers can set striping wherever the UI allows it. Round-trip integration coverage is extended for POST and PUT on both config kinds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a table-tile case asserting that omitting alternateRowBackground leaves it absent on read-back, and that an explicit false persists, mirroring the existing omits-orderBy coverage. Addresses a review nit on the field's test coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…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>
The dashboard authoring MCP schema declared alternateRowBackground on builder table tiles but not on raw SQL table tiles, so save_dashboard and patch_dashboard silently stripped the flag from raw SQL tables even though the UI and REST API both accept it. - Declare alternateRowBackground on the raw SQL MCP tile schema - Add REST raw SQL table omit / explicit-false round-trip coverage - Add MCP raw SQL table save + patch round-trip coverage for the flag - Add MCP-to-REST table schema parity tests (builder + raw SQL) - Use an explicit property for the field in the builder table converter so a rename is a compile error, not a silent runtime drop - List the MCP tile schemas in the shared-schema sync checklist comment Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cec1359 to
5c81a86
Compare
Summary
Follow-up to #2519, which added the Alternate Row Background display setting (zebra striping) to table tiles in the app and the internal chart schema. That PR shipped the app and
common-utilsslice only; this brings the setting to the external REST Dashboards API and the MCP dashboard authoring tool.The field lives on the shared chart-settings schema rather than the builder-only config, so it applies to both builder and raw SQL table tiles (we moved it up to the shared schema during the #2519 review so SQL tiles get striping too). The external API now matches:
alternateRowBackground(optional boolean) to both the builder table config and the raw SQL table config in the request/response schemas (zod.ts).onClickfield.TableBuilderChartConfigandTableRawSqlChartConfig, and regeneratesopenapi.json.It also exposes the field to the
clickstack_save_dashboardMCP tool so AI-authored dashboards can turn on striping:mcpTableTileSchema.config, next togroupByColumnsOnLeft(schemas.ts).content.ts). The MCP save path validates and converts through the external dashboard schema, so it rides on the same converter change above.No new helpers; every edit sits beside the existing
groupByColumnsOnLeft/onClickfields on the same schema, converter, and JSDoc block.Open question: expose it on the raw SQL MCP tile schema too?
I kept the MCP side to the builder table tile (
mcpTableTileSchema) for now.alternateRowBackgroundlives on the shared chart-settings schema, so the external API above exposes it on both the builder and raw SQL table configs, and the app (from #2519) applies striping to raw SQL table tiles as well.mcpSqlTileSchemaalready carriesnumberFormat,color, andonClick, so adding it there would mirroronClickexactly (a table-only field carried table-guarded through the external round-trip). I left it out to keep the MCP SQL tile schema lean, but I'm happy to add it for full parity. Your call.Test plan
alternateRowBackground: trueon both a builder table tile and a raw SQL table tile. The raw SQL assertions are new coverage that guards the SQL path.dashboards.int.test.ts: 162/162 passing locally against a ClickHouse + MongoDB stack. This is the end-to-end round-trip proof (POST a dashboard with the field, read it back, field preserved on both config kinds).mcp/__tests__/dashboards/saveDashboard.int.test.ts: 59/59 passing; the multi-tile create round-trip assertsalternateRowBackground: truesurvives on the returned builder table tile.tsc --noEmit, eslint, and spectral (lint:openapi) all clean.Tier
This lands
review/tier-4because it necessarily touchespackages/api/src/routers/external-api/, which the triage classifier always treats as critical-path. The change itself is small (47 production lines) and mirrors the existinggroupByColumnsOnLeftandonClickfields.Not in this PR