Skip to content

The deck shape panel stays tidy at extreme counts (spec 077, closes #320) - #331

Merged
plainprogrammer merged 21 commits into
mainfrom
077-deck-shape-extreme-counts
Nov 12, 2026
Merged

plainprogrammer merged 21 commits into
mainfrom
077-deck-shape-extreme-counts

Conversation

@plainprogrammer

Copy link
Copy Markdown
Owner

Closes #320

The deck shape panel stays tidy at extreme counts (a 6+ column of 1,357, five mana segments of about 2,591, a "9,999 proxy" Card types row) on a 320px to 360px viewport and in the 320px aside. Spec 077 (spec 0.3.2, plan, verification).

What changes, per limit of #320

Limit Ruling Change
The curve's 6+ count overflows its column (−1.85px in a 360px frame, −5.43px at a 320px viewport) fix The count above a column is abbreviated from 1,000 ("1.4k", "12k"); the exact count stays in the chart's aria-label
The mana bar's labels crowd (they wrap onto two lines at 320px) fix A segment's label count is abbreviated the same way ("W 2.6k"); the caption and the bar's aria-label keep the exact count
A type row's count goes out of line behind a wide proxy suffix fix The Card types list is a grid and every row is a subgrid of it, so counts end at one x; the name wraps at five-digit counts
The caption can wrap with a leading dot fix Each colour in the caption is one unbreakable item ("Blue 44 · 73% ·"); the text is unchanged. The leading dot was real: the old caption started a line with "·" at 16 of 72 frame widths

One ruling by the maintainer (decision 2, option A): the 10% rule that hides a label (spec 060 decision 4) stays. A mana segment narrower than its label (labels of four, five and six characters need about 14%, 17% and 20% of the bar at a 320px viewport) is a documented limit, offered as its own issue: #330.

Code

app/models/mtg/deck_shape.rb (short_count, caption_items, two constants), app/views/mtg/deck_shapes/_parts.html.erb, and two DeckShape blocks of additions.css (10 lines added, 4 removed). The deck core files are untouched. The documents: DeckShape.md, three previews, the area doc collection-and-lots.md (paragraph, Named constants, Issues, Sources, log) and the specs index; specs 060 and 069 are superseded in part and not edited.

Evidence

Factory data, placeholder card images. Spec 069's worst-case fixture plus a "9,999 proxy" row. Before is the unchanged code, after is this branch; light and dark.

Before After
375px frame (a 360px viewport), light before 360 light after 360 light
375px frame, dark before 360 dark after 360 dark
335px frame (a 320px viewport), light before 320 light after 320 light
335px frame, dark before 320 dark after 320 dark
640px frame (the fold), light before 640 light after 640 light
640px frame, dark before 640 dark after 640 dark
1280px, the 320px aside, light before 1280 light after 1280 light
1280px, dark before 1280 dark after 1280 dark

The change is CSS and number formatting with no flow, so static shots stand in for a GIF.

Tests

  • New and changed examples first, red before the code (9c1d80a2): the abbreviation and caption items (model), the rendered markup (request), and a nested describe in the existing shape-panel system spec that measures the panel at a 320px, 345px and 360px viewport, a 366px frame, a 640px frame and the 1280px aside, in both themes. Frames are sized from the measured scrollbar and read against clientWidth. Every geometry example has a failing variant that injects the old text or rule.
  • Local bin/ci: 4,416 examples, 0 failures, 1 pending; rubocop, YARD (0 warnings) and the comment ratchet green. The Mode B review (read-only Opus) is recorded in verification.md: SPEC-ALIGNED WITH MINOR FINDINGS, no blocking or major findings, the minors fixed.
  • Two checks have thin margins proved on a Mac: AC-2.2's label has 0.44px at a 320px viewport, and the 366px leading-dot variant relies on the Linux scrollbar's 12px. If either fails in CI it goes back through a spec update; no bound is moved.

Notes for the reviewer

🤖 Generated with Claude Code

plainprogrammer and others added 20 commits November 11, 2026 22:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, variant widths

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Red before the partial and the CSS (spec 077). Request, 3 of 4 fail: the 6+ count reads 1,357 not 1.4k (AC-1.2), the segment labels read W 2,591 not W 2.6k (AC-2.1), no c-manacap__item (AC-4.2); the types' exact counts example is a guard and is green. System, 5 of 12 fail: AC-1.3 (320, 345 and the 366px frame: count room -5.43, -1.85, -1), AC-2.2 (320: labels wrap to 2 lines; 345: 50.8px in a 51px segment), AC-3.1 and AC-3.1b (flex rows: counts end at different x), AC-4.3 (no c-manacap__item, so itemLines is empty). The 7 other system examples (six can-fail variants and the AC-3.2 floor) are green, as predicted; the AC-4.3 variant is green for the wrong reason until the items exist. The stale AC-5.3 comment is rewritten.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aption as items (#320)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hole (#320)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Factory data, placeholder card images. 375px, 335px and 640px frames and the 1280px aside, light and dark.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…l, tie the variants to their cause (#320)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…spec 0.3.3)

CI measured the six-character label at 44.70px against the Mac's 43.56px in a 46px content width. The 2px gap came from a Mac measurement; the criterion is about wrapping and overflow, so a label fits when it is on one line and within its segment. The unabbreviated variant still fails through the lines clause.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@plainprogrammer
plainprogrammer marked this pull request as ready for review November 12, 2026 04:36
@plainprogrammer plainprogrammer self-assigned this Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plainprogrammer
plainprogrammer merged commit 2c9a69c into main Nov 12, 2026
9 checks passed
@plainprogrammer
plainprogrammer deleted the 077-deck-shape-extreme-counts branch November 12, 2026 12:17
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.

Deck shape panel: layout at extreme counts

1 participant