From 9105fd8c989cd590ff68d3edccc78c95176d0b69 Mon Sep 17 00:00:00 2001 From: HalfSweet Date: Thu, 12 Nov 2026 21:04:05 +0800 Subject: [PATCH] feat(store): the install button opens Pocket Hub on the app An app's page hands the app to Pocket Hub through a link the system opens Hub's Mac app with: pocket-hub://store/app/. hubInstallLink builds it, and Pocket Hub's docs/DEEP-LINKS.md is the contract: the link carries the id and nothing else, and following it shows the app in Hub, where the owner installs it. A browser does not tell a page whether such a link opened anything, so once a visitor has followed it the page says what should have happened and what is missing when nothing did. The words go in the row under the screen, so the app's name does not move. The disabled "Not open yet" state of the button is gone with its string. --- README.md | 2 +- docs/applets.md | 2 +- store/site/src/components/InstallButton.vue | 43 +++++---------------- store/site/src/hub.ts | 22 +++++++---- store/site/src/i18n/en.ts | 2 +- store/site/src/i18n/zh-CN.ts | 2 +- store/site/src/pages/AppPage.vue | 38 +++++++++++++++++- store/test/hub.test.ts | 30 ++++++++++++++ 8 files changed, 95 insertions(+), 46 deletions(-) create mode 100644 store/test/hub.test.ts diff --git a/README.md b/README.md index 27e7b7e..7a7f931 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ bun run site:build # store/site/dist, which the Wor A merge to `main` that touches the store deploys it, migrations first (`.github/workflows/store.yml`); `main` takes changes through pull requests only. -An app's page there has one way to install it, a button that opens Pocket Hub; that hand-off is not open yet, and the button says so. [docs/applets.md](docs/applets.md) has the store's routes, the website, the publishing rules, the sample data format and what an installed app can reach. +An app's page there has one way to install it, a button that opens Pocket Hub on the app (a `pocket-hub://store/app/` link); Hub installs it from there. [docs/applets.md](docs/applets.md) has the store's routes, the website, the publishing rules, the sample data format and what an installed app can reach. ## License diff --git a/docs/applets.md b/docs/applets.md index 90d96bc..d1ad674 100644 --- a/docs/applets.md +++ b/docs/applets.md @@ -48,7 +48,7 @@ bun run typecheck:site `wrangler dev` and `wrangler deploy` in `store/` run the build themselves (`build` in `store/wrangler.jsonc`), so `store/site/dist` is never committed. What the build copies as it is lives in `store/site/public/`: the response headers (`_headers`), the favicons and the applet player. -**An app's page says what the app is and nothing about which device it fits.** It has the icon, title, summary and publisher, a button that installs it, the app running on its sample data when it has some, and its version, size and date. **Installing is Pocket Hub's**: the button opens Hub, and Hub decides whether a device can run the app and installs it. That hand-off is not open yet, so `hubInstallLink` in `store/site/src/hub.ts` returns no link and the button reads "Not open yet". The page gives no install steps of its own. +**An app's page says what the app is and nothing about which device it fits.** It has the icon, title, summary and publisher, a button that installs it, the app running on its sample data when it has some, and its version, size and date. **Installing is Pocket Hub's**: the button opens Hub, and Hub decides whether a device can run the app and installs it. The button is a link, `pocket-hub://store/app/`, that the system opens Pocket Hub's Mac app with; `hubInstallLink` in `store/site/src/hub.ts` is the one place that builds it, and Pocket Hub's `docs/DEEP-LINKS.md` is the contract for it. The link carries the app's id and nothing else, and following it only shows the app in Hub: the install is a click there, on a device Hub chose. A browser does not tell a page whether such a link opened anything, so once a visitor has followed it the page says what should have happened and what is missing when nothing did: Pocket Hub, which is not released yet. The page gives no install steps of its own. **What a package says about itself is one level down**, in a sheet the page's "more" menu opens (`?details=compatibility`, `access`, `versions` or `package`), read from `/v1/manifests` and `/v1/apps//versions` when it opens: the device of each variant (`rg-ds-plus` is Omarchy Pocket, `tab5-home` the M5Stack Tab5, `3ds-dev` the Nintendo 3DS) with its host ABI, the capabilities the app needs and the ones it uses where a device has them, each with what it lets the app do, and the surface it lays out for; the hosts and services it reaches; every listed version with its package to download; and the id, publisher key, package hash, framework, applet API version and, for each build, its sections' sizes, build hash and profile hash. diff --git a/store/site/src/components/InstallButton.vue b/store/site/src/components/InstallButton.vue index de2065c..2acfcc3 100644 --- a/store/site/src/components/InstallButton.vue +++ b/store/site/src/components/InstallButton.vue @@ -1,7 +1,8 @@