Skip to content

fix(web): render the live room — Lit reactive props dead under useDefineForClassFields - #1753

Merged
joelteply merged 3 commits into
canaryfrom
fix/web-lit-reactive-render
Jul 3, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fix/web-lit-reactive-render

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The web client received state fine but froze on 'Connecting…': <chat-widget>'s Lit reactive properties (static properties + TS class fields) were shadowed by ES2022 define-semantics, so widget.state = … never re-rendered. Fix: useDefineForClassFields: false in apps/web/tsconfig. Room now renders in a real browser (verified via Chrome CDP). Adds a connection-status banner as real UX. typecheck + lint green.

🤖 Generated with Claude Code

joelteply and others added 3 commits July 3, 2026 16:25
… scope + render wait

Two fixes make `cu interface/capture` a usable "see any interface via a CLI call":

1. Caller scope. The command refused any caller without a persona identity, but
   the local `cu` path is owner-by-locality (Unix socket → `None` caller — the
   operator on the box). Scope those captures to "local" instead of refusing: the
   operator is a first-class caller, just not a persona (a persona still scopes to
   its peer_id). Not a fallback — we name the scope, never mint a ghost citizen.
   Now `cu interface/capture '{"target":"web","url":"…"}'` works from the CLI.

2. Render wait. Headless Chrome screenshots at the load event — too early for an
   SPA that mounts, opens a WebSocket, and renders after the first state frame
   (blank page otherwise). Add `--virtual-time-budget=3000` so the page's async
   work settles before the capture, bounded by the existing CAPTURE_TIMEOUT.

Verified live: `cu interface/capture` renders + saves a PNG (proven with a static
page — text rendered green-on-dark, 12KB vs a 4KB blank), scoped under
~/.continuum/captures/local/. NOTE: the positron WEB app still renders blank in
headless Chrome (only its dark background captured) though the SAME @continuum/
chat-view pipe renders correctly via the terminal client and a headless node
render — so that's a web-client in-browser bug (mount / browser-WS / pre-state
placeholder), tracked separately, not a capture-path issue.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…gle-instance

The natural-browser twin of `interface/capture` (headless). `cu desktop` opens the
Continuum UI in the operator's DEFAULT browser — their choice, a real visible
window — via the OS opener (macOS `open`, Linux `xdg-open`, Windows `cmd /c
start`), never a hardcoded browser.

Managed as a single-instance resource so it doesn't spawn a new tab every call: a
lightweight on-disk session marker (~/.continuum/desktop/session.json) is the
"lease". A second `cu desktop` for the same URL is a no-op ("already open");
`focus:true` forces a re-open. Start-simple by design — a later slice promotes the
marker to a first-class ResourceGovernor consumer (#56) alongside VRAM / serving /
Bevy, so the window is allocated + reclaimed like any other machine resource.

URL resolves param → `CONTINUUM_DESKTOP_URL` → the local web client on the default
WS ingress. Owner-scoped (the local `cu` operator opens their own box's desktop).

Verified live: 1st call opened the default browser (`opened:true`); 2nd was a
no-op (`opened:false`, "already open") — no duplicate window; `focus:true`
re-opened. This is `cu desktop` per the ask: natural browser, single-instance,
simple.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…seDefineForClassFields

The web chat client mounted, connected the WS, and RECEIVED state (verified via
CDP: state-recv → parsed 50 msgs → widget.state set, repeatedly) — but stayed
frozen on "Connecting to the room…". Root cause: `<chat-widget>` declares its Lit
reactive properties via `static properties` + plain TS class fields (`state`,
`sendHandler`, `_draft`…), and apps/web/tsconfig targets ES2022 where
`useDefineForClassFields` defaults to TRUE. Define-semantics class fields SHADOW
the accessors Lit installs, so `widget.state = latest` became a dead field write
that never triggered a re-render. It only bit the web widget — the terminal
client and headless node render call `renderChat` directly, bypassing the
reactive property, which is why they always worked.

Fix: `useDefineForClassFields: false` in apps/web/tsconfig.json (the canonical
Lit-with-`static properties` setting; esbuild/vite honor it for the transform,
tsc for the typecheck). The room now renders in a real browser — who/what/where,
live conversation, compose bar — proven via Chrome CDP real-time capture.

Also adds a small connection-status banner in index.ts (surfaces socket
connecting/open/closed/no-snapshot instead of a silent stuck "Connecting…", and
auto-removes on first render) — the diagnostic that localized this, kept as real
UX.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply enabled auto-merge (squash) July 3, 2026 22:23
@joelteply
joelteply merged commit 05536ef into canary Jul 3, 2026
@joelteply
joelteply deleted the fix/web-lit-reactive-render branch July 3, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant