Skip to content

web: dock editor (mock-only) — grid docking per interaction concept v1 - #466

Open
bennotk wants to merge 5 commits into
mainfrom
claude/issue-464-dock-editor
Open

web: dock editor (mock-only) — grid docking per interaction concept v1#466
bennotk wants to merge 5 commits into
mainfrom
claude/issue-464-dock-editor

Conversation

@bennotk

@bennotk bennotk commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Rebuilt on top of the initial shell: the editor now implements the interaction concept v1 core loop (P0 plus multi rows, pulled forward on request) instead of SVG wires and click-to-connect.

  • No drawn wires: connections arise from adjacency — an out tenon and an in notch in neighboring columns within ±1 row dock automatically; the only line segments are the 16 px ±1 bows in the gutter (GRID-02/03). Typed pins with shape as the primary code (▶ event · ■ switch · ● value · ◉ color), joints for defined type conversions with a provisional joint matrix (the authoritative one from the system concept §5.3 is not in the repo yet), chips with editable defaults on free inputs (PIN-01…03)
  • Multi rows (MULTI-01/02): repeatable connectors marked in the registry grow extra rows via the settings sheet — repeatable inputs collect several sources (merge-rule chip: max/sum/mean/last on value inputs), repeatable outputs are the fan-out mechanism; row capacity is enforced in candidate search and validation
  • One pointer-event code path (DOCK-01…08): 8 px drag threshold, per-frame candidate search with a pulsing best candidate, snap docking with haptics, red reject state for incompatible exact-row pairings, pull-away disconnect, trash zone replacing the palette while dragging, board panning on empty surface
  • Stacked layout for mobile (VIEW-02/03, RESP-02): collapsible bottom palette with category chips — nothing sits beside the board; the board is full-width (~2¼ columns visible on a 390 px phone), settings open as a bottom sheet under 768 px and as a side panel above; one-time swipe hint; prefers-reduced-motion respected
  • State: snapshot-based undo/redo (50 steps — deliberate deviation from UNDO-01's command pattern, behaviorally equivalent), debounced localStorage draft, Apply validates (VAL-02) and PUTs
  • The pure grid model — registry, geometry, candidate search (DOCK-03), edge settling, document validation — lives in server/graphs-core.js, shared by the editor page, the mock's PUT validation, and 15 dedicated unit tests; seeds are adjacency-consistent and include a multi-row input and a joint
  • Still mock-only (server/, not data/): nothing ships to devices while LittleFS is nearly full (Enlarge the littlefs partition — index.html is close to filling it #377); moves into the device UI with M8

Deviations noted for the audit: PIN-05 hit areas are 44 px wide but row-height (28 px) tall — a full 44 px square would steal taps from the neighbor row; docked counterpart pins overlap in the gutter and both resolve to the same connection popover. MULTI-01's drag-triggered ghost row is not built yet (rows grow via the sheet). Rails, stretch layout, sections, chain view, zoom, and keyboard movement are P1/P2 follow-ups.

Closes #464

Test plan

  • npm run lint and npm test (57/57: 42 mock + 15 grid-model unit tests) pass
  • /validate-ui desktop: seeded graph renders (stones, ±1 bow, multi-row trigger, note), palette drag + adjacency dock, pin popover + disconnect, undo/redo, multi-row grow via sheet, move keeps the dock as a ±1 bow, Apply + reload persistence, trash-zone delete
  • /validate-ui mobile (390×844, touch): board full-width with the palette stacked below, tap-place + dock, bottom sheet
  • In the browser (npm run dev/graphs.html, or the PR preview once CI runs again): play through your flows — palette gaps, port shapes, joint matrix, dock feel — and file follow-up issues for whatever doesn't work

🤖 Generated with Claude Code

https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh

@bennotk bennotk added the enhancement New feature or request label Jul 24, 2026 — with Claude

bennotk commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Same infrastructure-level CI failure as documented on #462: all jobs fail in seconds with no runner assigned and no logs — nothing to fix in this branch (lint, 42/42 tests, and the Playwright flow are green locally). Until Actions runs again, the editor is reachable locally via npm run dev/graphs.html. I'll re-run the workflows on my next check-in.


Generated by Claude Code

@bennotk bennotk changed the title web: dock-editor shell (mock-only) for graph building blocks web: dock editor (mock-only) — grid docking per interaction concept v1 Jul 24, 2026
claude added 2 commits July 25, 2026 10:07
Editor page at /graphs.html (served from server/, deliberately not
data/ — it must not ship to devices while LittleFS is nearly full,
see #377): column/row board, palette with the M2 parity node set,
place/move/select, port-to-port edges with SVG rendering, notes, thin
cfg panels, save/load of schema-v1 documents. Mock gains in-memory
GET/PUT/DELETE /api/graphs with two seeded example graphs and
structural stub validation; authoritative validation and execution
arrive with the M2 engine.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh
Replaces the SVG-wire shell with the concept's core loop (P0 + multi
rows): design tokens, stones on a fixed grid with typed pins (shape =
type), no drawn wires — connections arise from adjacency (neighboring
columns, row distance <= 1, the only line segments are the 16px +-1
bows), joints for defined type conversions, chips with editable
defaults on free inputs, repeatable connectors that grow extra rows
(multi-row inputs with a merge-rule chip, repeatable outputs as the
fan-out mechanism). One pointer-event code path drives stone dragging
with per-frame candidate search, snap docking, trash-zone delete, and
board panning; the palette is a collapsible bottom bar so the layout
stacks vertically on phones. Snapshot undo (50 steps), localStorage
draft with debounce, Apply validates and PUTs. The pure grid model
(registry, candidate search, edge settling, validation) lives in
graphs-core.js, shared by the page, the mock's PUT validation, and
node:test unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh
@bennotk
bennotk force-pushed the claude/issue-464-dock-editor branch from 61ef322 to 83bff40 Compare July 25, 2026 10:08
@github-actions

Copy link
Copy Markdown

Preview

URL: https://batterylight-pr-466.blackpond-ef672c92.germanywestcentral.azurecontainerapps.io

Hosted on Azure Container Apps — accessible from the internet.

bennotk commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

CI is green after rebasing onto the renamed project's main — eslint, tests (57/57), clang-format, gitleaks, and the web build all pass. The editor page title now says LightWitch too.

Ready to play through: npm run dev/graphs.html.


Generated by Claude Code

claude added 3 commits July 25, 2026 11:39
Drops the stone/pin/edge/bow wording that had leaked in from the German
interaction concept and settles a single set of words used identically
in schema keys, code, docs and UI — there is no translation layer, so a
second user-facing vocabulary would only be overhead:

  stone -> node    (graph and node are a matched pair; block would
                    collide with CSS display:block, 41x in these files)
  pin   -> port    (pin means GPIO pin everywhere else in this project)
  edge  -> link    (nothing is drawn, and connection means a network
                    connection everywhere else)
  bow   -> arc

The schema key edges becomes links; nothing ships that format yet, so
this is free now and expensive after M2. Requirement ids PIN-xx become
PORT-xx. The editor gains a one-line hint that flow runs left to right,
with inputs on a node's left edge and outputs on its right. The
vocabulary now has a single definition site: a table at the top of the
rework plan, where the terminology rule already lived.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh
joint described the thing by its shape, not its job; adapter says what it
does — convert between two signal types. Also records the two design
decisions taken while building the shell, so they are not re-litigated:
fan-out runs through instance rows (visible in a node's height), and the
current four-entry adapter matrix is an explicitly provisional working
set until system concept 5.3 lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh
npm run dev does not skip auth when the env vars are absent — it treats
that as misconfigured and redirects every request to the login, so the
documented flow left the mock server unusable. Point at dev:no-auth and
note where the graph editor is served.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCqsYkCrhRHLoWZFuDTWjh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: dock editor shell (mock-only) — position graph building blocks in the browser

2 participants