Skip to content

VS Code: reflect Workspace union onto native chrome (tab title + view badge)#197

Merged
nedtwigg merged 1 commit into
mainfrom
workspaces-vscode-chrome
Jun 30, 2026
Merged

VS Code: reflect Workspace union onto native chrome (tab title + view badge)#197
nedtwigg merged 1 commit into
mainfrom
workspaces-vscode-chrome

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Surfaces each VS Code webview's Workspace union status (ring / TODO) onto native chrome, building on the merged stage-2b primitives (#190). Each hosting primitive uses the indicator it actually supports, following the in-app <title> <bell> [TODO] pattern.

What it does

  • Editor tab (WebviewPanel): panel.title gains a suffix — Dormouse · Dormouse 🔔 · Dormouse [TODO] · Dormouse 🔔 [TODO]. The bell is the emoji stand-in for the in-app bell icon (a tab title is plain text); [TODO] is the bracketed word. The mascot iconPath is unchanged.
  • Panel view (WebviewView): a presence badgeview.badge.value = 1 whenever anything owes attention, with the ring-vs-TODO detail in the tooltip. view.description stays the shell name.

Both confirmed on-device.

How

  • workspace-chrome.tsworkspaceTitle() / workspaceBadge() formatters.
  • message-router.tsattachRouter gains an onUnion callback (alongside the existing onSaveState); notifyUnion() projects the union over the router's ownedPtyIds via the shared computeWorkspaceUnion, firing on owned-PTY alert-state changes and on PTY claim/release.
  • extension.ts sets panel.title; webview-view-provider.ts sets view.badge.

Notable constraints (documented in vscode.md)

  • Terminal ring/TODO only. The union is scoped to ownedPtyIds (PTY-backed terminals); a browser surface's TODO stays webview-local until a future webview→host Surface-state channel exists.
  • Panel view can't use a title. On a single-view bottom-panel container VS Code shows the static container title (no runtime API), so the badge is the only runtime indicator there.
  • Badge clears with value: 0, not undefined — VS Code hides a 0-value badge but does not clear one set to undefined on a panel container (verified). Contained in workspaceBadge.
  • Always-on. The extension host has no localStorage to read the standalone workspaces flag, so this is unconditional in VS Code; whether to add a host-side gate (a VS Code setting) is a follow-up decision.

Verification

  • pnpm test green (dor-lib-common, dor, lib 729, standalone, website); pnpm build clean; vscode-ext esbuild bundle + targeted typecheck clean.
  • Specs updated (vscode.md, glossary.md, alert.md) to mark VS Code chrome reflection implemented.

🤖 Generated with Claude Code

…badge)

Surface each webview's Workspace union (computeWorkspaceUnion over the host
AlertManager, filtered to that router's ownedPtyIds) onto VS Code native chrome.
Each surface uses the indicator its primitive supports, matching the in-app
`<title> <bell> [TODO]` pattern:

- Editor tab (WebviewPanel): panel.title gains " 🔔" (ringing) and " [TODO]"
  (todo); mascot iconPath unchanged.
- Panel view (WebviewView): a presence badge — view.badge.value 1 when anything
  owes attention, 0 to clear. view.title can't be used (a single-view bottom-
  panel container shows the static container title, with no runtime API), and
  the badge must clear with value 0 — VS Code ignores `undefined` on a panel
  container. Both confirmed on-device.

- workspace-chrome.ts: workspaceTitle() + workspaceBadge() helpers.
- message-router: attachRouter gains onUnion; notifyUnion() projects the union
  over ownedPtyIds, firing on owned-PTY alert-state changes and on claim/release.
- extension.ts sets panel.title; webview-view-provider sets view.badge.
- specs (vscode/glossary/alert): mark VS Code chrome reflection implemented;
  terminal ring/TODO only (browser-surface TODO stays webview-local).

Always-on in VS Code (the host has no localStorage to read the workspaces flag);
host-side gating is a merge-time decision. Standalone window persistence
untouched.

Verified: esbuild clean; no new type errors; full test suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a29746
Status: ✅  Deploy successful!
Preview URL: https://2bab7ccf.mouseterm.pages.dev
Branch Preview URL: https://workspaces-vscode-chrome.mouseterm.pages.dev

View logs

@nedtwigg nedtwigg merged commit 1864f3e into main Jun 30, 2026
6 checks passed
@nedtwigg nedtwigg deleted the workspaces-vscode-chrome branch June 30, 2026 18:56
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.

2 participants