From f13507f78911657598f07374b2fe58d60bb2e347 Mon Sep 17 00:00:00 2001 From: seal Date: Tue, 18 Aug 2026 22:52:36 -0400 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20explicit-dep=20highlight=20effe?= =?UTF-8?q?ct=20+=20Tauri=E2=86=92Wails=20prose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S1 (RIG-2199): convert the MarkdownText highlight-debounce effect to createEffect(on([code, lang, () => props.inline], apply)), mirroring the MessageStream on(deps, apply) shape. Tracks all three implicit reactive reads explicitly so the v1-safe prep is 1:1 with Solid 2's split effects; inline is included defensively (structural per instance) so the guard can never read a stale value. Debounce/onCleanup semantics unchanged. S3 (RIG-2201): replace the stale "Tauri" comments with Wails at the six real prose sites (App.tsx, stub-data.ts, live/client.ts, live/connection.ts, markdown/highlighter.ts); the runtime binding is @wailsio/runtime. Fixture strings and the deliberate daemon-transport.test.ts note left unchanged. Refs RIG-2199, RIG-2201 Co-authored-by: Matt Wilkinson --- apps/ui/src/App.tsx | 2 +- apps/ui/src/components/MarkdownText.tsx | 21 +++++++++++++++------ apps/ui/src/live/client.ts | 2 +- apps/ui/src/live/connection.ts | 2 +- apps/ui/src/markdown/highlighter.ts | 2 +- apps/ui/src/stub-data.ts | 4 ++-- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/apps/ui/src/App.tsx b/apps/ui/src/App.tsx index cc6bee4d..56e23046 100644 --- a/apps/ui/src/App.tsx +++ b/apps/ui/src/App.tsx @@ -20,7 +20,7 @@ import { useStore } from "./context"; // // This is the dev walking-skeleton made fully explorable: every surface reads // the in-memory stub (stub-data.ts) through one store (store.ts), so it renders -// and is clickable in `vite dev` with no daemon and no Tauri IPC. When the +// and is clickable in `vite dev` with no daemon and no Wails IPC. When the // daemon grows the real board / agent / ACP / audit streams, the store's // accessors swap the fixture for the generated @compass/client and the // components stay as-is. diff --git a/apps/ui/src/components/MarkdownText.tsx b/apps/ui/src/components/MarkdownText.tsx index cb63dbbb..fa01b076 100644 --- a/apps/ui/src/components/MarkdownText.tsx +++ b/apps/ui/src/components/MarkdownText.tsx @@ -12,6 +12,7 @@ import { createResource, createSignal, For, + on, onCleanup, Show, } from "solid-js"; @@ -332,12 +333,20 @@ function CodeBlock(props: { const [settled, setSettled] = createSignal( null, ); - createEffect(() => { - if (props.inline) return; - const next = [code(), lang()] as const; - const t = setTimeout(() => setSettled(next), HIGHLIGHT_DEBOUNCE_MS); - onCleanup(() => clearTimeout(t)); - }); + // Static-dep effect: track code/lang (and inline defensively — see below) via + // `on`, keeping the debounce apply UNTRACKED so the setTimeout/onCleanup cycle + // only re-runs when a tracked source changes. `inline` is a structural prop + // (the code override sets it once per node instance and never mutates it), but + // it is included in the deps rather than asserted invariant so the guard can + // never read a stale value if that ever changes. + createEffect( + on([code, lang, () => props.inline], ([nextCode, nextLang, inline]) => { + if (inline) return; + const next = [nextCode, nextLang] as const; + const t = setTimeout(() => setSettled(next), HIGHLIGHT_DEBOUNCE_MS); + onCleanup(() => clearTimeout(t)); + }), + ); const [html] = createResource( () => (props.inline ? null : settled()), async (src) => { diff --git a/apps/ui/src/live/client.ts b/apps/ui/src/live/client.ts index 07904258..f9fef81d 100644 --- a/apps/ui/src/live/client.ts +++ b/apps/ui/src/live/client.ts @@ -1,7 +1,7 @@ // Live client construction: a resolved Connection → the typed compass.v1 clients // the store dials. The one place transport is chosen (compass-tauri-shell.md: // 110-124) — the browser MVP builds gRPC-Web clients over the T3b network door -// through the shipped @compass/client factories; a hosted/Tauri transport is a +// through the shipped @compass/client factories; a hosted/Wails transport is a // sibling built here later without touching a caller above this seam. // // Two clients from one connection: the CommsClient (the channel surface — the diff --git a/apps/ui/src/live/connection.ts b/apps/ui/src/live/connection.ts index 39bffcad..4e877e5e 100644 --- a/apps/ui/src/live/connection.ts +++ b/apps/ui/src/live/connection.ts @@ -8,7 +8,7 @@ // Transport is chosen at client construction (compass-tauri-shell.md:110-124): // the browser MVP dials the T3b authenticated network door over gRPC-Web with a // bearer token (the T3-door account token → `authorization: Bearer`). The -// hosted/handshake modes (GetServerInfo, a Tauri custom-fetch to a UDS) are +// hosted/handshake modes (GetServerInfo, a Wails custom-fetch to a UDS) are // sibling transports layered at this same seam later — this module is the one // place the baseUrl+token are resolved, so adding a mode never leaks a // local-assumption above the transport boundary. diff --git a/apps/ui/src/markdown/highlighter.ts b/apps/ui/src/markdown/highlighter.ts index ead911ea..dc92448b 100644 --- a/apps/ui/src/markdown/highlighter.ts +++ b/apps/ui/src/markdown/highlighter.ts @@ -2,7 +2,7 @@ import type { HighlighterCore } from "shiki/core"; // Shiki code highlighting with a fine-grained bundle. // -// The Compass UI ships inside the Tauri shell, so Shiki's pre-composed bundles +// The Compass UI ships inside the Wails shell, so Shiki's pre-composed bundles // (full: 1.2 MB gzip; web: 695 KB) are disqualifying. Instead: `shiki/core` // (~12 KB) + the JavaScript regex engine (no WASM asset to ship or load in the // webview) + ONLY the grammars/themes this UI actually shows, imported as diff --git a/apps/ui/src/stub-data.ts b/apps/ui/src/stub-data.ts index 2c4b7ef2..128271e5 100644 --- a/apps/ui/src/stub-data.ts +++ b/apps/ui/src/stub-data.ts @@ -1,11 +1,11 @@ // Dev-only stub data for the Compass ADE UI. // // Compass is an Agentic Development Environment: a persistent daemon (compassd) -// with a Tauri shell rendering this web UI, meeting at the compass.v1 gRPC +// with a Wails shell rendering this web UI, meeting at the compass.v1 gRPC // contract (docs/specs/product/compass.md). The real board / agent / ACP / // audit event payloads are not built yet — the daemon today reports liveness and // a daemon-status stream — so this module hand-fakes a representative fleet so -// the full interface is explorable in `vite dev` with no daemon and no Tauri IPC. +// the full interface is explorable in `vite dev` with no daemon and no Wails IPC. // // Everything here is a plain in-memory fixture. When the daemon grows the board, // agent-runtime (ACP over compass.v1, design record compass-0.4), and audit