Skip to content

fix(themes): make the bedroom's click areas disjoint and show a covered room on the card - #18032

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/bedroom-click-areas-and-card
Nov 21, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/bedroom-click-areas-and-card

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Refs: #17509
Refs: #18020

The settings-card change is the owner's decision recorded at #18020 (comment).

Summary

Two bug fixes in the themes plugin's bedroom theme:

  • Click areas. The console, the tape's spine and the lava lamp had click rectangles that overlapped their neighbors, so one click flipped two switches.
  • Covered room on the card. When another plugin set its theme while the room was on, the settings card still said theme: on, and its theme button cleared that plugin's theme instead of bringing the room back.

Part of #17509 is delivered here:

  • HITS is disjoint.
  • The shader tables in lights.ts match it.
  • Two tests cover this: no two rectangles meet, and the shader's rows equal HITS.

The shader's source, which is outside this repository, is not changed, and lights.ts is not regenerated. See Remaining.

Fix

  • scene/lib.ts HITS and the shader's HIT/HIT2 tables in lights.ts now agree on narrower rectangles:

    • console width 46 -> 38 (ends at 1336);
    • spine 21 -> 20 (ends at 1357);
    • lava 42 -> 39 (ends at 1397).

    Both hit tests include the edges, and these edges no longer meet.

  • lights.ts was edited directly, on those two table lines only. No available build script reproduces the file on main, so it could not be regenerated faithfully.

  • A theme.set hook (register.tsx) records that the room is covered when another plugin sets a theme while the room is on. Like the existing theme.clear hook, it keys on next.origin.plugin. It never sets the room again by itself: the other plugin's theme stays until the person asks for the room.

  • In the covered state:

    • The card shows theme: covered, and its button runs /bedroom on. That sets the room's look again without calling theme.clear, which would remove every theme.
    • /bedroom on answers the room is back.
    • /bedroom status names the covering plugin.
    • Setting or clearing the room's look ends the covered state.

Verification

  • claude plugin test plugins/themes: 136 pass, 0 fail.
  • plugins/themes/tests/shader-hits.test.sh (Node): 1 pass. It parses the HIT and HIT2 lines of lights.ts and the HITS block of scene/lib.ts as text, and asserts that each switch's rectangle equals its shader row. The rows are tv, lava, pc, lamp, tape, console, light, with the spine in HIT2. Run against main's old lights.ts it fails (lava is HIT row 1), so a regeneration from the old source fails the suite.
  • The disjointness test failed on the old HITS, naming exactly the three overlaps in the issue (console and spine, light and lava, spine and lava), and passes now.
  • Boundary clicks at x 1336/1337, 1357/1358 and 1397/1398 each flip one switch.
  • The covered tests use a stand-in fireworks plugin:
    • The status line names the covering plugin.
    • /bedroom on sends one set and no clear.
    • The card label goes theme: on, then theme: covered, then back to theme: on, and a press while covered sends one set and no clear.
    • When the covering plugin clears its own theme, the room comes back and the open card says theme: on again; its button then clears.
  • claude plugin validate plugins/themes passes, with warnings. On the changed files, the only warnings are TS5097 (an import path ending in .ts or .tsx), the same kind other files in the plugin get.
  • Not checked by hand in the desktop app.

Remaining

  • The shader's switch table in its source outside this repository needs the same three widths (console 38, spine 20, lava 39). lights.ts must then be regenerated from it. Until then, a regeneration from the current source brings the overlap back, and shader-hits.test.sh fails on it.

Related

🤖 Generated with Claude Code

…ed room on the card

The console, tape spine and lava lamp click rectangles overlapped their
neighbors, so one click flipped two switches. Narrow them in HITS and in
the shader's HIT and HIT2 tables (console 46 -> 38, spine 21 -> 20,
lava 42 -> 39), and test that no two rectangles meet under the inclusive
edge rule both checks use.

While the room is on, another plugin's theme.set now marks the room as
covered. The settings card then says "theme: covered" and its theme
button sets the room again instead of clearing; /bedroom on does the
same, and /bedroom status names the covering plugin.

Closes #17509
Refs: #18020

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 21, 2026 20:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T20:02:54.545592Z 7c6e688 Draft marked ready
ℹ️ 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" 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c6e6884b5

ℹ️ 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".

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44944084128, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44944084128

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 7c6e6884b5a473feb1a0a5aef27cb98dfd7ad91d; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread plugins/themes/hooks/bedroom/lights.ts Resolved
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed a698b8161d0172598fa1a9919b83d2adc348e505: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #18032 at a698b8161

This review covers only what changed since 7c6e6884. I read all three files in scope, in full, in .claude-lane/incremental.diff: core/restore.test.ts, tests/shader-hits.test.mjs and tests/shader-hits.test.sh. This lane has already reviewed an earlier head, so this review reports blocking findings only.

This push fixes the earlier blocking finding (lights.ts lines 839-840, missing closing-issue criterion; now a settled thread):

  • The PR body now says Refs: #17509 and has a ## Remaining section for the shader-source edit and the regeneration. Merging no longer closes themes: make the bedroom's click areas disjoint in the shader source #17509, so the issue stays the record of the unfinished work.
  • tests/shader-hits.test.mjs now ties HIT/HIT2 to HITS. I checked its parsing against the files at head:
    • The HITS block regex matches the declaration at scene/lib.ts:100 (the type annotation has no =) and ends at the first \n}.
    • Each row line matches ^ {2}(\w+): (\[[\d, ]+\]),$.
    • The table( prefix and the trailing ) slice parse lights.ts:839-840 as JSON.
    • Every SHADER_ROWS mapping holds at head: tv=HIT0, lava=HIT1, pc=HIT2, lamp=HIT3, tape=HIT4, console=HIT5, light=HIT6, spine=HIT2[4].
    • Excluding cat from the key comparison is correct.
    • So a regeneration from the unchanged shader source (lava 42, console 46, spine 21) would fail the test.
  • The .test.sh wrapper matches the pattern other plugins use (for example plugins/user-interface/tests/*.test.sh).

New restore.test.ts case (line 87). The case runs covered → another mod's clear → theme: on, then a press that sends exactly ['clear']. This matches the existing helpers (fireworks, startRoom, room.themes) and the earlier theme.clear → set bedroom path at lines 49-58. It also backs the owner's answer on the settled register.tsx:78 thread.

Not verified here. The author says the new test fails against the old lights.ts ("lava is HIT row 1") and that the suite passes. This lane has no shell, so I ran neither.

No findings. Spend: none beyond normal CI.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed a698b8161d0172598fa1a9919b83d2adc348e505: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): no security issues found

This review covers only the changes since 7c6e6884b. I read all 3 changed files in full. None of them is on a trusted path. This lane already reviewed an earlier head, so this review was blocking only: it reports only CRITICAL and IMPORTANT findings.

What I checked:

  • plugins/themes/hooks/bedroom/core/restore.test.ts adds one test case. It uses the existing stand-in fireworks plugin to check the card label and the theme sent after the covering mod clears its theme. It is test code only and reaches no security boundary.
  • plugins/themes/tests/shader-hits.test.mjs is a new Node test:
    • It reads two fixed files in the repository, scene/lib.ts and lights.ts, resolved relative to its own location.
    • It takes the rectangle tables from them with regexes and runs JSON.parse on what they match. It makes no eval, runs no subprocess, makes no network call and writes no file.
  • plugins/themes/tests/shader-hits.test.sh is a new wrapper:
    • It quotes SCRIPT_DIR, which comes from BASH_SOURCE.
    • It skips when node is not installed.
    • It then runs exec node --test on the sibling test file. No input from outside reaches it.

Other checks:

  • No .claude-plugin/plugin.json or marketplace.json changed, so there are no manifest lines.
  • No workflow, trust control or merge hold changed.
  • No standing instruction was deleted or weakened.
  • The PR description contains no embedded instructions aimed at the review lane.

Spend: none.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 7c6e6884b5a473feb1a0a5aef27cb98dfd7ad91d. What it wrote, as data:

What it wrote (25 lines)
Summary: PR #18032 closes #17509 but does not deliver its first done-when item. That item asks for
  the click tables in the GLSL source to be made disjoint and for `lights.ts` to be regenerated from
  that source. Instead, the diff edits the `HIT`/`HIT2` lines of the generated `lights.ts` by hand.
  The PR body itself says the GLSL source was not changed and that the next regeneration will bring
  the overlap back. The issue rules this out explicitly ('its tables cannot be edited here without
  the next regeneration undoing it'). The refinement suggested leaving that step to a person, but
  the spec lists no `person_checks` and no credited siblings, so nothing excuses the item. The rest
  checks out. The second item is met: `register.test.tsx` now asserts that no two `HITS` rectangles
  meet, edges included, and it adds boundary-click tests. The new widths (console 38, spine 20, lava
  39) are the same in `HITS` and in the hand-edited shader tables, and they are disjoint. The diff
  also adds unrequested work (it refs #18020): a `theme: covered` card state, a `theme.set` hook,
  and changes to `/bedroom on` and `/bedroom status`. I found no correctness or safety problem in
  that code: the covered state ends whenever the room's look is set or cleared, and pressing the
  button while covered calls set rather than clear. It is outside #17509's scope, though, and a
  human should look at it. CI: Test Node and Check Tests were skipped. Check Plugins
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/44944038262/job/136967521272)
  and the Test Bash jobs passed, but no job is shown to have run the themes plugin's test suite. I
  saw no text trying to steer the reviewer.
- plugins/themes/hooks/bedroom/lights.ts:839 is a generated file and was edited by hand; #17509
  requires the click tables in the GLSL source to be made disjoint (console 38, spine 20, lava 39)
  and lights.ts to be regenerated from it. Make that change in the source and regenerate, or stop
  claiming the whole issue (see the PR body note).
- PR body: `Closes #17509` claims the whole issue, but the GLSL-source edit and the regeneration are
  not delivered. Either deliver them, or change the line to `Refs: #17509` and say which part this
  PR delivers (the HITS change and the disjointness test).

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
A Node suite reads lights.ts and scene/lib.ts as text and asserts each
switch's HITS rectangle equals its HIT or HIT2 row, so a regeneration
from a source with other rectangles fails. The mod test kit cannot read
files or import the shader module, so the check lives beside the
plugin's other shell-discovered suites.

A card test covers a covering plugin that clears its own theme: the room
comes back and the open card says "theme: on" again, with a button that
clears.

Refs: #17509

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 21, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit f7f2062 Nov 21, 2026
70 checks passed
@kyle-sexton
kyle-sexton deleted the fix/bedroom-click-areas-and-card branch November 21, 2026 20:51
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant