Skip to content

ui(github): render schema drift as captions, not a list - #213

Merged
veksen merged 1 commit into
mainfrom
ui-schema-drift-captions
Jul 31, 2026
Merged

ui(github): render schema drift as captions, not a list#213
veksen merged 1 commit into
mainfrom
ui-schema-drift-captions

Conversation

@veksen

@veksen veksen commented Jul 31, 2026

Copy link
Copy Markdown
Member

Goal

The PR comment leads with the gate roster and expands the conditions that fired (ADR-0009). Schema drift was the one expansion that used a different type scale and a different spacing system from the rest, so a run with schema changes did not look like the same component. This is the last rendering defect I know of in that comment.

What

Before: a bold Added heading, then a bulleted list at body size, then the same for Removed. The entries were the same size as the gate rows above them, so a five-entry change read as loud as the checks themselves. On a real run it was 17 entries and it split the six-line roster in half.

After: one line per change, at caption size, tight under the gate row. Each line names its own kind, so Added table public.statistics_snapshots replaces the heading-plus-bullet pair.

How

Read success.md.j2 first. The schema block now emits <sub> lines with a blank line closing it, which is the shape the regression and recommendation blocks already had.

The heading went because each line states its kind, which also retired schemaChangeHeading and its plumbing through github.ts. A remove op carries no value, so its name was the placeholder (removed); with the kind on the line that is redundant and the line is now Removed index.

Two spacing facts drove this, both measured in a browser against GitHub's own stylesheet rather than judged by eye. Body text in a comment is 14px and <sub> is 10.5px; the schema entries were the only expansion content at 14px. And because those entries shared a paragraph with the gate rows, the roster's line spacing was computed against a smaller line box: 27.1px entering the block and 14.9px leaving it, against a steady 21px elsewhere. The blank line closes the paragraph and the roster returns to 21px.

Tests

schema-change.test.ts covers the label for each kind and the empty name on a remove. github.test.ts pins the rendered markdown: entries sit directly under the gate row, the block is closed by a blank line, and every entry is <sub>-wrapped. Full suite 405 passing, tsc --noEmit clean.

Not in this PR

On the run that prompted it, 14 of the 17 entries were indexes and constraints belonging to the 3 tables added in the same diff. Filtering those leaves 3 lines. A changed entry also renders as Changed table · columns.17, where columns.17 is a JSON Patch array index and means nothing to a reader. Both are content, not layout.

Every other expansion states its detail in <sub> captions tight under its gate
row. Schema drift alone rendered a bold group heading and a bulleted list at
body size, so its entries read as loud as the gate rows they sat beneath, and
the roster's leading was computed against them: 27.1px entering the block and
14.9px leaving it, against 21px everywhere else.

Each line now carries its own kind, which is what retires the heading. That in
turn retires schemaChangeHeading, and the (removed) placeholder it was standing
in for.

Co-Authored-By: Claude <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query Doctor — 6 successful checks

 Cost regression — No query went up more than 5%
 Untested data access — No changed data-access file without a test
 New query — No new queries
 New query with index recommendation — No new query ships an index recommendation
 Schema drift — No schema changes
 High-value nudge — No index or rewrite past the threshold


More details via MCP → get_ci_run({ runId: "019fba82-a7bb-781a-b668-6e6390c8ec65" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.

@veksen
veksen merged commit a30c52e into main Jul 31, 2026
6 checks passed
@veksen
veksen deleted the ui-schema-drift-captions branch July 31, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant