mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 13:20:54 +01:00
Long-lived tabs keep running the JS bundle they loaded at page-load, so a deployed fix doesn't reach them until they happen to reload — which is exactly what let the memory-leak fix (#9827) look like it "wasn't working" on stale tabs. The service worker (public/sw.js) is a static file that doesn't change between builds, so the usual SW updatefound flow never fires for a JS-only deploy. Detect a new build by comparing the hashed entry bundle filename (index-<hash>.js, which Vite changes every build) against a freshly-served /index.html — polled every 5 min and on tab focus/visibility. When it changes, show a persistent, dismissible banner ("A new version is available — Reload"), styled like the info toast. The banner never auto-reloads, so it can't interrupt work or lose unsaved input; reload is user-driven. - lib/app-update-check.ts: bundle-id detection + latched watcher (+ tests). - components/AppUpdateBanner.tsx: the banner, mounted in Layout beside ToastViewport. tsc clean; app-update-check + Layout suites pass.
@paperclipai/ui
Published static assets for the Paperclip board UI.
What gets published
The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.
Storybook
Storybook config, stories, and fixtures live under ui/storybook/.
pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook
Typical use
Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.