Skip to content

fix(notifications): list system notifications and open their session from the Notifications tab - #240

Merged
andrebrait merged 4 commits into
kahme247:mainfrom
andrebrait:fix/notification-history-open
Oct 10, 2026
Merged

andrebrait merged 4 commits into
kahme247:mainfrom
andrebrait:fix/notification-history-open

Conversation

@andrebrait

@andrebrait andrebrait commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #218 and #230, which merged without two pieces the combined build relied on.

What was missing

  1. System notifications never reached the Notifications tab. Only in-app toasts were recorded in toastHistory, so a notification shown by the OS (Settings → Notifications → system notification) disappeared once it was dismissed.
  2. Entries could not open their session. History entries did not keep the toast's onClick, and feat(notifications): desktop and mobile notifications with Web Push #218 removed the Open link, so the Notifications tab had no way to open the session an entry came from.

Changes

  • useNotifications: record OS-shown notifications with toastHistory.record, passing the session onClick.
  • Web Push (the usual path once notifications are on): the push payload carries type, and public/sw.js posts omp-notification-shown to open windows after showing it, which useNotifications records the same way. A push that arrives with no omp-web tab open is still not listed, because the history is per tab and in memory.
  • toastHistory.record stores onClick; toast.add passes it through.
  • NotificationRow: an entry with onClick opens on click or tap (not from its buttons, links, expandable text, a drag or a text selection) and on Enter when focused. Only actionable rows are focusable and show a pointer.

Verification

  • New tests: public/sw.js reports a shown push to every open window (run against a fake worker scope); the page records a reported push and ignores malformed messages; an OS-shown notification is listed with the right kind and opens its session; a row runs its action on click and Enter but not from the dismiss button, the expandable text or a released selection; a row without an action is inert. Reverting either production change fails a test.
  • npm test 1304/1304; typecheck and eslint clean.

@andrebrait

Copy link
Copy Markdown
Collaborator Author

Bot review companion: andrebrait#92 (identical diff).

@andrebrait
andrebrait force-pushed the fix/notification-history-open branch from b982685 to f45b7d9 Compare October 10, 2026 07:31
andrebrait added a commit to andrebrait/ompweb that referenced this pull request Oct 10, 2026
…en their session from the Notifications tab

Squashed from origin/fix/notification-history-open (f45b7d9) onto upstream/main.
andrebrait added a commit to andrebrait/ompweb that referenced this pull request Oct 10, 2026
…en their session from the Notifications tab

Squashed from origin/fix/notification-history-open (f45b7d9) onto upstream/main.
andrebrait added a commit to andrebrait/ompweb that referenced this pull request Oct 10, 2026
…nly pushable notification types

Squashed from origin/feat/notification-read-state (9edf773) onto upstream/main.

Integration fixup: drops kahme247#242's keepRead (update notices are no longer recorded), keeps kahme247#240/kahme247#242's onClick on history entries, and adapts toast.click.test.mjs to the history: true opt-in.
@andrebrait
andrebrait merged commit fac0864 into kahme247:main Oct 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant