Skip to content

Studio: make the web UI installable as a PWA - #13360

Merged
danielhanchen merged 1 commit into
mainfrom
studio-pwa-manifest
Oct 12, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-pwa-manifest

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #12262

Mobile browsers never offered to install the Studio web UI as an app: index.html linked no web app manifest, and /manifest.webmanifest fell through to the SPA catch-all and came back as the HTML shell.

Changes

  • studio/frontend/public/manifest.webmanifest: name, start_url: "/", scope, display: "standalone", and a 192px plus a 512px icon.
  • studio/frontend/public/pwa-192.png: the existing rounded-512.png downscaled to 192px. The 512px entry reuses rounded-512.png as is, so nothing that reads it by name (the install.sh launcher icon) moves.
  • studio/frontend/index.html: one <link rel="manifest">.
  • tests/studio/test_pwa_manifest.py: the link is present, the manifest has the fields Chromium checks, and each icon exists with the declared size.

No backend change. Vite copies public/ into dist/, the existing catch-all serves the file, Python's mimetypes maps .webmanifest to application/manifest+json (3.11 to 3.13), and the CSP's default-src 'self' already covers a same-origin manifest. No service worker, so caching and offline behaviour are unchanged.

Testing

Installed Studio from this branch with install.sh --local and launched it with --secure:

main this PR
GET /manifest.webmanifest 200 text/html (the SPA shell) 200 application/manifest+json
Chromium Page.getInstallabilityErrors over HTTPS no-manifest none
Android Chrome, Add to Home screen shortcut only offers Install
  • /chat still returns the HTML shell and an unknown /assets/* path still 404s.
  • tests/studio/test_pwa_manifest.py fails on main (2 failed) and passes here (2 passed).
  • Backend and packaging suites (test_middleware.py, test_frontend_resolution.py, test_llama_compat_routes.py, test_frontend_dist_cache.py, test_package_discovery.py, test_tauri_branding_contract.py): 288 passed, 2 skipped on both main and this branch.
  • Frontend node --test files that read index.html: 69 passed. tsc --noEmit clean, bundle budget within limits.

HTTPS is still the deployment's job for LAN access (a reverse proxy, or --secure). Desktop ignores the manifest: its webview does not install PWAs and its CSP is also default-src 'self'.

Before / after

Same Chromium build against two isolated Studio installs (merge base a4b9c62 vs this branch).

Opening /manifest.webmanifest: main returns the Studio shell, this PR returns the manifest.

manifest URL before and after

Chromium's install check on the Studio home (caption drawn by the test harness; the page itself is unchanged): no-manifest on main, installable with this PR.

install check before and after

@danielhanchen danielhanchen self-assigned this Oct 12, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-12T03:12:36.316044Z 9824212 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T03:40:35.302577Z 9824212 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 982421205b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"name": "Unsloth Studio",
"short_name": "Unsloth",
"id": "/",
"start_url": "/",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid installing against an ephemeral tunnel origin

When Studio is opened through the built-in --secure or Remote access flow, this URL resolves against the current *.trycloudflare.com origin. That flow explicitly uses a temporary URL and creates a new one each time Studio starts (studio/frontend/src/features/settings/components/remote-access-section.tsx:379-381), so the installed app's launch URL points to a dead hostname after the next restart. Either suppress the install manifest for quick-tunnel requests or provide a stable launch origin before advertising installation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install is user initiated, and a quick tunnel URL is temporary for bookmarks and shortcuts too. The request in #12262 is a stable HTTPS origin behind a reverse proxy, which is what this targets, so I'd rather not add per origin manifest routing for the quick tunnel case.

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 12, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 12, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 982421205b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

[Feature] Make Unsloth Studio Web UI installable as a PWA

1 participant