Skip to content

Build the drawer UI from the prototype - #12

Merged
XDGFX merged 1 commit into
mainfrom
worktree-5-ui
Oct 2, 2026
Merged

XDGFX merged 1 commit into
mainfrom
worktree-5-ui

Conversation

@XDGFX

@XDGFX XDGFX commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Closes #5

Rebuilds Hailey's docs/prototypes/drawer-tool-ui/ prototype (through round 4.2) as the real app.

What's in it

  • One plan, showing only the selection. With nothing selected, the side panel shows the drawer: the base, the rules, what needs attention, and the agent's concerns and questions. With one thing selected it shows how it sits, what holds it (method picker with wireframes), the lock, and why it's there. With several, it offers to hold them together, with an align, distribute and close-gaps toolbar over the plan.
  • Direct manipulation edits the file.
    • Drag, turn by the knob, use the arrow keys, or press R.
    • Drag onto the counter to set aside.
    • Moves snap so holders touch, edges line up, and things centre in a space.
    • Gridfinity centres things in whole cells; on a pegboard, things hop between peg seats.
    • Every change is a minimal text edit: comments and layout survive, so diffs stay small (src/core/source.ts).
    • Undo and redo work.
  • Folders.
    • Opening a folder uses the File System Access API, and edits are written straight back.
    • The app notices when the file changes on disk, for example when an agent edits it.
    • The last folder can be reopened.
    • Without the API, files open and save by downloading, with a warning before unsaved edits are lost.
    • The coffee drawer works as a demo.
  • Inventory. Add a thing (it lands on the counter), set the ways an item can sit, and remove a thing.
  • 3D preview of the holders dunnage works out, loaded only when opened.
  • The file, with the selection highlighted and problems marked by line, editable as text.

Core

The prototype's logic lives in src/core, with no DOM, so the CLI and agents can use it:

Module What it does
plan Holder shapes, gap closing, peg form closure, and issues
snap Snapping moves
actions Domain edits as text, on top of source
spec Spec sheets for custom holders

read() returns a drawer even when it has layout problems, so the UI can show those problems instead of refusing the file.

This is a feature, so the version goes from 0.2.0 to 0.3.0.

Left for other tickets

Checks

  • bun run typecheck, bun run test (116 tests, with new suites for source, plan, snap and actions), bun run build and bun run validate all pass.
  • I drove the app in headless Chromium. Everything below worked with no console errors:
    • the demo
    • selecting one thing, then several
    • dragging and setting aside
    • switching to a pegboard and to Gridfinity, and holding things with IKEA pegs
    • adding a thing
    • the file view
    • downloading
    • the 3D view
    • a phone-width layout
  • The downloaded file passed dunnage check. The only problems it reported came from the base switches the test made, as expected.
  • Saving back to a real folder (File System Access) needs a person in Chrome: the folder picker can't be scripted.

🤖 Generated with Claude Code

The plan is the interface: drag, turn and set things aside, choose how each is held, lock what's
built, and every change edits the drawer file in place, leaving its comments and layout alone.
Folders open with the File System Access API; without it, files open and save by downloading.
A 3D view previews the holders dunnage works out.

The core now works out holders from their methods and the base (plan), snaps moves (snap), and
makes the edits as text (actions on top of source), so an agent can make the same edits.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@XDGFX
XDGFX merged commit 344b560 into main Oct 2, 2026
3 checks passed
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.

Build the UI from the drawer tool prototype

1 participant