fix(mcp): guide agents to size dashboard tiles correctly (HDX-4661)#2554
fix(mcp): guide agents to size dashboard tiles correctly (HDX-4661)#2554brandon-pereira wants to merge 3 commits into
Conversation
Co-authored-by: Brandon Pereira <brandon-pereira@users.noreply.github.com>
🦋 Changeset detectedLatest commit: bba571d 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 SummaryThis PR adds per-
Confidence Score: 5/5Safe to merge — changes are limited to prompt text and Zod field descriptions with no runtime logic affected. All changes are string literals in prompt content and schema The Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LLM calls clickstack_save_dashboard] --> B{Read tile sizing context}
B --> C[schemas.ts w/h .describe text\nper-displayType ranges]
B --> D[content.ts Rule 14\nSIZE TILES TO FIT THEIR CONTENT]
C --> E{displayType?}
D --> E
E -->|number| F[w 6-8, h 3-4\n3-4 KPIs per row]
E -->|line / stacked_bar / pie| G[w 8-12, h 4-6]
E -->|table / search| H[w 24, h 6-10\nfull row]
E -->|heatmap| I[w 12, h 5-6]
E -->|markdown| J[w 24, h 2-3\nnever h 1]
F & G & H & I & J --> K[Dashboard saved with\ncorrect tile proportions]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[LLM calls clickstack_save_dashboard] --> B{Read tile sizing context}
B --> C[schemas.ts w/h .describe text\nper-displayType ranges]
B --> D[content.ts Rule 14\nSIZE TILES TO FIT THEIR CONTENT]
C --> E{displayType?}
D --> E
E -->|number| F[w 6-8, h 3-4\n3-4 KPIs per row]
E -->|line / stacked_bar / pie| G[w 8-12, h 4-6]
E -->|table / search| H[w 24, h 6-10\nfull row]
E -->|heatmap| I[w 12, h 5-6]
E -->|markdown| J[w 24, h 2-3\nnever h 1]
F & G & H & I & J --> K[Dashboard saved with\ncorrect tile proportions]
Reviews (3): Last reviewed commit: "fix(mcp): reconcile search tile height g..." | Re-trigger Greptile |
Co-authored-by: Brandon Pereira <brandon-pereira@users.noreply.github.com>
E2E Test Results✅ All tests passed • 223 passed • 3 skipped • 1489s
Tests ran across 4 shards in parallel. |
Co-authored-by: Brandon Pereira <brandon-pereira@users.noreply.github.com>
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Summary
Agents building dashboards through the MCP
clickstack_save_dashboard/patch_dashboardtools were leaving nearly every tile at the12x4layout default. The result is poorly proportioned dashboards: tables and search lists lose rows below the fold, number-tile KPIs are oversized and waste a whole row, and markdown notes crammed intoh: 1get clipped. There was no per-displayTypesizing guidance anywhere the model reads, so it had nothing to anchor on.This change adds tile-sizing guidance in the two places the LLM consumes context:
packages/api/src/mcp/tools/dashboards/schemas.ts— expand the shared tile-layoutwandh.describe()text with per-displayTyperecommended ranges (number stays small and shares a row, line/stacked_bar/pie mid-size, tables/search take the full row, heatmap mid-size, markdownh: 2-3). These descriptions surface directly in the tool's JSON schema.packages/api/src/mcp/prompts/dashboards/content.ts— replace the crampedh: 1markdown advice in the TILE TYPE GUIDE with "size it to fit the text (h: 2-3)", and add design-checklist rule 14 "SIZE TILES TO FIT THEIR CONTENT" with the same per-type w/h ranges. Checklist rules stay numbered contiguously1..14.packages/api/src/mcp/__tests__/dashboards/prompts.test.ts— extend the existing design-checklist test to assert the checklist now runs1..14and that rule 14's substantive content (per-type ranges, full-row tables) is present.Prose stays ASCII-only (no em/en-dashes), which the existing
prompts.testvoice assertions enforce.How to test on Vercel preview
N/A — non-UI change (MCP tool descriptions and prompt content only).
References