Repository navigation
Conversation
|
Gallery preview: https://components.verticopolis.com/pr-preview/pr-162/ Built from b5226b8. It updates when a push changes the package or the gallery, and it goes away with the next gallery deploy after this pull request closes. |
…dialog windows/scenarioList draws a game's scenarios as numbered rows in a launch window, each with its brief, its trophies (with the best mark's name beside them) and a Play button, or why it is locked. windows/newScenario is the New Scenario dialog for the shared modal: a list box beside the picked scenario's details, with Play and Cancel, the arrow keys, Home, End and Enter. Both draw from the same entries, which the caller works out. The gallery has a page for them, with screenshot tests in each scheme on a computer and a phone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD
windows/screenSaver/sceneBackdrop runs a scene on a canvas the page draws with the scene-backdrop class, sized to its box, rebuilt on resize, and still under reduced motion. The gallery's Scenario lists page puts the launch window over Endless Tower, from a fixed seed so the screenshot tests (run with reduced motion) see the same still frame every time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD
567a4e0 to
b62af9d
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
maniator
left a comment
There was a problem hiding this comment.
Independent review: CONDITIONAL GO on b62af9d
This comes from a separate thread. Copilot is out of quota, so it ran /gds-code-review (Blind Hunter, Edge Case Hunter, Acceptance Auditor, Hot-Path Auditor) and stand-in-pr-review. Locally I ran the three new unit files (23/23), typecheck, lint and Prettier over src, gallery and e2e, all green. There are no earlier threads. When I wrote this, CI's Typecheck and lint and its Compare the gallery screenshots jobs were still running; the rest are green.
Findings
patch
sceneBackdrop.ts:53: the resize listener outlives the canvas, and a window drag rebuilds the scene on everyresizeevent. Both contradict the doc comment and the body. Details and fix are inline.newScenario.ts:140: in a list box that scrolls, a keyboard pick can land out of view, because onlyaria-activedescendantmoves. Details and fix are inline.
nit (optional)
newScenarioKeyTarget: from no pick, ArrowDown skips the first entry (inline).
Checked, no finding
- No simulation rules and no engine imports. Entries, marks, lock reasons and the best tier all come from the caller, and
scenarioBestTextand the trophies only word that tier. All UI is lit templates with@eventbindings. The backdrop takes a canvas the page's own template draws. - The cascade layers:
scenario-list.cssdeclares the fullvc.windows.*order withscenario-listlast. Sheets that do not list it yet append it last on first use, so the order is the same whichever sheet loads first. The modal widening sits invc.page, as the body says. - Accessibility: the trophies are
role="img"with the result in words, ticks carry a hidden "(reached)", and the goals table has row and column headers. Locked rows have no Play button, and Play is disabled for a locked pick (a test and an e2e cover it). Rows are 44 px underpointer: coarse. - Screenshots: the spec runs with reduced motion and a fixed seed, so the backdrop shows one still frame. Baselines were minted in the pinned image.
- Public-safe: the gallery's scenarios are made up, and nothing names a private consumer.
- The change note is
minorfor new exports. README's cascade-layers section and ARCHITECTURE.md are updated. - Design sign-off: the body records the owner's pick of this look (chooser C plus A, Endless Tower backdrop). Under this repository's design rule, keep the screenshots in front of him before merge if the pick was made on mockups, not on these renders.
Hot-path record (section 6), b62af9d
| Item | Result |
|---|---|
| HP-1 callers and tier | Lists: on demand, at open and on each pick (dialog). Backdrop: runScene's rAF loop, at most MAX_FPS, plus start on every window resize. |
| HP-2 whole-collection work | One pass over the entries per draw. newScenarioKeyTarget builds an id array and runs an indexOf, both O(n) in a handful of entries, per key press. |
| HP-3 allocations | Per draw: templates and the id array. Per resize: a whole new scene with its layer canvases (patch 1: coalesce to one per frame). |
| HP-4 sorts | None. |
| HP-5 containers | None new. |
| HP-6 id lookups | find/some/indexOf over a handful of entries, on demand only. |
| HP-7 inherited algorithms | runScene and Endless Tower are reused unchanged. |
| HP-8 caches | None added or removed. Endless Tower's per-room layer canvas is kept within a scene's life. |
| HP-9 remedy | Patch 1: guard on isConnected and coalesce resizes to rAF. |
| HP-10 identical results and invalidation | A resize rebuilds at the new size. A test pins that. |
| HP-11 WASM, build and deps | No new dependency. There are three new windows/* subpaths through the existing map and one new sheet in styles.css. |
| HP-12 rendering | One canvas at a quarter of the CSS resolution, pointer-events: none, and aria-hidden from the caller. The lists are DOM only. |
Verdict: CONDITIONAL GO. The conditions are patches 1 and 2 with their tests, plus green required checks. I will re-review the delta.
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b62af9daeb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… the pick in view Review fixes. The backdrop rebuilds its scene at most once a frame during a window drag, and its resize listener goes with the stop or at the first resize after the canvas has left the page. The New Scenario list scrolls the picked row into view when a key moves the pick, and from no pick the arrow keys start at the first row. A goal with fewer than three marks leaves the later cells empty so the columns stay in line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD
Independent review: GO on 9f17f3aThis re-review covers the b62af9d..9f17f3a delta (one commit; the range-diff shows the first two commits unchanged), using
The section 6 record carries from b62af9d, except HP-3 and HP-9: a resize now rebuilds at most once a frame, and the listener ends with the canvas. Verdict: GO, once the required checks are green on 9f17f3a. Under the design rule, merge also waits on the owner's own OK of this look. Reviewed against Verticopolis conventions (.github/copilot-instructions.md). Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f17f3a04d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The modal's own list indent and paragraph spacing pushed the list box in from the edge and opened gaps between its rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD
Independent review: GO carries to 6739223The 9f17f3a..6739223 delta is one commit. It adds two Verdict: GO on 6739223, once the required checks are green, the screenshot compare included. Merge still waits on the owner's design OK. Generated by Claude Code |
…p once its canvas is laid out The sl- prefix collided with Starlight's own utility classes on the docs sites: the visually hidden helper hid the search box's text. The classes now use scn-. A template ref hands the backdrop its canvas before it is on the page, so the first build now waits a frame for its real size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD
|
The red "Compare the gallery screenshots" runs came from this PR. The visually hidden helper Generated by Claude Code |
Independent review: GO on b5226b8This covers the 6739223..b5226b8 delta, one commit.
The hot-path record carries. The deferred first build is one extra rAF, once. Verdict: GO on b5226b8, once the required checks are green. Merge still waits on the owner's design OK. Reviewed against Verticopolis conventions (.github/copilot-instructions.md). Generated by Claude Code |
What & why
A game with scenarios needs two ways to pick one: a launch window it can open on, and a File > New Scenario… dialog. Both are reusable UI, so they live here. They draw from one shared entry shape that the caller works out: title, facts, brief, goals with Goal/Better/Best marks, the best result kept, and why a scenario is locked. The lists read no saves and know nothing of a simulation. The launch window can sit over a screen saver scene running as a moving backdrop.
windows/scenarioList:scenarioLaunchTemplatedraws one window with a heading, numbered rows and a foot the caller fills. Each row has its brief, its trophies and a Play button, or the lock reason. The pieces are exported too:scenarioRowsTemplate,scenarioDetailsTemplate,scenarioGoalsTemplate,scenarioTrophiesTemplateandscenarioBestText.windows/newScenario:newScenarioView, a view forModalShell. It shows a list box beside the picked entry's details, with Play and Cancel. The arrow keys, Home and End move the pick, and Enter plays. A double-click also plays, but the Play button is always there, so no action is double-click only. Lead entries (a sandbox, say) carry their own details.windows/screenSaver/sceneBackdrop:startSceneBackdropruns a screen saver scene on a canvas the page draws with the newscene-backdropclass. It sizes the scene to the canvas's box, rebuilds it on resize, and holds one still frame under reduced motion.backdropSizegives the canvas size.styles/game/scenario-list.csssits in a newvc.windows.scenario-listlayer, declared aftervc.windows.appearanceand imported bystyles.css. The.scene-backdroprule lives instyles/game/screen-saver.css.Design notes that came with the owner's pick of this look:
Type of change
Quality gates
npm run typechecknpm run lintnpm run format:check(npm run formatfixes it)npm run icons:check,npm test(2425 passed after the rebase),npm run buildand the gallery typecheck are green locally too. The pinnedmcr.microsoft.com/playwright:v1.61.1-jammyimage minted the new spec's baselines and ran it twice in a row without a flake, along with the screen saver spec.Versioning
versionalone, or this is a release PR.changes/, or this PR changes nothing the package shipsThe note is
minor. README ("Cascade layers") and ARCHITECTURE.md name the new sheet and modules, and the gallery has a Scenario lists page.Complexity
The lists are drawn on demand, never per frame. The launch window draws once, one pass over the entries, O(n) in a handful of scenarios. The dialog redraws through
ModalShell.renderon each pick (one pass, and lit touches only what changed). Key handling is anindexOfover the ids. The backdrop is the screen saver's existing loop (runScene): one canvas at a quarter of the CSS pixel size, at most 30 frames a second, and Endless Tower paints each room once onto a layer canvas, so a frame is one copy whatever the tower's height. A resize rebuilds the scene once. There are no new caches or counters, and nothing runs once the backdrop is stopped or its canvas leaves the page.Hot-path record (section 6): the backdrop reuses
runSceneunchanged. The lists are on-demand UI with no frame-loop or render-model work.Screenshots / recordings
Every scheme on both screens is in
e2e/__screenshots__/(*-scenario-launch.png,*-new-scenario.png,new-scenario-locked.png). The gallery's Scenario lists page shows the backdrop moving.Notes for reviewers
#modal:has(> .modal-box > .sl-dialog)rule invc.page, the same way the Open window widens it.var(--trophy, #b07800). No scheme sets--trophyyet, so every scheme uses the fallback.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ms7trY1ut5RQ7Dh1hB8uGD