Enable PWA mode for the assistant#150
Enable PWA mode for the assistant#150ericboucher wants to merge 18 commits intosuitenumerique:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds PWA support to the conversations frontend: Workbox-based service worker source and registration, InjectManifest wired into Next.js webpack for production client builds, a web app manifest and PWA meta tags, and Workbox dependency updates. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser
participant App as _app.tsx
participant RegUtil as registerServiceWorker()
participant SWReg as ServiceWorkerRegistration
participant NewSW as Installing Worker
participant ActiveSW as Active Service Worker
participant API as /api/
Browser->>App: page load
App->>RegUtil: call registerServiceWorker()
Note right of RegUtil: runs only in browser, production, and if SW supported
RegUtil->>SWReg: navigator.serviceWorker.register('/sw.js')
SWReg-->>RegUtil: registration resolved
RegUtil->>SWReg: schedule registration.update() (hourly)
SWReg->>NewSW: updatefound -> installing
NewSW-->>SWReg: state -> installed
SWReg->>RegUtil: installed detected && controller exists
RegUtil->>Browser: prompt user to refresh
alt user accepts
RegUtil->>NewSW: postMessage {type: 'SKIP_WAITING'}
NewSW->>ActiveSW: skipWaiting -> activate
ActiveSW->>Browser: controllerchange
Browser->>App: reload -> fetch assets, API calls to API
Browser->>API: request -> API responds (NetworkFirst)
else user declines
Note right of Browser: continue using current SW until next activation
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/frontend/apps/conversations/next.config.js(1 hunks)src/frontend/apps/conversations/package.json(1 hunks)src/frontend/apps/conversations/public/manifest.json(1 hunks)src/frontend/apps/conversations/public/sw.src.js(1 hunks)src/frontend/apps/conversations/src/pages/_app.tsx(2 hunks)src/frontend/apps/conversations/src/pages/_document.tsx(1 hunks)src/frontend/apps/conversations/src/utils/registerServiceWorker.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/frontend/apps/conversations/src/pages/_app.tsx (1)
src/frontend/apps/conversations/src/utils/registerServiceWorker.ts (1)
registerServiceWorker(6-66)
|
|
@ericboucher if you suggest it, we guess there is a need. We think we could merge this when ready, we are only a bit afraid for the support/maintenance it might generate (and the fact the application has no offline mode at all). For sure, if you want to finish the PR, we will accept it. Don't hesitate to reach out @elvoisin to work with her :) 🥔 🔥 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/frontend/apps/conversations/package.json`:
- Around line 88-93: Update all Workbox package versions from 7.1.0 to 7.4.0 in
package.json by replacing the version strings for the dependencies
"workbox-cacheable-response", "workbox-core", "workbox-expiration",
"workbox-precaching", "workbox-routing", and "workbox-strategies" with "7.4.0",
then run your package manager (npm/yarn/pnpm) to install and update lockfile
accordingly.
|
Dans une prochaine itération on pourra imaginer autoriser les utilisateurs à accéder aux conversations hors ligne pendant quelques temps, avec une strategy CacheFirst ou StaleWhileRevalidate. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
Bonsoir @elvoisin dites moi comment je peux vous aider à débloquer cette PR. Je serais bien heureux de pouvoir avoir un petit icon assistant à côté de Tchap dans le dock :) |
|




Purpose
Enable PWA mode to allow users to add an augmented shortcut of the app, just like the one availble for Tchap.
Let me know if you find this relevant and its worth fixing the CI / coderabbit @qbey @elvoisin
Proposal
External contributions
Thank you for your contribution! 🎉
Please ensure the following items are checked before submitting your pull request:
git commit --signoff(DCO compliance)git commit -S)<gitmoji>(type) title description## [Unreleased]section (if noticeable change)Summary by CodeRabbit
New Features
Chores
Documentation