Skip to content

Shop room: arrange panel slides out inside the room and waits for Save room - #1057

Merged
keyxmakerx merged 1 commit into
mainfrom
claude/project-thread-haxwri
Oct 4, 2026
Merged

keyxmakerx merged 1 commit into
mainfrom
claude/project-thread-haxwri

Conversation

@keyxmakerx

@keyxmakerx keyxmakerx commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Fixes: none

Security implication: none. This is client-side widget UI only. The room is still saved through the existing room endpoint, and the buying code is untouched.
Consumer-verified: n/a
Mockup: Sign-offs card gen-family, "Shop" tab of https://claude.ai/artifact/Tbkq94PxdMmcYKUCnnpeiq. The operator approved the shop room as shown.

What this changes

Before:

  • The shop room's arrange tools sat in a plain block with a tick box and three generate buttons.
  • Every change saved straight away.
  • Clicking away dropped you back to the shop without asking.

After:

  • Arrange opens a panel that slides out inside the room, with a spring.
  • The room, goods and decorations each get a row with a keep pin and a reroll dice, and "Reroll the rest" rolls everything not pinned.
  • Changes wait for Save room. Saving shows a "Room saved" toast and returns to the shop.
  • Leaving with unsaved changes shakes the panel and shows "Not saved yet" with Discard. This covers clicking outside the room, Escape and the Shop tab. Discard puts the room back exactly as it was saved.
  • With nothing unsaved, clicking away closes the panel as before.

Why

Issue #1026 asks that the generators share one look and never lose unsaved work on a click-away. This uses the same pin, dice and "Not saved yet" pattern as the calendar wizard (#1042).

Load-bearing lines, all in static/js/widgets/shop_room.js:

  • save() now only marks the room as changed. saveRoom() does the PUT, and nothing else writes.
  • tryLeave() and discard() drive the guard. discard() restores the room from savedLayout through fromLayout and room.geometry().
  • onOutsideDown is a named document listener, removed in cleanup, so widget_listener_leaks stays green.

Honest deviations: none from the signed mockup. The Foundry module vendors this file, so its copy needs a refresh after merge. The "Shop room in Foundry" thread owns that.

Test plan

  • node --test test/js/*.test.mjs: 434 pass, 0 fail
  • Browser check (Playwright against a local build of this branch on current main):
    • A clean click outside closes the panel.
    • A roll sends no save.
    • A dirty click outside keeps the panel open and shows the warning.
    • Save room sends exactly one PUT and closes the panel.
    • The Shop tab when dirty keeps the panel open.
    • Discard closes the panel without saving.
  • CI passes (lint, tests, build)

Tenet self-check

  • T-B1 security: n/a (declared above)
  • T-B2 plugin isolation: one widget file, no new cross-plugin imports or Foundry literals
  • T-B3 production UI: slide-out and shake animations, a Saving… state, and on a failed save a "Couldn't save" line that keeps your changes. Reduced motion is respected and every icon button is labelled.
  • T-B4 docs: the widget's header comment describes the panel and the save guard

The Arrange panel now opens inside the room's scene with the generators'
shared look: Furniture, Goods and Decorations each have a keep pin and a
reroll dice, with "Reroll the rest" above them, replacing the tick box and
the three large generate buttons. Changes no longer save on every roll;
they wait for "Save room", and Cancel or Discard puts the room back as it
was last saved. Leaving Arrange with unsaved changes (the Shop tab, the
close button, Escape or a press outside the room) shakes the panel and
shows "Not saved yet" instead of closing.

Refs #1026

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WEm4RH9mQFdTmye7jYjkou
@keyxmakerx
keyxmakerx marked this pull request as ready for review October 4, 2026 00:19
@keyxmakerx
keyxmakerx merged commit 7f0ba55 into main Oct 4, 2026
10 checks passed
@keyxmakerx
keyxmakerx deleted the claude/project-thread-haxwri branch October 4, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants