Score Studio becomes the workspace mockup #3245
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"8e884091904e27c56a74ee6df83cbb24a3366c9b","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-12-04T22:29:05.281361Z">2026-12-04T22:29:05.281361Z</relative-time> | 8e88409 | New commits |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your 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.
</details>
</details>
<sub><sub>!P2 Badge</sub></sub> Restore all fields affected by Card basics edits on section undo
After changing Target in Card basics, that section's Undo or Back to applied restores only these listed keys, leaving the effects' targets changed by SetCardTarget. School edits similarly modify effects and magicShare through SetCardSchools, neither of which is captured here. Consequently, undoing these edits can restore the old classification tags while retaining the new combat behavior and scoring. Capture and restore the affected state, or implement field-specific inverses so section undo actually reverses its edits without discarding unrelated effect edits.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Refresh the text mode control when disabling Auto text
When Auto text is enabled and the user clicks its mode indicator, this branch changes the hidden checkbox and persisted preference but returns without requesting an inspector redraw. autoMark therefore still displays Auto and retains its click handler's captured auto = true; clicking it again only disables Auto again rather than re-enabling it. Request a redraw on the off path so the indicator and its next action reflect the updated state without requiring another card selection or edit.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a64222436a
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in 3910a58b2b: Card basics memory now also keeps damageSchool and magicShare (School edits) and the card's one target, which Undo/Back to applied puts back on every targeted effect the way the Target field sets it, so other effect edits stay; covered in tests/score-studio-workspace-section-memory.test.mjs.
_🤖 Addressed by Claude Code_
Fixed in 3910a58b2b: turning Auto text off now requests an Inspector redraw, so the indicator and its next click reflect the new state.
_🤖 Addressed by Claude Code_
<sub><sub>!P2 Badge</sub></sub> Populate the card metadata required by the gallery filters
When a user chooses Rank, Changed rank only, or Deck in the gallery's More filters, the visible cards are not narrowed. LinkGalleryFilter() installs GalleryEntries() as the live source, but these card entries omit rank, shifted, and deckIds; matchesStudio() explicitly passes rows with those properties absent. The richer StudioFallbackEntries() is bypassed once that source is installed. Populate the required metadata in the live adapter so these controls filter the displayed cards rather than only updating their badges and hidden legacy controls.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Track HP cost changes in Card basics section memory
When the optional HP cost field is shown and edited, Card basics records no change, so its Undo/Apply tools do not appear; Back to applied also leaves the HP cost unchanged. The Target/School restoration does not cover this case: FieldSetters.hpCost delegates to SetHpCost(), which mutates only effects, while the E2 slice captures neither that effect nor its amount. Track and restore the loseHp effect separately so section undo reverses HP cost edits without overwriting unrelated effect changes.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3910a58b2b
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in 82b511645d: the live gallery source now gives each card row its rank, shifted (rank differs from the baseline) and deckIds, so Rank, Changed rank only and Deck narrow the visible cards; covered in tests/score-studio-workspace-gallery.test.mjs.
_🤖 Addressed by Claude Code_
Fixed in 82b511645d: Card basics memory keeps HP cost as a derived value (read from the loseHp effect, restored through SetHpCost), alongside Target, so HP cost edits show Undo/Apply and Back to applied reverses them without touching other effects.
_🤖 Addressed by Claude Code_
<sub><sub>!P2 Badge</sub></sub> Regenerate automatic text when restoring an effects section
With Auto text enabled, changing a Heal effect from 3 to 6 updates textTemplate to Heal 6 HP. through MutateSelectedCard. Using the Effects section's Undo or Back to applied then restores the effect to 3 but leaves that text unchanged: E3 captures only effects, and WriteSlice explicitly disables automatic text generation here. The card consequently displays—and can save—text that contradicts its combat behavior while still indicating Auto mode. Allow automatic text regeneration when restoring mechanics sections, while preserving custom text and the Card text section's own restoration behavior.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82b511645d
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in 82b0cac1f2: Undo and Back to applied on Card basics, Effects and Tags now let Auto text rewrite the card text from the restored mechanics (config regeneratesText); custom text is kept by Auto text's own rule, and Card text still restores its own text.
_🤖 Addressed by Claude Code_
<sub><sub>!P1 Badge</sub></sub> Route Run to the visible workspace Playtest host
In the default workspace, where Playtest is closed and Properties is selected, clicking Run reloads the game without showing it. SwitchToPlay() still calls views.js's SetCustomizationView(), which changes StudioUi.cardEditorDockUi inside the hidden #studio-legacy container; its renderPaneView() callback only loads the frame and never updates the workspace's CurrentView or reveals pane J. Route this action through the workspace's Play view or reveal the configured Playtest pane so the user can see the game being run.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Preserve hosted elements across dock and float redraws
When a tool such as Weights or Design is docked or floating, the next full panel redraw replaces it with the missing-content message. RenderZone() and RenderFloats() remove the old bodies before constructing their replacements, so this document query cannot find the tool element still held in the detached old body. ReleaseDetached() returns it to its legacy home only after the replacement has already been drawn. The same sequence affects DrawPlayBody(). Retrieve the element from the hosting registry, or park hosted elements before clearing the old bodies, so selecting a card or rearranging panels does not blank an open tool.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Activate an existing document tab when revealing its pane
If Code is docked as a document tab and Gallery is active in the same well group, clicking a card section's </> button opens the code file but leaves Gallery visible. PlacedPanel() considers inactive well tabs placed, while DockZoneOf() returns null for them, so RevealPane() does nothing in this case. panelsWell.js renders only group.active, making the requested editor inaccessible until the user manually selects its tab. Activate the containing well group's tab when revealing a pane that is already placed there.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82b0cac1f2
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in 4d80eebc14: Run now goes through topbar/showGame.js, which opens or reveals the Playtest pane (or the Inspector's Play view when config runPlaces.openWhenClosed is false), redraws, then reloads the game, so the run is visible.
_🤖 Addressed by Claude Code_
Fixed in 354b720109: hosted tools and Playtest now take their element from the hosting registry (HostedElementOf) before any document query, so a dock or float redraw keeps Weights, Design, Game rules and Playtest filled; covered in tests/score-studio-workspace-hosted.test.mjs.
_🤖 Addressed by Claude Code_
Fixed in 92bda64dbb: RevealPane makes the target the active tab of its well or dock group when it is already placed there, so </> brings Code to the front behind an active Gallery; covered in tests/score-studio-workspace-reveal.test.mjs.
_🤖 Addressed by Claude Code_
<sub><sub>!P2 Badge</sub></sub> Keep the Playtest iframe connected during inspector redraws
With Playtest docked and a game running, selecting another card or editing an inspector field calls RedrawInspector() → RedrawPanels(), which clears this zone and detaches the game iframe. Although HostedElementOf() now preserves the host element, reinserting an iframe after detachment reloads its browsing context, so ordinary inspector interactions restart the embedded game instead of leaving the playtest running. The previous dock renderer reconciled existing pane DOM; retain the connected Playtest body across unrelated redraws rather than removing and reattaching it.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e88409190
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
Fixed in #3246 (this PR had merged): Inspector edits now redraw only the Inspector node, and redraws park hosted elements with moveBefore and put them back, so the Playtest iframe is never detached and the game no longer restarts; a browser check counts the frame's loads across card selections, edits and redraws.
_🤖 Addressed by Claude Code_
cehinds
Summary
Score Studio now is the workspace mockup (
docs/design/mockup/studio-workspace-mockup.html): the mockup's CSS (verbatim), markup and layout/dock code are the app, and Studio's data and features are wired in through adapters. The one intended visual difference: gallery card tiles are card-shaped at the old size. Plan and port map:docs/design/studio-mockup-port.md.index.htmlis the workspace page. The old dock (studio/dock/), theme (studio/theme/excepttokens.css) and their tests are removed.</>/✎ with Applied/Undone feedback, change-only dots,appsettings.jsonper environment with a banner, and a Debug menu (dev/test/local) with clickable feedback labels.npm run ws:test(focused tests, ~5 s),npm run ws:check(tests + mockup parity + screenshot, ~30 s),npm run ws:merge(integrator).Acceptance criteria
-
qa-sandboxdocs/qa/acceptance.dock-workspace.json --base origin/dev: PASS, 15/15.-
qa-sandboxdocs/qa/acceptance.dock-workspace.phone.json --base origin/dev: PASS, 5/5.-
npm run ws:check: parity PASS, 0 breaches.- 37 rewritten Studio QA specs pass at desktop and phone.
Tests
node --test tests/score-studio.test.mjs: all pass except the knownall twelve subclass signatures…failure, which already fails ondev.npm test: passes (run after the switch-over).tests/score-studio.browser.mjs): rewritten for the new page.Known follow-ups (in progress)
🤖 Generated with Claude Code