Repository navigation
Load notification app icons through the dashboard host - #12
Conversation
fdussert
left a comment
There was a problem hiding this comment.
Thanks — this is a clean change. Validating the bundle id on both sides, keeping the host route PNG-only and gating it behind the dock subscription is exactly the shape I'd want, and the tests (no dock subscription, path refusal, foreign source, retry) cover the right things.
Only small things:
-
widgets/shortcuts/index.html(around line 179) still points an<img>straight at/api/apps/icon/<bundleId>, so it has the same opaque-frame problem. Shortcuts already subscribes todock, so it could move toFremkit.appIcon()in this PR — or say it's a follow-up. -
The non-OK branch in
useWidgetBridge.tsreplies withbridge.noIcon, which reads "no icon for this site". Could you add an app-specific key (e.g.bridge.noAppIcon) to bothfr.tsanden.ts? -
Nit: if a button is dropped while its icon request fails,
missing()re-arms a retry timer on a detached node and it keeps retrying every 30 s. Checkingbutton.isConnected(orimg.isConnected) before scheduling would stop that. It predates this PR, so feel free to skip. -
The CHANGELOG line sits as a loose bullet above
### Changed; please move it under the right subsection. #10, #11 and #13 add theirs at the same spot, so expect a small rebase.
Note for us on the maintainer side: appIcon extends the bridge, so SDK_VERSION will need a bump before the next release. Nothing for you to do here. Also, #10 has the same WebKit root cause; if we end up fixing it in the CSP, I'll check whether that changes anything here.
e326793 to
50137c6
Compare
Opaque widget frames cannot request local icon routes directly. Resolve validated bundle IDs through the trusted host bridge and retry missing icons without exposing local paths. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
50137c6 to
2636c64
Compare
|
Thanks Florian, all four points are addressed, and the Shortcuts migration works end to end in WebKit (Safari and Calculator icons arrive as Sorry for moving the goalposts here — something changed underneath this PR after we reviewed it. Since #10 landed, the widget CSP lists the server's loopback origins in Could you add the same cross-site refusal to Optional nit: the Thanks again, and sorry for the extra round. |
Co-Authored-By: Claude <noreply@anthropic.com>
fdussert
left a comment
There was a problem hiding this comment.
Thanks Florian, the icon route now refuses cross-site requests and the test covers it. In WebKit and Chromium a widget without dock gets onerror (403, Sec-Fetch-Site: cross-site), while Shortcuts and Notifications still get their icons through appIcon. Approving and merging (squash) — thanks for the extra round!
What this changes
Notification and Shortcut widgets in opaque sandbox frames could not load local application icons directly. Both now ask the trusted dashboard host for a validated bundle ID and a PNG icon. The bridge requires the existing
docksubscription; widgets keep their glyph fallback and retry when an icon is temporarily unavailable. A detached Shortcut button stops retrying.French and English messages distinguish a missing application icon from a missing website favicon. The host route remains PNG-only and rejects invalid or foreign requests.
Related fork issue: FlorianBruniaux#20
Checks
pnpm typecheck,pnpm test(1,400 server and 392 UI tests), andpnpm buildpassed on2636c64.git diff --checkpassed. Native XENEON rendering has not been retested from this branch.The new
Fremkit.appIcon()bridge method will require the maintainer's SDK version bump before a release.