Skip to content

feat(desktop): open apps from the host and take the desktop name from the System manifest - #27

Merged
doodlewind merged 1 commit into
mainfrom
feat/desktop-host-open
Oct 4, 2026
Merged

doodlewind merged 1 commit into
mainfrom
feat/desktop-host-open

Conversation

@doodlewind

Copy link
Copy Markdown
Contributor

What changed

Host open line. The System UI protocol (shells/desktop/src/system-ui/svc.ts) gains one host → System UI line:

{t:"open", package:"<package id>"}

It opens the installed app with that package id. When the app's window is already open, the line restores it if it is minimized, raises it and focuses it; it does not open a second window. An open launcher or dropdown closes first, because those belong to the window that loses focus. A package id outside the installed catalog, the System UI's own id, a missing id and a non-string id are ignored. The handler reuses openPocketApp, the path a desktop icon takes; pocketAppByPackage in pocket-apps.ts does the catalog lookup.

Desktop name from the System manifest. The System UI no longer spells its own name. pocket-apps.ts exports DESKTOP_NAME, the title of the pocket.system.json it already imports, and these places read it:

  • the Aqua screen bar's program name when no window is focused (and for the About and Shut Down windows, which are no program of their own)
  • the About window's title and its heading
  • the three "About ..." menu entries (Notepad Help, Minesweeper Help, the Aqua logo menu)
  • the first line of the welcome note

shells/desktop/pocket.system.json keeps "title": "Pocket Shell Desktop", so this repository's output, tests and committed screenshots do not change.

Left alone on purpose: the XP Start panel header (user="Pocket") is an account name, not the desktop's name, and "Shut Down Windows" is period copy. Both would change this repository's own output if they followed the manifest title.

The desktop README's Architecture section documents both mechanisms.

Why Pocket Studio needs it

Pocket Studio puts this System UI on the laptop in its room, under its own System manifest (title Pocket Nexus, three installed apps). Two things had no route:

  • The page around the laptop needs to open an app from outside the desktop, for example Settings from a room control. The protocol had input lines only, so the embedding host could not expose launch(packageId).
  • The Aqua menu bar and the About dialog read "Pocket Shell Desktop" on a product with another name, because the string was a literal in app.tsx and programs.tsx.

Verification

Run in a throwaway copy of this branch linked to PocketJS main at b21bd28d (newer than this repository's pin 0ca1b362; the pinned submodule was not initialized in the checkout the change was written in). WASM artifacts were prebuilt, so the tools/wasm.ts and tools/text-wasm.ts rebuild steps of test:sim and test:text were skipped.

Command Result
bun vendor/pocketjs/node_modules/typescript/bin/tsc --noEmit (root) clean
bun run --cwd shells/desktop typecheck clean
bun test test/system-ui.test.ts 61 pass, 0 fail (2 new)
bun scripts/build-sim.ts && bun test --conditions=browser test/system-ui-sim.test.ts 6 pass, 0 fail (2 new)
bun test --conditions=browser test/wrap-op.test.ts 3 pass, 0 fail
bun test --conditions=browser test/text-layout.test.ts 6 pass, 0 fail
bun scripts/check-assets.ts 288 tracked files, no ignored outputs tracked

New coverage:

  • system-ui.test.ts: DESKTOP_NAME equals the manifest title; pocketAppByPackage resolves each installed app and rejects the System UI id, an unknown id, an empty id and non-strings.
  • system-ui-sim.test.ts, "the host opens installed apps by package id": an open line opens Hero and focuses its surface; a line for Settings moves focus; a repeated line for Hero raises it and leaves one window per app; after Cmd+M the line restores and focuses Hero; an open Start menu closes; unknown ids, the System UI id, a missing id and a numeric id leave the tree and the surface bindings unchanged.
  • system-ui-sim.test.ts, "the screen bar and About name the desktop after the System manifest": with no window focused in Aqua the name appears once (the screen bar); the logo menu's About row opens the About window.

Disabling the handler makes the open test fail at its first assertion, so the test exercises the line.

Not run locally, left to CI: the 3DS, iPod and touch shell tests, desktop test:rust, desktop build, desktop package:linux, desktop test:web and the site build and smoke check.

🤖 Generated with Claude Code

… the System manifest

The System UI protocol gains a host line, {t:"open", package}. It opens the
installed app with that package id. When the app's window is already open the
line restores it if it is minimized, raises it and focuses it, and it closes an
open launcher or dropdown first because those belong to the window that loses
focus. A package id outside the installed catalog is ignored.

The System UI no longer spells its own name. The Aqua screen bar with no window
focused, the About window, its heading and menu entries, and the welcome note
read the System manifest's title through pocket-apps.ts. This repository's
manifest keeps "Pocket Shell Desktop", so its output is unchanged; a product
that installs the System UI under its own pocket.system.json gets its own name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doodlewind
doodlewind marked this pull request as ready for review October 4, 2026 06:07
@doodlewind
doodlewind merged commit e1c9798 into main Oct 4, 2026
2 checks passed
@doodlewind
doodlewind deleted the feat/desktop-host-open branch October 4, 2026 06:07
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