← Back to Pull requests

Score Studio becomes the workspace mockup #3245

Merged
cehinds merged 535 files (88381 lines) on Dec 04, 2026 22:38 UTC
View on GitHub
cehinds cehinds commented on Dec 04, 2026 21:46 UTC
Author

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.html is the workspace page. The old dock (studio/dock/), theme (studio/theme/ except tokens.css) and their tests are removed.

  • Areas wired to Studio: topbar and menus, Row B (search, filter, display, undo/redo, customise), gallery (loadouts, decks, cards, equipment), Inspector (cards and equipment: header, views, basics, effects, tags, text, upgrades, appearances, art layers, override, score parts, section tools), Deploy & Lists, status bar, Playtest, Terminal, Output, Git, History, Solution Explorer, Code view, tool panes, dialogs in the mockup's modal, keyboard shortcuts, phone layout.

  • Owner requests during review: Output pane, toolbar customisation, uniform pins, smart tooltips, section Undo/Apply/</>/✎ with Applied/Undone feedback, change-only dots, appsettings.json per environment with a banner, and a Debug menu (dev/test/local) with clickable feedback labels.

  • Developer loop: 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


  • Request: "take the mock up and port features to it. it should look like the mock up first and foremost in look and positioning … the only difference is that the data is accessed and features work and the cards have a card shape."

  • Success: at 1280×800 the workspace matches the mockup (parity tool: box/style breaches 0, pixel differences 0% in every area, data-driven parts masked); every Studio feature reachable from the new page; phone layout usable.

  • Failure: any parity breach, a console error on load, a Studio feature with no way to reach it, a dead control with no feedback.

  • Result:

  • - qa-sandbox docs/qa/acceptance.dock-workspace.json --base origin/dev: PASS, 15/15.
    - qa-sandbox docs/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.
  • Screenshots (1280×800 and 390×844, next to the mockup): https://claude.ai/artifact/AfPuPAXV6rnJky1G5BAYJr (private; the owner shares it).
  • Tests


  • node --test tests/score-studio.test.mjs: all pass except the known all twelve subclass signatures… failure, which already fails on dev.

  • npm test: passes (run after the switch-over).

  • Browser tests (tests/score-studio.browser.mjs): rewritten for the new page.
  • Known follow-ups (in progress)


  • An Inspector audit session is clicking every Inspector control; its findings land on this branch.

  • Phone: Card basics values truncate in the two-column rows.

  • A 4px overflow on Effects/Tags/Card text section heads at narrow pane widths.

  • The Equipment section starts empty (its type is unticked in the Filter menu by default, as in the mockup).
  • 🤖 Generated with Claude Code

    Diff: 88381 lines (+66322 / -22059) across 535 files Reviewer: cehinds Review duration: 51m
    All Vouch review confidence checks passed
    Residual risk 0.58 = Change Risk (0.86) × (1 − Review Confidence (0.32)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.86 · 88381 lines diff across 535 files
    0.86
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.45 · 5 substantive comment(s)
    0.45
    Model 3 · Review Timing & Attention
    Session adequacy: 2% · Reviewer familiarity: 50%
    32%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Self Review self_review
    0.140
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    25 items
    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 21:46 UTC
    Bot

    <!-- 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

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • 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>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 21:49 UTC
    Code Review
    tools/score-studio/studio/workspace/config/sectionTools.json:1
    @@ -0,0 +1,66 @@
    +{
    +  "$note": "The section label's tools (studio/workspace/inspector/section*.js): what each section's own history covers, how the Applied and Undone flashes look, and which parts a section can show.",
    +  "memory": {
    +    "$note": "Each card section keeps its own history of the card keys it edits; Undo steps it back, Apply keeps it as the section's saved state.",
    +    "historyMax": 50,
    +    "keys": {
    +      "E2": ["class", "cardType", "type", "rarity", "staminaCost", "cost", "manaCost", "costRule", "tags"],

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 21:49 UTC
    Code Review
    tools/score-studio/studio/workspace/inspector/cardFieldEdits.js:1
    @@ -0,0 +1,179 @@
    +// The inspector's edits, each through Studio's own edit functions so history, the draft, the
    +// card's tile and its score stay in step. The inspected card may be a locked one, so each edit
    +// names its card and the selection is lent to Studio for that one call.
    +import inspector from '../config/inspector.json' with { type: 'json' };
    +import { state } from '../../studioState.js';
    +import { SelectStudioCard } from '../../cardGallery.js';
    +import { SelectionOptions } from '../../../workingContext.js';
    +import { registries } from '../../studioCore.js';
    +import { WriteStoredJson } from '../../studioEnv.js';
    +import { AUTO_TEXT_KEY, MutateSelectedCard } from '../../cardEdit.js';
    +import { SetHpCost } from '../../cardInspectorEdits.js';
    +import {
    +    SetCardKind,
    +    SetCardSchools,
    +    SetCardTarget,
    +} from '../../cardModel.js';
    +import {
    +    ApplyCostRule,
    +    PinStudioMana,
    +    PinStudioStamina,
    +} from '../../chargedCosts.js';
    +import { ShownCosts } from './cardViewModel.js';
    +
    +const { basics } = inspector;
    +const [MARTIAL_SCHOOL, MAGIC_SCHOOL] = basics.schools;
    +const NO_AUTO_NAME = { autoName: false };
    +const TEXT_EDIT = {
    +    autoName: false,
    +    autoText: false,
    +};
    +
    +const FieldSetters = Object.freeze({
    +    class: (def, value) =>
    +    {
    +        def.class = value;
    +    },
    +    rarity: (def, value) =>
    +    {
    +        def.rarity = value;
    +    },
    +    type: (def, value) => SetCardKind(def, value),
    +    target: (def, value) => SetCardTarget(def, value),
    +    school: (def, value) => SetCardSchools(def, {
    +        martial: value !== MAGIC_SCHOOL,
    +        magic: value !== MARTIAL_SCHOOL,
    +    }),
    +    spCost: (def, value) => PinStudioStamina(def, Number(value), ShownCosts(def)),
    +    mpCost: (def, value) => PinStudioMana(def, Number(value), ShownCosts(def)),
    +    hpCost: (def, value) => SetHpCost(def, Number(value)),
    +    costRule: (def, value) => ApplyCostRule(
    +        def,
    +        value,
    +        ShownCosts(def),
    +        registries.cards.get(def.id) ?? null,
    +    ),
    +});
    +
    +/**
    + * Runs the edit with the card selected (through Studio's setter), then selects the previous card
    + * again unless the edit chose another card itself (Duplicate and Delete do).
    + */
    +export function WithCardSelected(cardId, edit)
    +{
    +    const previous = state.selectedCardId;
    +    if (previous === cardId)
    +    {
    +        edit();
    +        return;
    +    }
    +    SelectStudioCard(cardId, SelectionOptions.Deferred);
    +    try
    +    {
    +        edit();
    +    }
    +    finally
    +    {
    +        if (state.selectedCardId === cardId)
    +        {
    +            SelectStudioCard(previous, SelectionOptions.Deferred);
    +        }
    +    }
    +}
    +
    +/** Sets one Card basics field on the card. */
    +export function ApplyFieldValue(cardId, fieldId, value)
    +{
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) => FieldSetters[fieldId](def, value)),
    +    );
    +}
    +
    +/** Renames the card; the name stays as typed, so Auto-name goes off. */
    +export function RenameCard(cardId, name)
    +{
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) =>
    +        {
    +            def._autoName = false;
    +            def.name = name;
    +        }, NO_AUTO_NAME),
    +    );
    +}
    +
    +/** True while the card's name follows its naming convention. */
    +export function IsAutoName(def)
    +{
    +    return Boolean(def._autoName);
    +}
    +
    +/** Turns Auto-name on (the card is renamed at once) or off (the name is kept as it is). */
    +export function SetAutoName(cardId, on)
    +{
    +    const options = on
    +        ? undefined
    +        : NO_AUTO_NAME;
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard(
    +            (def) =>
    +            {
    +                def._autoName = on;
    +            },
    +            options,
    +        ),
    +    );
    +}
    +
    +function autoToggle()
    +{
    +    return document.getElementById(inspector.text.autoToggleId);
    +}
    +
    +/** True while Studio writes the card's text from its effects. */
    +export function IsAutoText(def)
    +{
    +    return Boolean(autoToggle()?.checked) && def._autoText !== false;
    +}
    +
    +/** Types the card's own text; Auto text goes off so the words are kept. */
    +export function SetCardText(cardId, text)
    +{
    +    const toggle = autoToggle();
    +    if (toggle)
    +    {
    +        toggle.checked = false;
    +    }
    +    WriteStoredJson(AUTO_TEXT_KEY, false);
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) =>
    +        {
    +            def.textTemplate = text;
    +        }, TEXT_EDIT),
    +    );
    +}
    +
    +/** Turns Auto text on (the text is written from the effects at once) or off (kept as it is). */
    +export function SetAutoText(cardId, on)
    +{
    +    const toggle = autoToggle();
    +    if (toggle)
    +    {
    +        toggle.checked = on;
    +    }
    +    WriteStoredJson(AUTO_TEXT_KEY, on);
    +    if (!on)
    +    {
    +        return;

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 21:49 UTC
    Reviewer

    <!-- 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

  • 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".

    </details>

    cehinds cehinds commented on code on Dec 04, 2026 21:52 UTC
    Code Review
    tools/score-studio/studio/workspace/config/sectionTools.json:1
    @@ -0,0 +1,66 @@
    +{
    +  "$note": "The section label's tools (studio/workspace/inspector/section*.js): what each section's own history covers, how the Applied and Undone flashes look, and which parts a section can show.",
    +  "memory": {
    +    "$note": "Each card section keeps its own history of the card keys it edits; Undo steps it back, Apply keeps it as the section's saved state.",
    +    "historyMax": 50,
    +    "keys": {
    +      "E2": ["class", "cardType", "type", "rarity", "staminaCost", "cost", "manaCost", "costRule", "tags"],

    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_

    cehinds cehinds commented on code on Dec 04, 2026 21:53 UTC
    Code Review
    tools/score-studio/studio/workspace/inspector/cardFieldEdits.js:1
    @@ -0,0 +1,179 @@
    +// The inspector's edits, each through Studio's own edit functions so history, the draft, the
    +// card's tile and its score stay in step. The inspected card may be a locked one, so each edit
    +// names its card and the selection is lent to Studio for that one call.
    +import inspector from '../config/inspector.json' with { type: 'json' };
    +import { state } from '../../studioState.js';
    +import { SelectStudioCard } from '../../cardGallery.js';
    +import { SelectionOptions } from '../../../workingContext.js';
    +import { registries } from '../../studioCore.js';
    +import { WriteStoredJson } from '../../studioEnv.js';
    +import { AUTO_TEXT_KEY, MutateSelectedCard } from '../../cardEdit.js';
    +import { SetHpCost } from '../../cardInspectorEdits.js';
    +import {
    +    SetCardKind,
    +    SetCardSchools,
    +    SetCardTarget,
    +} from '../../cardModel.js';
    +import {
    +    ApplyCostRule,
    +    PinStudioMana,
    +    PinStudioStamina,
    +} from '../../chargedCosts.js';
    +import { ShownCosts } from './cardViewModel.js';
    +
    +const { basics } = inspector;
    +const [MARTIAL_SCHOOL, MAGIC_SCHOOL] = basics.schools;
    +const NO_AUTO_NAME = { autoName: false };
    +const TEXT_EDIT = {
    +    autoName: false,
    +    autoText: false,
    +};
    +
    +const FieldSetters = Object.freeze({
    +    class: (def, value) =>
    +    {
    +        def.class = value;
    +    },
    +    rarity: (def, value) =>
    +    {
    +        def.rarity = value;
    +    },
    +    type: (def, value) => SetCardKind(def, value),
    +    target: (def, value) => SetCardTarget(def, value),
    +    school: (def, value) => SetCardSchools(def, {
    +        martial: value !== MAGIC_SCHOOL,
    +        magic: value !== MARTIAL_SCHOOL,
    +    }),
    +    spCost: (def, value) => PinStudioStamina(def, Number(value), ShownCosts(def)),
    +    mpCost: (def, value) => PinStudioMana(def, Number(value), ShownCosts(def)),
    +    hpCost: (def, value) => SetHpCost(def, Number(value)),
    +    costRule: (def, value) => ApplyCostRule(
    +        def,
    +        value,
    +        ShownCosts(def),
    +        registries.cards.get(def.id) ?? null,
    +    ),
    +});
    +
    +/**
    + * Runs the edit with the card selected (through Studio's setter), then selects the previous card
    + * again unless the edit chose another card itself (Duplicate and Delete do).
    + */
    +export function WithCardSelected(cardId, edit)
    +{
    +    const previous = state.selectedCardId;
    +    if (previous === cardId)
    +    {
    +        edit();
    +        return;
    +    }
    +    SelectStudioCard(cardId, SelectionOptions.Deferred);
    +    try
    +    {
    +        edit();
    +    }
    +    finally
    +    {
    +        if (state.selectedCardId === cardId)
    +        {
    +            SelectStudioCard(previous, SelectionOptions.Deferred);
    +        }
    +    }
    +}
    +
    +/** Sets one Card basics field on the card. */
    +export function ApplyFieldValue(cardId, fieldId, value)
    +{
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) => FieldSetters[fieldId](def, value)),
    +    );
    +}
    +
    +/** Renames the card; the name stays as typed, so Auto-name goes off. */
    +export function RenameCard(cardId, name)
    +{
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) =>
    +        {
    +            def._autoName = false;
    +            def.name = name;
    +        }, NO_AUTO_NAME),
    +    );
    +}
    +
    +/** True while the card's name follows its naming convention. */
    +export function IsAutoName(def)
    +{
    +    return Boolean(def._autoName);
    +}
    +
    +/** Turns Auto-name on (the card is renamed at once) or off (the name is kept as it is). */
    +export function SetAutoName(cardId, on)
    +{
    +    const options = on
    +        ? undefined
    +        : NO_AUTO_NAME;
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard(
    +            (def) =>
    +            {
    +                def._autoName = on;
    +            },
    +            options,
    +        ),
    +    );
    +}
    +
    +function autoToggle()
    +{
    +    return document.getElementById(inspector.text.autoToggleId);
    +}
    +
    +/** True while Studio writes the card's text from its effects. */
    +export function IsAutoText(def)
    +{
    +    return Boolean(autoToggle()?.checked) && def._autoText !== false;
    +}
    +
    +/** Types the card's own text; Auto text goes off so the words are kept. */
    +export function SetCardText(cardId, text)
    +{
    +    const toggle = autoToggle();
    +    if (toggle)
    +    {
    +        toggle.checked = false;
    +    }
    +    WriteStoredJson(AUTO_TEXT_KEY, false);
    +    WithCardSelected(
    +        cardId,
    +        () => MutateSelectedCard((def) =>
    +        {
    +            def.textTemplate = text;
    +        }, TEXT_EDIT),
    +    );
    +}
    +
    +/** Turns Auto text on (the text is written from the effects at once) or off (kept as it is). */
    +export function SetAutoText(cardId, on)
    +{
    +    const toggle = autoToggle();
    +    if (toggle)
    +    {
    +        toggle.checked = on;
    +    }
    +    WriteStoredJson(AUTO_TEXT_KEY, on);
    +    if (!on)
    +    {
    +        return;

    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_

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 21:56 UTC
    Code Review
    tools/score-studio/studio/workspace/gallery/galleryEntries.js:1
    @@ -0,0 +1,156 @@
    +// The adapter from Studio's data to the mockup's gallery rows: { kind, id, name, cls, meta, cp,
    +// items, def }. Pure: the caller passes the records and the scoring, so a test can feed fixtures.
    +import gallery from '../config/gallery.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { PluralStudioText } from '../../kit/plural.js';
    +
    +const { kinds, classlessId, orderKeys } = gallery;
    +const NO_ITEMS = [];
    +const NO_ORDER = [];
    +
    +function capitalise(text)
    +{
    +    return text
    +        ? text[0].toUpperCase() + text.slice(1)
    +        : '';
    +}
    +
    +function classLabel(source, classId)
    +{
    +    const hasClass = classId && classId !== classlessId;
    +    return hasClass
    +        ? source.classNameOf(classId)
    +        : StudioText('workspaceGallery.meta.classless');
    +}
    +
    +function namesOf(ids, records, idOf)
    +{
    +    const byId = new Map(records.map(record => [idOf(record), record.name]));
    +    return ids.map(id => byId.get(id) || id);
    +}
    +
    +function cardEntry(source, def)
    +{
    +    const cp = source.cardPower(def);
    +    return {
    +        kind: kinds.card,
    +        id: def.id,
    +        name: def.name,
    +        classId: def.class,
    +        cls: classLabel(source, def.class),
    +        meta: StudioText('workspaceGallery.meta.card', {
    +            type: capitalise(def.type),
    +            cp,
    +        }),
    +        cp,
    +        def,

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 21:56 UTC
    Code Review
    tools/score-studio/studio/workspace/config/sectionTools.json:1
    @@ -0,0 +1,71 @@
    +{
    +  "$note": "The section label's tools (studio/workspace/inspector/section*.js): what each section's own history covers, how the Applied and Undone flashes look, and which parts a section can show.",
    +  "memory": {
    +    "$note": "Each card section keeps its own history of the card keys it edits; Undo steps it back, Apply keeps it as the section's saved state.",
    +    "historyMax": 50,
    +    "keys": {
    +      "E2": ["class", "cardType", "type", "rarity", "staminaCost", "cost", "manaCost", "costRule", "tags", "damageSchool", "magicShare"],

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 21:56 UTC
    Reviewer

    <!-- 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

  • 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".

    </details>

    cehinds cehinds commented on code on Dec 04, 2026 21:59 UTC
    Code Review
    tools/score-studio/studio/workspace/gallery/galleryEntries.js:1
    @@ -0,0 +1,156 @@
    +// The adapter from Studio's data to the mockup's gallery rows: { kind, id, name, cls, meta, cp,
    +// items, def }. Pure: the caller passes the records and the scoring, so a test can feed fixtures.
    +import gallery from '../config/gallery.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { PluralStudioText } from '../../kit/plural.js';
    +
    +const { kinds, classlessId, orderKeys } = gallery;
    +const NO_ITEMS = [];
    +const NO_ORDER = [];
    +
    +function capitalise(text)
    +{
    +    return text
    +        ? text[0].toUpperCase() + text.slice(1)
    +        : '';
    +}
    +
    +function classLabel(source, classId)
    +{
    +    const hasClass = classId && classId !== classlessId;
    +    return hasClass
    +        ? source.classNameOf(classId)
    +        : StudioText('workspaceGallery.meta.classless');
    +}
    +
    +function namesOf(ids, records, idOf)
    +{
    +    const byId = new Map(records.map(record => [idOf(record), record.name]));
    +    return ids.map(id => byId.get(id) || id);
    +}
    +
    +function cardEntry(source, def)
    +{
    +    const cp = source.cardPower(def);
    +    return {
    +        kind: kinds.card,
    +        id: def.id,
    +        name: def.name,
    +        classId: def.class,
    +        cls: classLabel(source, def.class),
    +        meta: StudioText('workspaceGallery.meta.card', {
    +            type: capitalise(def.type),
    +            cp,
    +        }),
    +        cp,
    +        def,

    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_

    cehinds cehinds commented on code on Dec 04, 2026 21:59 UTC
    Code Review
    tools/score-studio/studio/workspace/config/sectionTools.json:1
    @@ -0,0 +1,71 @@
    +{
    +  "$note": "The section label's tools (studio/workspace/inspector/section*.js): what each section's own history covers, how the Applied and Undone flashes look, and which parts a section can show.",
    +  "memory": {
    +    "$note": "Each card section keeps its own history of the card keys it edits; Undo steps it back, Apply keeps it as the section's saved state.",
    +    "historyMax": 50,
    +    "keys": {
    +      "E2": ["class", "cardType", "type", "rarity", "staminaCost", "cost", "manaCost", "costRule", "tags", "damageSchool", "magicShare"],

    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_

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 22:02 UTC
    Code Review
    tools/score-studio/studio/workspace/inspector/sectionSliceEdit.js:1
    @@ -0,0 +1,83 @@
    +// Puts a section's saved keys back on the card through Studio's edit function, so history, the
    +// draft, the card's tile and its score follow and the step is one undoable change.
    +import tools from '../config/sectionTools.json' with { type: 'json' };
    +import { MutateSelectedCard } from '../../cardEdit.js';
    +import { GetCardTarget, SetCardTarget } from '../../cardModel.js';
    +import { HpCostOp, SetHpCost } from '../../cardInspectorEdits.js';
    +import { SetSectionDerivedReader } from './sectionMemory.js';
    +import { WithCardSelected } from './cardFieldEdits.js';
    +
    +const { memory } = tools;
    +const NO_HP_COST = 0;
    +const KEEP_NAMES = {
    +    autoName: false,
    +    autoText: false,

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 22:02 UTC
    Reviewer

    <!-- 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

  • 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".

    </details>

    cehinds cehinds commented on code on Dec 04, 2026 22:07 UTC
    Code Review
    tools/score-studio/studio/workspace/inspector/sectionSliceEdit.js:1
    @@ -0,0 +1,83 @@
    +// Puts a section's saved keys back on the card through Studio's edit function, so history, the
    +// draft, the card's tile and its score follow and the step is one undoable change.
    +import tools from '../config/sectionTools.json' with { type: 'json' };
    +import { MutateSelectedCard } from '../../cardEdit.js';
    +import { GetCardTarget, SetCardTarget } from '../../cardModel.js';
    +import { HpCostOp, SetHpCost } from '../../cardInspectorEdits.js';
    +import { SetSectionDerivedReader } from './sectionMemory.js';
    +import { WithCardSelected } from './cardFieldEdits.js';
    +
    +const { memory } = tools;
    +const NO_HP_COST = 0;
    +const KEEP_NAMES = {
    +    autoName: false,
    +    autoText: false,

    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_

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 22:12 UTC
    Code Review
    tools/score-studio/studio/workspace/topbar/runMenu.js:1
    @@ -0,0 +1,257 @@
    +// The Run control (A6, A9, A10): Studio's chosen build target on the Run button, its caret menu
    +// of targets, where the game opens, and Configure Deploy Lists. The target is Studio's own
    +// (deployTopbar.json, kept in this browser); Pause and Step have no Studio feature behind them.
    +import topbarConfig from '../../deployTopbar.json' with { type: 'json' };
    +import topbar from '../config/topbar.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { DeleteLocalDeploy } from '../../deployClient.js';
    +import {
    +    ApplyDeploySummary,
    +    DeployStatus,
    +    OnDeployStatusChanged,
    +} from '../../deployStatus.js';
    +import {
    +    DeployText,
    +    Words,
    +} from '../../deployText.js';
    +import {
    +    NotifyError,
    +    NotifyInfo,
    +} from '../../deployNotify.js';
    +import { SwitchToPlay } from '../../deployNavigation.js';
    +import {
    +    NotifyRunTargetChanged,
    +    OnRunTargetChanged,
    +} from '../../deployRunTarget.js';
    +import { RevealDeployPane } from '../../deployPaneRegistry.js';
    +import {
    +    ReadStoredJson,
    +    WriteStoredJson,
    +} from '../../studioEnv.js';
    +import { DomEvent } from '../../kit/dom.js';
    +import { PluralStudioText } from '../../kit/plural.js';
    +import { KitFrame } from '../kit/kitHost.js';
    +import { GalleryGroupId, InWell } from '../panels/panelsModelWell.js';
    +import { DockZoneOf } from '../panels/panelsQueries.js';
    +import { MovePane } from '../panels/panelsActions.js';
    +import { DropTypes } from '../panels/panelsShared.js';
    +import { GetPanels } from '../panels/panelsStore.js';
    +import { BindStateMenu } from './stateMenu.js';
    +
    +const { glyphs, ids, runPlaces } = topbar;
    +const { actions: Actions, storageKeys: StorageKey } = topbarConfig;
    +const TEXT_ROOT = 'workspaceTopbar.run';
    +const NO_LISTS = 0;
    +
    +function findTarget(id)
    +{
    +    const wanted = topbarConfig.targets.find((target) => target.id === id);
    +    return wanted ?? topbarConfig.targets.find(
    +        (target) => target.id === topbarConfig.defaultTarget,
    +    );
    +}
    +
    +function runWords(name, tokens)
    +{
    +    return StudioText(`${TEXT_ROOT}.${name}`, tokens);
    +}
    +
    +function targetLabel(target)
    +{
    +    return DeployText(Words.topbar.targets[target.id].label);
    +}
    +
    +/** The chosen run target (from Studio's own storage). */
    +export function ChosenRunTarget()
    +{
    +    return findTarget(ReadStoredJson(StorageKey.target, null));
    +}
    +
    +/** The words on the Run button: the target, with the deployed list count for Local Overlay. */
    +export function RunLabelText()
    +{
    +    const target = ChosenRunTarget();
    +    const status = DeployStatus();
    +    const showCount = target.action === Actions.localOverlay && status.listCount > NO_LISTS;
    +    if (!showCount)
    +    {
    +        return runWords('label', { target: targetLabel(target) });
    +    }
    +    return PluralStudioText(`${TEXT_ROOT}.labelWithLists`, status.listCount, {
    +        target: targetLabel(target),
    +    });
    +}
    +
    +async function restoreStock()
    +{
    +    const answer = await DeleteLocalDeploy();
    +    if (!answer.ok)
    +    {
    +        NotifyError(DeployText(Words.topbar.toasts.runFailed, { error: answer.error }));
    +        return false;
    +    }
    +    ApplyDeploySummary(answer.data.summary);
    +    return true;
    +}
    +
    +/** What the Run button does for the chosen target, as Studio's own Run does. */
    +export async function RunChosenTarget()
    +{
    +    const target = ChosenRunTarget();
    +    if (target.action === Actions.openUrl)
    +    {
    +        window.open(target.url, topbarConfig.openUrlTarget, topbarConfig.openUrlFeatures);
    +        NotifyInfo(DeployText(Words.topbar.toasts.runUrl, { target: targetLabel(target) }));
    +        return;
    +    }
    +    if (target.action === Actions.stock && !(await restoreStock()))
    +    {
    +        return;
    +    }
    +    SwitchToPlay();

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 22:12 UTC
    Code Review
    tools/score-studio/studio/workspace/hosted/toolPanes.js:1
    @@ -0,0 +1,69 @@
    +// The Studio tools that open as panes (Effects, Sandbox, Weights, Design, Game rules): each moves
    +// its existing tab panel into the pane body and starts it. All are closed until Window opens one.
    +import hosted from '../config/hosted.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { RenderArtTab } from '../../artTab.js';
    +import { OpenGameRules } from '../../gameRulesHost.js';
    +import { RenderSandbox } from '../../sandbox.js';
    +import { RenderWeights } from '../../weightsPanel.js';
    +import { El } from '../kit/el.js';
    +import { ActivateStudioTab, HostElement } from './hostElement.js';
    +
    +const { tags, classes, toolPanes, start: StartName } = hosted;
    +const MISSING_TEXT = 'workspaceHosted.tools.missing';
    +const TOOL_BY_PANE = new Map(toolPanes.list.map((tool) => [tool.id, tool]));
    +const StartActions = Object.freeze({
    +    [StartName.renderSandbox]: () => RenderSandbox(),
    +    [StartName.renderWeights]: () => RenderWeights(),
    +    [StartName.renderArt]: () => RenderArtTab(),
    +    [StartName.openRules]: () => OpenGameRules(),
    +});
    +
    +/** The pane ids of every tool pane, in order. */
    +export function ToolPaneIds()
    +{
    +    return toolPanes.list.map((tool) => tool.id);
    +}
    +
    +/** True for a pane that hosts a Studio tool. */
    +export function IsToolPane(id)
    +{
    +    return TOOL_BY_PANE.has(id);
    +}
    +
    +function startTool(tool)
    +{
    +    if (tool.tab)
    +    {
    +        ActivateStudioTab(tool.tab);
    +    }
    +    StartActions[tool.start]?.();
    +}
    +
    +/** The pane id of the tool whose hidden Studio tab button this is, or null. */
    +export function ToolPaneOfTabButton(button)
    +{
    +    const tab = button?.dataset?.tab;
    +    const tool = toolPanes.list.find((candidate) => candidate.tab && candidate.tab === tab);
    +    return tool?.id ?? null;
    +}
    +
    +/** Fills a tool pane's body with its Studio element and starts it. */
    +export function DrawToolPane(body, id)
    +{
    +    const tool = TOOL_BY_PANE.get(id);
    +    if (!tool)
    +    {
    +        return;
    +    }
    +    const element = document.querySelector(tool.selector);
    +    if (!element)
    +    {
    +        body.append(El(tags.div, classes.empty, StudioText(MISSING_TEXT)));
    +        return;

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 22:12 UTC
    Code Review
    tools/score-studio/studio/workspace/hosted/revealPane.js:1
    @@ -0,0 +1,31 @@
    +// Shows a pane the person asked for: places it where it lives when it is closed, or opens its edge
    +// tab when its dock is folded.
    +import { OpenEdgeTab, MovePane } from '../panels/panelsActions.js';
    +import { HomeTarget } from '../panels/panelsModelMove.js';
    +import {
    +    DockZoneOf,
    +    HiddenZoneOf,
    +    PlacedPanel,
    +} from '../panels/panelsQueries.js';
    +import { GetPanels } from '../panels/panelsStore.js';
    +
    +function isFolded(panels, id, zone)
    +{
    +    return Boolean(HiddenZoneOf(panels, id) || (zone && panels.autoHide[zone]));
    +}
    +
    +/** Brings the pane into view. */
    +export function RevealPane(id)
    +{
    +    const panels = GetPanels();
    +    if (!PlacedPanel(panels, id))
    +    {
    +        MovePane(id, HomeTarget(panels, id));
    +        return;
    +    }
    +    const zone = DockZoneOf(panels, id);
    +    if (zone && isFolded(panels, id, zone))
    +    {
    +        OpenEdgeTab(zone, id);

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 22:12 UTC
    Reviewer

    <!-- 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

  • 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".

    </details>

    cehinds cehinds commented on code on Dec 04, 2026 22:24 UTC
    Code Review
    tools/score-studio/studio/workspace/topbar/runMenu.js:1
    @@ -0,0 +1,257 @@
    +// The Run control (A6, A9, A10): Studio's chosen build target on the Run button, its caret menu
    +// of targets, where the game opens, and Configure Deploy Lists. The target is Studio's own
    +// (deployTopbar.json, kept in this browser); Pause and Step have no Studio feature behind them.
    +import topbarConfig from '../../deployTopbar.json' with { type: 'json' };
    +import topbar from '../config/topbar.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { DeleteLocalDeploy } from '../../deployClient.js';
    +import {
    +    ApplyDeploySummary,
    +    DeployStatus,
    +    OnDeployStatusChanged,
    +} from '../../deployStatus.js';
    +import {
    +    DeployText,
    +    Words,
    +} from '../../deployText.js';
    +import {
    +    NotifyError,
    +    NotifyInfo,
    +} from '../../deployNotify.js';
    +import { SwitchToPlay } from '../../deployNavigation.js';
    +import {
    +    NotifyRunTargetChanged,
    +    OnRunTargetChanged,
    +} from '../../deployRunTarget.js';
    +import { RevealDeployPane } from '../../deployPaneRegistry.js';
    +import {
    +    ReadStoredJson,
    +    WriteStoredJson,
    +} from '../../studioEnv.js';
    +import { DomEvent } from '../../kit/dom.js';
    +import { PluralStudioText } from '../../kit/plural.js';
    +import { KitFrame } from '../kit/kitHost.js';
    +import { GalleryGroupId, InWell } from '../panels/panelsModelWell.js';
    +import { DockZoneOf } from '../panels/panelsQueries.js';
    +import { MovePane } from '../panels/panelsActions.js';
    +import { DropTypes } from '../panels/panelsShared.js';
    +import { GetPanels } from '../panels/panelsStore.js';
    +import { BindStateMenu } from './stateMenu.js';
    +
    +const { glyphs, ids, runPlaces } = topbar;
    +const { actions: Actions, storageKeys: StorageKey } = topbarConfig;
    +const TEXT_ROOT = 'workspaceTopbar.run';
    +const NO_LISTS = 0;
    +
    +function findTarget(id)
    +{
    +    const wanted = topbarConfig.targets.find((target) => target.id === id);
    +    return wanted ?? topbarConfig.targets.find(
    +        (target) => target.id === topbarConfig.defaultTarget,
    +    );
    +}
    +
    +function runWords(name, tokens)
    +{
    +    return StudioText(`${TEXT_ROOT}.${name}`, tokens);
    +}
    +
    +function targetLabel(target)
    +{
    +    return DeployText(Words.topbar.targets[target.id].label);
    +}
    +
    +/** The chosen run target (from Studio's own storage). */
    +export function ChosenRunTarget()
    +{
    +    return findTarget(ReadStoredJson(StorageKey.target, null));
    +}
    +
    +/** The words on the Run button: the target, with the deployed list count for Local Overlay. */
    +export function RunLabelText()
    +{
    +    const target = ChosenRunTarget();
    +    const status = DeployStatus();
    +    const showCount = target.action === Actions.localOverlay && status.listCount > NO_LISTS;
    +    if (!showCount)
    +    {
    +        return runWords('label', { target: targetLabel(target) });
    +    }
    +    return PluralStudioText(`${TEXT_ROOT}.labelWithLists`, status.listCount, {
    +        target: targetLabel(target),
    +    });
    +}
    +
    +async function restoreStock()
    +{
    +    const answer = await DeleteLocalDeploy();
    +    if (!answer.ok)
    +    {
    +        NotifyError(DeployText(Words.topbar.toasts.runFailed, { error: answer.error }));
    +        return false;
    +    }
    +    ApplyDeploySummary(answer.data.summary);
    +    return true;
    +}
    +
    +/** What the Run button does for the chosen target, as Studio's own Run does. */
    +export async function RunChosenTarget()
    +{
    +    const target = ChosenRunTarget();
    +    if (target.action === Actions.openUrl)
    +    {
    +        window.open(target.url, topbarConfig.openUrlTarget, topbarConfig.openUrlFeatures);
    +        NotifyInfo(DeployText(Words.topbar.toasts.runUrl, { target: targetLabel(target) }));
    +        return;
    +    }
    +    if (target.action === Actions.stock && !(await restoreStock()))
    +    {
    +        return;
    +    }
    +    SwitchToPlay();

    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_

    cehinds cehinds commented on code on Dec 04, 2026 22:24 UTC
    Code Review
    tools/score-studio/studio/workspace/hosted/toolPanes.js:1
    @@ -0,0 +1,69 @@
    +// The Studio tools that open as panes (Effects, Sandbox, Weights, Design, Game rules): each moves
    +// its existing tab panel into the pane body and starts it. All are closed until Window opens one.
    +import hosted from '../config/hosted.json' with { type: 'json' };
    +import { StudioText } from '../../../studioText.js';
    +import { RenderArtTab } from '../../artTab.js';
    +import { OpenGameRules } from '../../gameRulesHost.js';
    +import { RenderSandbox } from '../../sandbox.js';
    +import { RenderWeights } from '../../weightsPanel.js';
    +import { El } from '../kit/el.js';
    +import { ActivateStudioTab, HostElement } from './hostElement.js';
    +
    +const { tags, classes, toolPanes, start: StartName } = hosted;
    +const MISSING_TEXT = 'workspaceHosted.tools.missing';
    +const TOOL_BY_PANE = new Map(toolPanes.list.map((tool) => [tool.id, tool]));
    +const StartActions = Object.freeze({
    +    [StartName.renderSandbox]: () => RenderSandbox(),
    +    [StartName.renderWeights]: () => RenderWeights(),
    +    [StartName.renderArt]: () => RenderArtTab(),
    +    [StartName.openRules]: () => OpenGameRules(),
    +});
    +
    +/** The pane ids of every tool pane, in order. */
    +export function ToolPaneIds()
    +{
    +    return toolPanes.list.map((tool) => tool.id);
    +}
    +
    +/** True for a pane that hosts a Studio tool. */
    +export function IsToolPane(id)
    +{
    +    return TOOL_BY_PANE.has(id);
    +}
    +
    +function startTool(tool)
    +{
    +    if (tool.tab)
    +    {
    +        ActivateStudioTab(tool.tab);
    +    }
    +    StartActions[tool.start]?.();
    +}
    +
    +/** The pane id of the tool whose hidden Studio tab button this is, or null. */
    +export function ToolPaneOfTabButton(button)
    +{
    +    const tab = button?.dataset?.tab;
    +    const tool = toolPanes.list.find((candidate) => candidate.tab && candidate.tab === tab);
    +    return tool?.id ?? null;
    +}
    +
    +/** Fills a tool pane's body with its Studio element and starts it. */
    +export function DrawToolPane(body, id)
    +{
    +    const tool = TOOL_BY_PANE.get(id);
    +    if (!tool)
    +    {
    +        return;
    +    }
    +    const element = document.querySelector(tool.selector);
    +    if (!element)
    +    {
    +        body.append(El(tags.div, classes.empty, StudioText(MISSING_TEXT)));
    +        return;

    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_

    cehinds cehinds commented on code on Dec 04, 2026 22:24 UTC
    Code Review
    tools/score-studio/studio/workspace/hosted/revealPane.js:1
    @@ -0,0 +1,31 @@
    +// Shows a pane the person asked for: places it where it lives when it is closed, or opens its edge
    +// tab when its dock is folded.
    +import { OpenEdgeTab, MovePane } from '../panels/panelsActions.js';
    +import { HomeTarget } from '../panels/panelsModelMove.js';
    +import {
    +    DockZoneOf,
    +    HiddenZoneOf,
    +    PlacedPanel,
    +} from '../panels/panelsQueries.js';
    +import { GetPanels } from '../panels/panelsStore.js';
    +
    +function isFolded(panels, id, zone)
    +{
    +    return Boolean(HiddenZoneOf(panels, id) || (zone && panels.autoHide[zone]));
    +}
    +
    +/** Brings the pane into view. */
    +export function RevealPane(id)
    +{
    +    const panels = GetPanels();
    +    if (!PlacedPanel(panels, id))
    +    {
    +        MovePane(id, HomeTarget(panels, id));
    +        return;
    +    }
    +    const zone = DockZoneOf(panels, id);
    +    if (zone && isFolded(panels, id, zone))
    +    {
    +        OpenEdgeTab(zone, id);

    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_

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Dec 04, 2026 22:29 UTC
    Code Review
    tools/score-studio/studio/workspace/panels/panelsZones.js:1
    @@ -0,0 +1,95 @@
    +// The three docks (left, right, bottom): what each holds, whether it is open, folded to an edge
    +// strip, or both (some panes hidden on their own), and how big it is.
    +import render from '../config/panelsRender.json' with { type: 'json' };
    +import { BindZoneFlyout, TabStrip, ZoneFlyout } from './panelsEdge.js';
    +import { AppendNodes } from './panelsNode.js';
    +import { DockBar } from './panelsPins.js';
    +import { PanelsHooks, RunPanelsHook } from './panelsHooks.js';
    +import { DockPaneCount, WholeDockHidden } from './panelsQueries.js';
    +import { ZoneSizeCss } from './panelsSizing.js';
    +import { DOCK_ZONES, PaneConfig } from './panelsShared.js';
    +import {
    +    GetFlyout,
    +    GetPanels,
    +    GetZoneFit,
    +    IsFolded,
    +} from './panelsStore.js';
    +
    +const { classes, ids, cssVars } = render;
    +
    +function zoneHost(zone)
    +{
    +    return document.getElementById(`${ids.zonePrefix}${zone}`);
    +}
    +
    +function zoneState(panels, zone)
    +{
    +    const docked = panels.zones[zone].length;
    +    const alone = panels.paneHidden[zone].length;
    +    const hidden = Boolean((docked || alone) && WholeDockHidden(panels, zone));
    +    return {
    +        empty: !docked && !alone,
    +        hidden,
    +        mixed: !hidden && alone > 0,
    +    };
    +}
    +
    +function paintZoneClasses(host, zone, state)
    +{
    +    const open = (state.hidden || state.mixed) && GetFlyout().zone === zone;
    +    host.classList.toggle(classes.autoHidden, state.hidden);
    +    host.classList.toggle(classes.hasStrip, state.mixed);
    +    host.classList.toggle(classes.flyoutOpen, open);
    +}
    +
    +function drawOpenZone(host, panels, zone, state)
    +{
    +    host.replaceChildren();

    <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 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Dec 04, 2026 22:29 UTC
    Reviewer

    <!-- 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

  • 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".

    </details>

    cehinds cehinds commented on code on Dec 04, 2026 22:41 UTC
    Code Review
    tools/score-studio/studio/workspace/panels/panelsZones.js:1
    @@ -0,0 +1,95 @@
    +// The three docks (left, right, bottom): what each holds, whether it is open, folded to an edge
    +// strip, or both (some panes hidden on their own), and how big it is.
    +import render from '../config/panelsRender.json' with { type: 'json' };
    +import { BindZoneFlyout, TabStrip, ZoneFlyout } from './panelsEdge.js';
    +import { AppendNodes } from './panelsNode.js';
    +import { DockBar } from './panelsPins.js';
    +import { PanelsHooks, RunPanelsHook } from './panelsHooks.js';
    +import { DockPaneCount, WholeDockHidden } from './panelsQueries.js';
    +import { ZoneSizeCss } from './panelsSizing.js';
    +import { DOCK_ZONES, PaneConfig } from './panelsShared.js';
    +import {
    +    GetFlyout,
    +    GetPanels,
    +    GetZoneFit,
    +    IsFolded,
    +} from './panelsStore.js';
    +
    +const { classes, ids, cssVars } = render;
    +
    +function zoneHost(zone)
    +{
    +    return document.getElementById(`${ids.zonePrefix}${zone}`);
    +}
    +
    +function zoneState(panels, zone)
    +{
    +    const docked = panels.zones[zone].length;
    +    const alone = panels.paneHidden[zone].length;
    +    const hidden = Boolean((docked || alone) && WholeDockHidden(panels, zone));
    +    return {
    +        empty: !docked && !alone,
    +        hidden,
    +        mixed: !hidden && alone > 0,
    +    };
    +}
    +
    +function paintZoneClasses(host, zone, state)
    +{
    +    const open = (state.hidden || state.mixed) && GetFlyout().zone === zone;
    +    host.classList.toggle(classes.autoHidden, state.hidden);
    +    host.classList.toggle(classes.hasStrip, state.mixed);
    +    host.classList.toggle(classes.flyoutOpen, open);
    +}
    +
    +function drawOpenZone(host, panels, zone, state)
    +{
    +    host.replaceChildren();

    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_

    Reviewers
    Assignees
    cehinds cehinds
    Labels
    risk: medium confidence: 32.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 85.5% (HIGH) · Higher = larger blast radius
    85.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 32.2% · Lower = rushed or shallow review
    32.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 58% · Moderate risk
    58%