fix(web): add web app manifest so installed app keeps its scope#4306
fix(web): add web app manifest so installed app keeps its scope#4306Albro3459 wants to merge 4 commits into
Conversation
apps/web ships no manifest, so iOS infers the navigation scope of an installed home screen app from whichever URL was saved. Saving a deep link collapses scope to that single path, and every other route is treated as out of scope and handed off to an in-app browser view. Declare scope and start_url at the origin root with display standalone. Icons reuse the existing asset filenames so the publish-time brand overrides in scripts/lib/brand-assets.ts keep applying per release channel. Fixes pingdotgg#4305
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Adds a static web app manifest file for PWA support. This is a simple configuration-only change with no runtime code modifications - just a JSON file specifying display properties and existing icon references. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3cbb8eb. Configure here.
APP_DISPLAY_NAME resolves per channel ("T3 Code (Nightly)", "(Alpha)",
"(Dev)") from the hosted channel or the desktop bridge, and
DocumentTitleSync keeps document.title in sync with it at runtime.
A static name/short_name in public/ cannot follow that, so a nightly
install would show the production label next to nightly-branded icons.
Making the manifest channel-aware would require generating it at build
time, since Vite does not template files in public/.
name and short_name are optional, so omitting them lets the Home Screen
label fall back to document.title, which is already correct per channel.
Dismissing prior approval to re-evaluate 1d66bcb

What Changed
apps/web/public/manifest.webmanifestdeclaringscopeandstart_urlat the origin root, withdisplay: standalone.<link rel="manifest" href="/manifest.webmanifest" />toapps/web/index.html.Two files, one line of HTML. No new dependencies, no service worker, no new binary assets, no runtime logic, no CSS changes.
Why
Fixes #4305.
apps/webcurrently ships no web app manifest, so thescopemember is never declared. With noscope, iOS infers the navigation scope of an installed Home Screen app from whichever URL was saved.The app redirects the origin root to the last-opened thread, so the URL captured by "Add to Home Screen" is usually
/<environmentId>/<threadId>. Scope collapses to that single thread path, and every subsequent navigation is treated as out of scope and handed off to an in-app browser view, ending the standalone session.Declaring
scope: "/"makes every route on the origin part of the app.Why the icons reuse existing filenames
scripts/lib/brand-assets.tsswaps web icons by target filename per release channel (nightly-web-apple-touch-180.pngandt3-black-web-apple-touch-180.pngboth land asapple-touch-icon.png).The manifest therefore references the existing
apple-touch-icon.pngandfavicon-32x32.pngrather than adding a new icon asset, so publish-time brand overrides keep applying and nightly builds do not ship the production mark.Testing
Verified against a real
t3 servebuild (0.0.29-nightly.20260722.878) served over HTTPS, on iOS 26.5 / Safari.Server side:
Mime.getType()inapps/server/src/http.tsresolves.webmanifestcorrectly, so no MIME handling changes are needed.Device: added to the Home Screen from a deep-linked thread URL (
/<environmentId>/<threadId>), the case that previously broke. Before the change, navigating to another thread left standalone mode and opened an in-app browser view. After the change, navigation stays inside the installed app across threads and Settings.Deliberately out of scope
apple-mobile-web-app-*meta tags. Safari 17+ honorsdisplay: standalonefrom the manifest directly.Note
Low Risk
Static manifest plus one HTML link; no auth, data, or runtime logic changes.
Overview
Fixes installed iOS Home Screen behavior when the save URL is a deep-linked thread: without a declared
scope, Safari narrows the app to that path and later navigation opens in an in-app browser.This PR adds
manifest.webmanifestwithid,start_url, andscopeset to/,display: standalone, dark theme colors, and icons pointing at existingfavicon-32x32.pngandapple-touch-icon.png(so release-channel icon swaps keep working).index.htmlgains<link rel="manifest" href="/manifest.webmanifest" />.Reviewed by Cursor Bugbot for commit 5449f71. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add web app manifest to preserve scope when app is installed
Adds manifest.webmanifest and links it in index.html. The manifest sets
id,start_url, andscopeto/, uses standalone display mode, and declares PNG icons at 32×32 and 180×180 with dark theme colors.Macroscope summarized 5449f71.