Skip to content

[Bug]: Installed home screen web app drops out to Safari when navigating between chats #4305

Description

@Albro3459

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Serve the web app over HTTPS on an origin reachable from your phone
    (ex: npx t3@nightly serve --host 127.0.0.1 --port 3773, exposed over
    HTTPS). A secure context is required for home screen web app behavior.
  2. On the iPhone, open Safari and go to the origin root, https://<origin>/.
    The app redirects to the last-opened thread, so the address bar now reads
    https://<origin>/<environmentId>/<threadId>.
  3. Share sheet → "Add to Home Screen" → Add.
    Safari saves the deep-linked URL. iOS does not allow editing it here.
  4. Launch the app from the home screen. It opens in standalone mode.
  5. Navigate to any other thread, or to Settings.

Expected behavior

Navigation stays inside the installed Home Screen app. Every route on the
origin is part of the app, so moving between threads should not leave
standalone mode.

Actual behavior

The navigation opens an in-app Safari browser view instead of being treated
as a normal navigation within the origin.

Cause: apps/web ships no web app manifest. There is no
apps/web/public/manifest.webmanifest and no <link rel="manifest"> in
apps/web/index.html, so the manifest scope member is never declared.

With no scope, iOS infers the navigation scope from whichever URL was
saved. Because step 2 saves /<environmentId>/<threadId>, scope collapses
to that single thread path, and every other route is treated as out of
scope and handed off to the browser.

Confirmed against the served build (0.0.29-nightly.20260722.877):

$ curl -s -o /dev/null -w '%{http_code} %{content_type}\n'
http://127.0.0.1:3773/manifest.webmanifest
200 text/html; charset=utf-8

That 200 is the SPA index.html fallback, not a manifest. dist/client/
contains only apple-touch-icon.png, the favicon .png/.ico files,
index.html, mockServiceWorker.js and assets/.

Impact

Minor bug or occasional failure

Version or commit

main @ 9a0a071

Environment

iOS 26.5, Safari, macOS 26.5, Node v24.18.0, t3@nightly 0.0.29-nightly.20260722.877

Logs or stack traces

N/A — no console error is produced. The navigation is handed to Safari by
the OS, not by app code.

Screenshots, recordings, or supporting files

No response

Workaround

Save the app from the origin root rather than a deep link, so the inferred
scope becomes "/".

iOS does not let you edit the URL in the Add to Home Screen sheet, and the
app auto-redirects to the last thread, so the root URL is hard to capture
normally.

What worked: disable WiFi and cellular on the phone, load https://<origin>/
(which fails to load and therefore cannot redirect), add that to the home
screen, then re-enable the network. The installed app then navigates
correctly across all routes.

Side note: the resulting home screen icon is blank, since apple-touch-icon.png
could not be fetched while offline. That is an artifact of the offline
workaround, not a separate bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions