Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: I found a potential duplicate:
This PR appears to directly address the same feature as PR #19173. Both PRs are implementing PWA (Progressive Web App) support with a service worker for caching assets. PR #19122 specifically mentions "add PWA service worker for asset caching," which overlaps with the core functionality described in the current PR (registering a service worker to cache the app shell and static assets). |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
got similiar PR #19122 |
|
I'm eager to test out this patch on my install but there seems to be a merge conflict with index.html that prevents the patch from applying cleanly. Could you rebase? |
|
I hit |

Issue for this PR
Closes #19174
Type of change
What does this PR do?
This adds basic PWA support for the web app so OpenCode feels more like an installed app and can keep its core shell available offline.
I added the mobile web app metadata in
packages/app/index.html, updated the manifest with install settings likestart_url,scope, fullscreen display options, and icon purposes, and registered a service worker frompackages/app/src/entry.tsx. The newpackages/app/public/sw.jscaches the app shell and key static assets, uses cached assets when it can, and falls back to the cached root document for navigation requests when the network is unavailable. I also updatedpackages/app/public/_headersso the manifest and service worker are served with the right content types and service worker headers.This works because browsers need the manifest, install metadata, and service worker together for installability and offline support. Caching the shell assets gives the app something reliable to load when the network drops, and the added headers make sure those files are recognized and scoped correctly by the browser. One thing I like is that this keeps a single persistent instance of the app open rather than opening multiple instances in the browser.
How did you verify your code works?
I ran the opencode web application and served it locally onto my network, then opened it on my phone and installed the PWA. Screenshots attached.
Screenshots / recordings
Checklist