fix(frontend): correct OS push notification icons and add web app manifest - #13245
Conversation
Center-crop the AutoGPT notification icons to ~60% (20% off each side) so the logo fills more of the frame. The previous assets had too much padding, making the mark appear small in OS push notifications. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughAdds a PWA manifest, references it and an Apple touch icon in Next.js metadata, and changes the service worker push notification badge image to ChangesPWA Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
notification-icon-512.png is not referenced anywhere — push-sw.js and the in-page fallback both use the 192px icon. Remove the dead asset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #13245 +/- ##
==========================================
- Coverage 72.54% 72.48% -0.06%
==========================================
Files 2349 2348 -1
Lines 174820 174608 -212
Branches 17727 17740 +13
==========================================
- Hits 126817 126573 -244
- Misses 44243 44275 +32
Partials 3760 3760
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
iOS Safari/PWA web push doesn't use the notification.icon field — it shows the installed home-screen icon, which falls back to the favicon when no apple-touch-icon or manifest exists. Add the missing pieces so iOS (and Android-PWA-installed) notifications render the proper AutoGPT mark instead of a blurry fallback. - Add apple-touch-icon.png (180x180), cropped to match the existing notification-icon-192. - Add manifest.webmanifest declaring both 192 and 512 icons with purpose "any maskable" (mark sits inside Android's 80% safe zone). - Restore notification-icon-512.png for the manifest 512 entry. - Wire both into Next.js metadata in layout.tsx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…us bar Android masks the notification badge (status-bar icon) using only the alpha channel; the previous reuse of the full-color icon rendered as a filled silhouette instead of the AutoGPT mark. Add a dedicated 96x96 badge cropped from the transparent-background AutoGPT mark — Android tints the alpha with the system color, while platforms that ignore badge fall through harmlessly. push-sw.js now references /notification-badge-96.png for the badge slot; the icon slot still points at /notification-icon-192.png. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous badge applied the 60% center-crop intended for the with-background icon, but the no-background source already fills the canvas — that crop clipped into the logo itself. Resize the dark no-bg source directly to 96x96 without cropping so the full mark is visible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Why
Follow-up to #13231. That PR replaced the OS push-notification
iconfield, but the change didn't actually reach iOS — iOS Safari/PWA web push uses the installed home-screen app icon, not thenotification.iconfield, and this project had no apple-touch-icon and no web manifest. The Android notification badge was also reusing the full-color icon, which Android renders as a filled silhouette instead of the AutoGPT mark (badge must be alpha-only).So the previous PR fixed desktop Chrome / Android-Chrome-not-installed but left iOS and the Android status-bar badge unfixed. This PR closes those gaps and tightens the icon crop while we're here.
What
notification-icon-192.png(and the restored 512) are center-cropped to ~60% so thegptmark fills the frame instead of swimming in padding.public/manifest.webmanifestdeclares 192 + 512 icons withpurpose: "any maskable", plus app name / theme color /display: standalone. Makes the site installable as a PWA on Android and provides iOS 16.4+ with the metadata it needs to treat the home-screen install as a web-push-eligible PWA.public/apple-touch-icon.png(180×180, cropped) is what iOS actually uses for both the home-screen install and the icon shown in web-push notifications.public/notification-badge-96.png(96×96, transparent background, full-bleedgptmark on the alpha channel). Android tints the alpha with the system color; non-Android badge consumers see the dark-navy mark on transparent.src/app/layout.tsxnow declaresmanifest: "/manifest.webmanifest"andicons.apple: "/apple-touch-icon.png".push-sw.js—badgenow points at/notification-badge-96.png(icon still points at/notification-icon-192.png).How
favicon_io_light_on_dark_bgfor filled icons,favicon_io_dark_no_bgfor the alpha-only badge).<link rel="manifest">and<link rel="apple-touch-icon">tags automatically.Per-platform coverage after this PR
notification.icon→/notification-icon-192.pngnotification.icon→/notification-icon-192.pngnotification.badge→/notification-badge-96.pngNotes
devfrom a stale generated API client (missinguseListBotPlatforms,search.msw) are unrelated to this PR's diff.Checklist
layout.tsx