Repository navigation
feat(desktop): open apps from the host and take the desktop name from the System manifest - #27
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Host open line. The System UI protocol (
shells/desktop/src/system-ui/svc.ts) gains one host → System UI line: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;pocketAppByPackageinpocket-apps.tsdoes the catalog lookup.Desktop name from the System manifest. The System UI no longer spells its own name.
pocket-apps.tsexportsDESKTOP_NAME, thetitleof thepocket.system.jsonit already imports, and these places read it:shells/desktop/pocket.system.jsonkeeps"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:launch(packageId).app.tsxandprograms.tsx.Verification
Run in a throwaway copy of this branch linked to PocketJS
mainatb21bd28d(newer than this repository's pin0ca1b362; the pinned submodule was not initialized in the checkout the change was written in). WASM artifacts were prebuilt, so thetools/wasm.tsandtools/text-wasm.tsrebuild steps oftest:simandtest:textwere skipped.bun vendor/pocketjs/node_modules/typescript/bin/tsc --noEmit(root)bun run --cwd shells/desktop typecheckbun test test/system-ui.test.tsbun scripts/build-sim.ts && bun test --conditions=browser test/system-ui-sim.test.tsbun test --conditions=browser test/wrap-op.test.tsbun test --conditions=browser test/text-layout.test.tsbun scripts/check-assets.tsNew coverage:
system-ui.test.ts:DESKTOP_NAMEequals the manifest title;pocketAppByPackageresolves 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:weband the site build and smoke check.🤖 Generated with Claude Code