fix(web): iOS PWA Web Push permission + responsive notification toasts#10814
Closed
haroondilshad wants to merge 1 commit intohcengineering:developfrom
Closed
fix(web): iOS PWA Web Push permission + responsive notification toasts#10814haroondilshad wants to merge 1 commit intohcengineering:developfrom
haroondilshad wants to merge 1 commit intohcengineering:developfrom
Conversation
|
Connected to Huly®: UBERF-16397 |
- Request notification permission before pushManager.subscribe so Enable push taps run under a user gesture on iOS Add to Home Screen PWAs. - On Safari standalone, never call startup subscribePush: permission may already be granted yet auto-subscribe recreates PushSubscription docs and disables BrowserNotification toast ingestion before the Enable push gesture. - Responsive NotificationToast min-width; stack action buttons at max-width 30rem with full-width antiButton on narrow viewports.
3256f1e to
dcaacbe
Compare
Author
|
After hands-on checks on huly.app, closing this PR without merging. The problem was onboarding/discovery rather than needing this behavioural patch:
Given current huly.app behaviour validated in testing, documenting this onboarding path outweighs restructuring client subscribe flow here — closing accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Web Push onboarding on iOS Add-to-Home-Screen PWAs was unreliable:
subscribePush()did not request notification permission beforepushManager.subscribe(), and startupsubscribePush()ran without a user gesture—Safari rejects that path while permission is stilldefault. Toast UI used a fixedmin-widthand horizontal action row, which hides controls on narrow viewports.Changes
subscribePush()(plugins/notification-resources/src/utils.ts): whenNotification.permissionisdefault, callawait Notification.requestPermission()before subscribing, so taps on Enable push run permission + subscribe in one gesture chain.BrowserNotificatator.svelte: ifnavigator.standalone === true(Safari Web App) and permission is stilldefault, skip startupsubscribePush()so theBrowserNotification→ toast → Enable push path is used instead of a silent failure.NotificationToast.svelte: constrain width withmin(35rem, calc(100vw - 1.75rem)); for viewports≤30rem, stack toast actions vertically and stretchantiButtonto full width.Test plan
PushSubscriptionon the workspace.NotificationToastwith multiple buttons (e.g. Open + Enable) on a narrow emulator width.Local verification
rush build --to @hcengineering/notification-resources: successful.rush build --to @hcengineering/ui,pnpm exec jestinpackages/ui: 22/22 tests passed.