Skip to content

feat(buddy): visual welcome and Settings, formatted answers, Enter to send; Help as a ? icon - #4

Merged
codemug merged 7 commits into
mainfrom
feat/buddy-visual-help
Nov 23, 2026
Merged

codemug merged 7 commits into
mainfrom
feat/buddy-visual-help

Conversation

@codemug

@codemug codemug commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Buddy gets a visual welcome and Settings, help text in hover pop-ups, formatted answers, and a fix for small models stuck repeating a search. The desktop's Help becomes a "?" icon, and the duplicate About WebPC app is gone. The catalog now requires every packaged app to build to wasm.

What changes

Buddy: less text, more visual

  • The welcome paragraph is replaced by a strip of the apps Buddy can work in (cloned from the desktop's own icons, tiles included) and three one-line starters.
  • Settings is eight cards: an icon, a title, the controls and short chips. Each section's sentences move into a help dot; warnings keep visible badges ("Key in memory only", "Sends to api.anthropic.com", "Sends URLs to Jina", "This session only").
  • Help pop-ups (help.js) open on hover after 300 ms, on keyboard focus, and on a tap of a help dot; they close on Esc, an outside press, blur and scrolling, and when their own control is pressed, so they never cover a menu. Inside the modal Settings dialog they mount in the dialog, which sits in the browser's top layer.
  • Import sits next to Export in the header (it was "Open backup..." at the bottom of Settings). Below a 440 px panel, New chat, Export and Import become icons, so the header fits a 390 px phone.
  • The model picker's help says which models suit app work: LFM3 for working in apps; Qwen for chat and images.

Buddy: answers

  • Answers render Markdown through a syntax tree into DOM nodes, never HTML strings: an allow-list of elements, links only for http, https and mailto, no images (an image URL would leave the device), raw HTML as text.
  • Local answers could stop at 384 tokens with no notice. The limit is 1024, and an answer that still hits it gets a "Cut short" chip (local and cloud models).
  • Enter sends; Shift + Enter adds a line; Ctrl or Cmd + Enter still sends; nothing is sent while an input method is composing.
  • A repeated search or lookup in one turn now returns the next step to take (for example read_skill path=...) instead of "Repeated tool call stopped", which left Qwen3.5 2B looping.

Desktop

  • Help is a "?" icon in the top bar. The About WebPC app, which opened the same window, is removed from the catalog, the desktop, the Apps list and search. A saved layout that still lists it loads cleanly.

Fixes found while testing (each was already failing on main and on v0.1.0):

Catalog: packaged apps build to wasm

  • A new wasm.build field in catalog.yaml records the command that builds an app's wasm from its source repository at the pinned version. Every packaged app (kind: iframe) must have one; the validator names the app and says what to add. WebPC's own build does not run it; it ships the pinned upstream artifact.
  • The 15 apps that ship wasm built from their own source got their real commands, read from their repos at the pinned tag (the Craft apps' packaging/web/package.sh, v86's Makefile, wiregasm's Makefile). The 8 existing JavaScript apps are grandfathered in LEGACY_NON_WASM, a closed list; external links and the Buddy panel are exempt.

Dependencies: mdast-util-from-markdown 2.0.3, mdast-util-gfm 3.1.0 and micromark-extension-gfm 3.0.0 are pinned in package.json at the versions already installed (they were Astro's dependencies); markdown.js is bundled with the pinned esbuild.

Eval (set A, 20 tasks, one chat per task, one run each)

Model Before After
lfm3-1.7b 13/20 15/20, median 8.8 s
qwen3.5-2b 0/20 1/20

Qwen follows the next-step hint but keeps rewording its search, so the model picker's help steers app work to LFM3.

How it was checked

Source: this branch, 7 commits on main 05c6b97.

  • node --test tests/*.test.mjs: PASS, 1148/1148.
  • Build commands: four cited lines read in the source repos at the pinned tags (GridCraft, LightCraft, v86, wiregasm) match the catalog.
  • Full browser suite on a production build (npm run build, then npx playwright test --config scripts/qa/playwright.config.mjs): PASS, 80/80 on the final tree (c1d3ced). pc-linux.spec.mjs:10 (real Linux, an edit then a reload) is a flake that predates this PR: it failed 2 of 8 runs on this branch and 2 of 6 on v0.1.0, and no file here is loaded by the Terminal.
  • pc-ai-agent.spec.mjs:136 repeated 10 times: PASS, 10/10.
  • Build size: 878 MB (budget 990 MB).
  • Real model (LFM3 on WebGPU, Chrome): "List all the apps on my PC, each with a short description" finished in 19 s with 25 rendered list items, no literal asterisks and no cut.
  • Screenshots opened and read: the welcome, an open pop-up, the Settings dialog and a pop-up inside it, in light and dark at 1440x900 and in light at 390x844; the welcome also at 1920x1080. No broken images, no 4xx responses, no page errors, no horizontal overflow; the 390 px header ends at 377 px in a 389 px frame.
  • Eval: node scripts/agent/eval.mjs --model <m> --set A against a local preview, results above.
  • No en or em dashes added.

Not run: Safari, Firefox, a physical phone, and the eval's sets B and C.

Qwen3.5 2B sent the same lookup_skill_index call again and again; the
guard answered each repeat with "Repeated tool call stopped" and the
chat ended as "could not complete". Now, at the second identical call
of a meta tool in one turn, Buddy answers from the earlier result with
a repeated error that names the next call: read_skill for a lookup,
the first hit's call for find_tool, the call_tool line for
describe_tool, read_skill and find_in_skill. Other tools keep the stop
at the third identical call.

Set A eval, one run each: lfm3-1.7b 13/20 to 15/20; qwen3.5-2b 0/20
to 1/20 (it follows the hint but keeps rewording its search).
The welcome paragraph is replaced by a strip of the apps Buddy can
work in (first 8, then a +N chip) and three one-line starters. Their
icons are clones of the desktop's own icons, tile included, with a
letter badge when Buddy runs without the desktop.

Sentences that sat in view move into pop-ups on the controls they
describe (help.js): the download note, the composer keys, the storage
note and the small-model warning, each with a visible badge or dot.
A pop-up opens on hover after 300 ms, on keyboard focus, and on a tap
of a help dot; it closes on Esc, an outside press, blur, scrolling,
and when its own control is pressed, so it never covers a menu that
control opens. The model picker's help says which models suit app
work.

Load model now starts disabled until Buddy has started: a click in the
moment before the script ran was lost and Buddy stayed "Not loaded".
Both failed on main and on v0.1.0:
- pc-ai-agent.spec.mjs seeded the old voice-agent record after Buddy
  had already started once; Buddy copies legacy records on its first
  start only, by design. The spec now seeds it from another page on
  the same origin before Buddy's first start.
- pc-buddy-agent.spec.mjs still expected the per-turn skill note that
  the measured defaults turned off; it now expects no note.
…agged

An LFM3 answer listing the apps stopped mid-line at 384 tokens and
showed raw **bold**.

- markdown.js: Markdown becomes DOM nodes through a syntax tree
  (mdast-util-from-markdown with GFM), never through HTML strings. An
  allow-list of elements; links only for http, https and mailto; no
  images (their URL would leave the device); raw HTML stays text; any
  parse or walk failure falls back to plain text. Bundled with the
  pinned esbuild by prepare-ai-agent.mjs; the three parser packages
  are pinned in package.json at the versions already installed.
- worker.js: MAX_NEW_TOKENS 384 to 1024, and done carries truncated
  when an answer hit the limit; cloud-client.js sets it on max_tokens
  or a length finish. model-client.js passes it on as
  { text, truncated: true } only for a cut-off answer, so every other
  result stays a string. session.js emits reply-cut for a cut-off
  final answer.

Checked on a real model (LFM3, WebGPU): the same prompt now finishes in
19 s with 25 rendered list items and no literal asterisks.
…rmatted answers

- Settings is eight cards (an icon, a title, the controls and short
  chips) with each section's sentences in a help dot; the warnings keep
  visible badges ("Key in memory only", "Sends to <host>", "Sends URLs
  to Jina", "This session only"). The provider choice is a segmented
  control. Help pop-ups mount inside the modal dialog, which sits in the
  browser's top layer; the first Esc closes a pop-up and the second the
  dialog. Opening Settings by keyboard shows no pop-up.
- Import sits next to Export in the header (it was "Open backup..." at
  the bottom of Settings). Below a 440 px panel, New chat, Export and
  Import become icon buttons so the header fits a 390 px screen.
- Enter sends; Shift + Enter adds a line; Ctrl or Cmd + Enter still
  sends; nothing is sent while an input method is composing.
- Assistant answers render Markdown (renderMarkdown, at most once per
  animation frame while streaming); a cut-off answer gets a "Cut short"
  chip. User bubbles and tool cards stay plain text.

The browser specs that asserted raw "**42**" and "**kept**" now assert
the rendered elements.
The top bar's Help button and the "About WebPC" app opened the same
window. The window is now the desktop's built-in Help (internal id
`about` kept, so saved window state still works), opened only by a "?"
icon button styled like the theme toggle. The catalog entry is removed,
so the app no longer shows on the desktop, in the Apps list or in app
search, and the catalog no longer accepts kind "about".

A saved desktop layout that still lists `about` loads cleanly; a unit
test pins it. The launcher spec now filters by Developer, since the
System category left with the About app.
…s how

The project convention: an app added to the catalog must compile to a
wasm module to be packaged with WebPC. Each kind: iframe app now
carries

    wasm:
      build: <the command that builds its wasm from its source repo>

The validator requires wasm.build for every packaged app. The eight
existing JavaScript apps (docs, sqliteviz, files, media, cyberchef,
nettools, beepbox, excalidraw) are grandfathered in LEGACY_NON_WASM, a
closed list: a new app cannot be added to it to pass the check.
External links and the Buddy panel are not packaged as apps and need
no wasm. WebPC's own build does not run the command; it ships the
pinned upstream artifact.

The 15 build commands come from each app's source repo at the pinned
tag (the Craft apps' packaging/web/package.sh, v86's Makefile,
wiregasm's Makefile); none is invented.
@codemug
codemug merged commit 32a6f2f into main Nov 23, 2026
1 check passed
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