Skip to content

feat: dgbuild new-skein / open-skein — interactive Skein UI without VS Code - #15

Merged
hlship merged 1 commit into
mainfrom
hlship/260901-dgbuild-interactive-skein
Sep 2, 2026
Merged

feat: dgbuild new-skein / open-skein — interactive Skein UI without VS Code#15
hlship merged 1 commit into
mainfrom
hlship/260901-dgbuild-interactive-skein

Conversation

@hlship

@hlship hlship commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What

Two new dgbuild commands that run the full interactive Skein UI — transcript, nav graph, trace panel, keyboard shortcuts — from a plain browser, with no VS Code:

  • dgbuild new-skein [name] — create a skein (default default), refuse to overwrite an existing one
  • dgbuild open-skein [name] — open an existing one, refuse a missing/non-dgdebug skein, replay every branch on load (same as the extension)

Both stand up the existing SkeinService on localhost, print the URL, open a browser (--no-open to skip), and block until the in-UI Quit button or Ctrl+C. Options: --seed (new only), --port, --theme <light|dark>, -p/--project, -v/--verbose. dgdebug only for now.

How

SkeinService already serves every interactive route — this reuses it wholesale via a headless host (src/cli/commands/skein-server.ts), the counterpart of extension.ts's wiring. No logic duplicated.

  • ServiceConfig gains standalone + onQuit; both threaded through SessionDisplayInfo so the extension's rendered output is byte-identical (everything is gated off when standalone is unset)
  • Dirty tracking: reference-identity check against the tree at last save (SkeinTree is immutable-persistent) — O(1), all in service.ts
  • Quit / orderly shutdown: POST /actions/quit → if dirty, broadcast sk.showQuitModal() (Save and Quit / Quit Without Saving / Cancel); otherwise broadcast a "you may close this window" screen to the transcript and any open /trace tab, then fire onQuit. Ctrl+C also tears down cleanly (warns, can't save). beforeunload guards an accidental tab close.
  • Trace opens in a second browser tab (named window, reused/refocused). window.open runs in the Trace button's own data-on:click — the menu popover's data-on:click__stop swallows the event before a document listener would see it. Row click-to-open-source is a no-op here (no editor); hover preview still works.
  • Fix (pre-existing bug): trace-tree indentation compounded quadratically — renderRow scaled margin-left by dgdebug's raw stack depth on an element that's already nested in its parent's. Now one fixed CSS step per level on .trace-children.

Tests

  • new-skein.spec.ts / open-skein.spec.ts — option parsing + create/open guards
  • skein-server-integration.spec.ts — real dgdebug: standalone page, send-command → dirty → showQuitModal, save → clean → showShutdownScreen, open replays clean, self-skips without the toolchain
  • extended render.spec.ts / traceRender.spec.ts / knot-menu.spec.ts
  • Full suite: 973 passing, tsc clean

Verified end-to-end against sanddancer-dialog (554-knot skein) in Chrome

open-skein loads clean, navbar shows the Quit button, Trace opens/refocuses one /trace tab that live-updates, the indentation fix renders a tight staircase, Ctrl+C shuts down with no orphan dgdebug.

🤖 Generated with Claude Code

Run the full Skein UI - transcript, nav graph, trace - from a browser
with no VS Code. Both commands stand up the existing SkeinService on
localhost, open a browser, and block until the in-UI Quit button or
Ctrl+C. Quit prompts to save when the skein has unsaved changes, then
tears the server and dgdebug down cleanly.

- ServiceConfig gains standalone + onQuit; SessionDisplayInfo carries
  standalone/dirty so the extension's output is unchanged
- POST /actions/quit with the save/force/confirm-modal flow
- reference-identity dirty tracking in SkeinService
- Trace opens in a second browser tab (window.open from the button's own
  handler, since the menu popover stops event propagation)
- fix compounding trace-tree indentation: one fixed CSS step per level
  on .trace-children instead of a per-node margin scaled by dgdebug's
  raw stack depth

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTppFtoRZ3ZmWYF14xDiXX
@hlship
hlship merged commit ffe78a8 into main Sep 2, 2026
1 check passed
@hlship hlship self-assigned this Sep 2, 2026
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.

1 participant