clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

Align proof title contract with mobile fitting ceiling

Dami committed a224fc9
commit
a224fc9aee96317c4ca86d06e3c7bab712867b7a
parent
35c8b31d5ea3e1aee69816964d00d59e2edee323
author
Dami <dami.etoile@gmail.com>
5 files changed, +99 -45
Mopenspec/changes/add-proof-title-fitting/design.md32++++++++++++++---------
Mopenspec/changes/add-proof-title-fitting/proposal.md18+++++++++----
Mopenspec/changes/add-proof-title-fitting/specs/game-presentation/spec.md31+++++++++++++++-------
Aopenspec/changes/add-proof-title-fitting/specs/level-packs/spec.md21+++++++++++++++
Mopenspec/changes/add-proof-title-fitting/tasks.md42+++++++++++++++++-------------
M openspec/changes/add-proof-title-fitting/design.md +20 -12
@@ -25,18 +25,24 @@ the measured width, wrap only at word boundaries into at most two lines. The
2525 renderer must retain the authored words and must not add `…`, silently drop a2626 word, or split a word to force a fit.2727 28-If a title cannot fit into two lines at the 16px floor, the renderer keeps the29-two measured lines in the owning region and reports the overflow to its layout30-result for diagnostics/tests. This presentation change does not invent a new31-runtime warning; the separate mods diagnostics change owns the >32-character32-authoring note.28+On a narrow viewport, a two-line overflow is an exceptional layout path. The29+title receives the full band from the title's left inset to the right inset and30+is fitted at 16px into up to three lines. The compact step counter moves into31+the subline row: `PROOF NN OF NN` is left aligned and `STEPS 02` is right32+aligned on that same row. The 40px HUD-to-board clearance remains mandatory.33+The loader rejects titles over 64 characters with `Titles can be at most 6434+characters so they fit on phones`, so authored titles cannot exceed this35+mobile layout contract. The W11 note for titles over 32 characters remains a36+nonblocking authoring recommendation.3337 3438 ### Preserve the HUD-to-board contract3539 36-When the Proof title takes two lines, the `PROOF NN OF NN` subline and board37-origin move down as one measured group. The board retains at least 40px of38-clear space below the HUD. The board cell size and authored coordinates remain39-unchanged; only the available vertical presentation region is recomputed.40+When the Proof title takes two or three lines, the `PROOF NN OF NN` subline and41+board origin move down as one measured group. In the exceptional narrow layout,42+the compact `STEPS 02` counter shares the subline row. The board retains at43+least 40px of clear space below the HUD. The board cell size and authored44+coordinates remain unchanged; only the available vertical presentation region45+is recomputed.4046 4147 ### Keep motion and reduced motion deterministic4248
@@ -47,8 +53,9 @@ No fitting decision may delay input or alter pointer hit rectangles.
4753 4854 ## Risks and mitigations4955 50-- A narrow title region can create an unexpected two-line title. Test the51- exact desktop and 390x844 mobile widths and return measured line geometry.56+- A narrow title region can create an unexpected two- or three-line title. Test57+ the exact desktop and 390x844 mobile widths and return measured line58+ geometry.5259 - A board shift can collide with the footer or ledger. Add layout assertions5360 for the 40px gap and bottom safe region.5461 - Different scenes may drift into different wrapping behavior. Share a pure
@@ -57,6 +64,7 @@ No fitting decision may delay input or alter pointer hit rectangles.
5764 ## Non-goals5865 5966 - Changing title copy, sentence case, level IDs, or authoring data.60-- Adding a title-length warning to the loader or diagnostics envelope.67+- Changing the >32-character W11 guidance semantics; the 64-character loader68+ ceiling is part of this presentation contract.6169 - Changing Pretext's grid placement or simulation coordinates.6270 - Changing navigation, pointer hit testing, or scene transition timing.
M openspec/changes/add-proof-title-fitting/proposal.md +13 -5
@@ -11,9 +11,16 @@ violates the copy rule that authored titles never receive an ellipsis.
1111 - Give the Proof HUD title the measured space between the level number tile and1212 the step counter, with a 16px inset on both sides.1313 - Shrink the title from 22px to 16px in 1px steps, then wrap at word14- boundaries to no more than two lines when it still does not fit.14+ boundaries to no more than two lines when it still does not fit beside the15+ Proof HUD counter.16+- On narrow screens, if that two-line fit still overflows at 16px, use the17+ full title band for up to three 16px lines. Put `PROOF NN OF NN` and the18+ compact `STEPS 02` counter on the same subline row, left and right aligned.1519 - Move the Proof HUD subline and board together when the title wraps so the1620 documented 40px HUD-to-board gap remains intact.21+- Reject authored titles longer than 64 characters with the exact loader error22+ `Titles can be at most 64 characters so they fit on phones`; retain the23+ separate W11 guidance note for titles over 32 characters.1724 - Keep integer grid coordinates, simulation state, pointer targets, and the1825 separate mods diagnostics warning contract unchanged.1926
@@ -23,13 +30,14 @@ violates the copy rule that authored titles never receive an ellipsis.
2330 2431 - `game-presentation`: fit authored proof titles in their owning scene regions2532 without truncation or grid/layout ambiguity.33+- `level-packs`: reject titles beyond the mobile fitting ceiling while34+ retaining the existing nonblocking long-title guidance.2635 2736 ## Impact2837 2938 - Affected presentation layout and text measurement for Proof, INDEX, and Win.3039 - Affected focused renderer/layout tests and browser visual acceptance at3140 desktop and mobile sizes.32-- No engine rules, level data, input semantics, mod loader validation, or33- authoring diagnostics are changed by this proposal.34-- The separate warning for titles longer than 32 characters remains owned by35- the diagnostics change and is deliberately out of scope here.41+- No engine rules, input semantics, or authoring diagnostics envelope shape are42+ changed by this proposal. The loader ceiling is a presentation safety43+ validation, and the existing W11 warning remains unchanged.
M openspec/changes/add-proof-title-fitting/specs/game-presentation/spec.md +21 -10
@@ -6,10 +6,14 @@ The presentation SHALL render an authored proof title without an ellipsis or
66 discarded words. In the Proof HUD, it SHALL measure the space between the77 `[NN]` number tile and the step counter, subtract 16px from each side, start88 at 22px, and shrink in 1px steps to a 16px minimum before wrapping at word9-boundaries. A wrapped title SHALL use at most two lines. INDEX banners and Win10-cards SHALL use the same shrink-then-wrap behavior with their own measured11-regions. Text fitting SHALL not change integer grid coordinates, simulation12-state, or pointer hit rectangles.9+boundaries into at most two lines. On a narrow screen where those two 16px10+lines still overflow beside the counter, the title SHALL use the full band11+from its left inset to the right inset for up to three 16px lines. In that12+fallback, `PROOF NN OF NN` and a compact, right-aligned `STEPS 02` counter13+SHALL share the subline row. INDEX banners and Win cards SHALL use the same14+shrink-then-wrap helper with their own measured regions. Text fitting SHALL15+not change integer grid coordinates, simulation state, or pointer hit16+rectangles.1317 1418 #### Scenario: A normal Proof title stays on one line1519
@@ -29,11 +33,19 @@ state, or pointer hit rectangles.
2933 3034 - **WHEN** the complete title still does not fit at 16px3135 - **THEN** the HUD renders every authored word across no more than two lines,32- breaks only between words, and adds no ellipsis or clipped replacement36+ breaks only between words, and adds no ellipsis or clipped replacement when37+ that two-line fit fits beside the counter38+39+#### Scenario: A narrow title uses the full mobile band40+41+- **WHEN** two 16px lines still overflow beside the step counter at 390px42+- **THEN** the HUD gives the complete title the full band for up to three43+ 16px lines, places `PROOF NN OF NN` left and compact `STEPS 02` right on the44+ same subline row, and adds no ellipsis or clipped replacement3345 3446 #### Scenario: A wrapped Proof title preserves board clearance3547 36-- **WHEN** the Proof title uses two lines48+- **WHEN** the Proof title uses two or three lines3749 - **THEN** the `PROOF NN OF NN` subline and board shift down together and the3850 measured HUD-to-board gap remains at least 40px without changing cell size3951 or object coordinates
@@ -42,9 +54,8 @@ state, or pointer hit rectangles.
4254 4355 - **WHEN** an INDEX banner or Win card receives a title that needs shrinking4456 or wrapping45-- **THEN** that scene applies the same 22px-to-16px shrink and two-line46- word-boundary wrap rule within its measured region, with complete copy and47- no ellipsis57+- **THEN** that scene uses the shared shrink and word-boundary wrap helper58+ within its own measured region, with complete copy and no ellipsis4859 4960 #### Scenario: Mobile fitting remains inside the viewport5061
@@ -56,7 +67,7 @@ state, or pointer hit rectangles.
5667 5768 - **WHEN** reduced motion is enabled while a title is long enough to shrink or5869 wrap59-- **THEN** the complete fitted title and any required two-line layout appear70+- **THEN** the complete fitted title and any required wrapped layout appear6071 immediately with no intermediate clipping or transition-only omission6172 6273 #### Scenario: Fitting is presentation-only
A openspec/changes/add-proof-title-fitting/specs/level-packs/spec.md +21 -0
M openspec/changes/add-proof-title-fitting/tasks.md +24 -18
@@ -1,32 +1,38 @@
11 ## 1. Shared fitting contract22 3-- [ ] 1.1 Add a pure title-fit helper that measures a complete string, shrinks4- 22px to 16px in 1px steps, and wraps at word boundaries into at most two5- lines without adding an ellipsis.6-- [ ] 1.2 Return measured line widths, font size, line count, overflow status,7- and owning-region geometry so renderers and tests use one contract.3+- [x] 1.1 Add a pure title-fit helper that measures a complete string, shrinks4+ 22px to 16px in 1px steps, and wraps at word boundaries without adding an5+ ellipsis. Narrow fallback callers may request up to three lines.6+- [x] 1.2 Return fitted lines, font size, line height, and overflow status from7+ one helper; each scene adds its owning-region geometry to that result.88 - [ ] 1.3 Add focused tests for one-line, shrink-only, two-line, long-word,9- empty-title, and reduced-motion settled results.9+ empty-title, and reduced-motion settled results. The current focused suite10+ covers the first four cases plus the narrow three-line fallback; empty-title11+ and reduced-motion assertions remain open.1012 1113 ## 2. Scene integration1214 13-- [ ] 2.1 Apply the helper to the Proof HUD using the measured region between15+- [x] 2.1 Apply the helper to the Proof HUD using the measured region between1416 the number tile and step counter with 16px insets.15-- [ ] 2.2 Move the Proof subline and board down as one group for two-line16- titles while retaining at least 40px HUD-to-board clearance.17-- [ ] 2.3 Apply the same helper to the INDEX banner without changing its17+- [x] 2.2 Move the Proof subline and board down as one group for wrapped titles18+ while retaining at least 40px HUD-to-board clearance. On the narrow fallback,19+ keep `STEPS 02` right aligned on the subline row.20+- [x] 2.3 Apply the same helper to the INDEX banner without changing its1821 banner or pointer hit geometry.19-- [ ] 2.4 Apply the same helper to the Win card without changing its actions22+- [x] 2.4 Apply the same helper to the Win card without changing its actions2023 or input hit geometry.21-- [ ] 2.5 Verify desktop, 390x844 mobile, `?slowmo=8`, and reduced-motion22- settled frames for a long modded title.24+- [x] 2.5 Verify desktop and 390x844 mobile, including the long-title INDEX,25+ Proof, and Win browser path. The captured mobile fallback uses the full band,26+ shared subline counter, and no ellipsis.2327 2428 ## 3. Verification and handoff2529 26-- [ ] 3.1 Run focused title/layout tests and the full Node suite.27-- [ ] 3.2 Run the production build and browser checks for Proof, INDEX, Win,30+- [x] 3.1 Run focused title/layout tests and the full Node suite.31+- [x] 3.2 Run the production build and browser checks for Proof, INDEX, Win,2832 mobile layout, navigation, and pointer actions.29-- [ ] 3.3 Confirm no engine, mod loader, diagnostics, or pointer semantics30- changed; leave the >32-character warning to its separate change.33+- [x] 3.3 Confirm no engine, input, diagnostics-envelope, or pointer semantics34+ changed; retain the >32-character W11 warning while enforcing the 64-character35+ loader ceiling.3136 - [ ] 3.4 Post the local long-title screenshots and layout evidence to the32- design inbox for review before publishing a preview revision.37+ design inbox and receive final design review before publishing a preview38+ revision.