Repository navigation
fix(app-shell): opening a notification from Home's My-work card marks it read, as the bell does - #27653
Merged
Conversation
… it read Both notification doors (the top-bar bell's popover row and Home's "My work -> Notifications" row) now call one open action, openInboxNotification: mark the row read first, then follow its resolved link, or open the inbox when it has none. Home hands the action the bell's own write (useInboxBell().markRead), so the request it sends is the bell's POST /api/v1/notifications/read. Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
This was referenced Oct 29, 2026
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.
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh
Requested by Bill · project thread
Fixes #27447
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/layout/openInboxNotification.ts(共享的打开动作);HomePage.tsx的onOpenNotification;InboxPopover.tsx的handleNotificationClick。POST /api/v1/notifications/read,回到首页后未读数减一、铃铛角标消失。What changes
openInboxNotification(ui/packages/app-shell/src/layout/openInboxNotification.ts): mark the row read, resolve itsaction_urlwithresolveNotificationTarget, then open the inbox (no link), open a new tab (external link) or go to the console route. What differs per door is passed in: how it leaves the page, what it does before following a link, where "open the inbox" lands.InboxPopover.handleNotificationClick) now calls it withonMarkRead,leaveTo(the unsaved-edits guard),goToAllNotificationsand "close the popover". Behaviour unchanged.HomePageonOpenNotification) now calls it withuseInboxBell().markRead, the bell's own write. Before, it only navigated. The request Home sends is the bell'sPOST /api/v1/notifications/read{ "ids": [notification_id] }, keyed by the notification event id.Measured mechanism (premise holds): the bell's mark-read is
useInboxBell().markRead(AppHeader,global:notifications). Home's card rows come fromuseHomeInbox, which cuts the sameuseSharedInboxFeedbut had no write. Same feed, different hook. Only the bell's hook had the write.Tests
console/home/__tests__/HomePage.openMarksRead.test.tsx(new). It renders the realHomePagewith the realuseHomeInbox,useInboxBelland shared inbox feed, over a fake data adapter and a recordingfetchdouble that writesreadreceipts when the mark-read POST arrives. It clicks the Home card row and asserts:POST /api/v1/notifications/read, body{"ids":["ntf_1"]}),layout/__tests__/openInboxNotification.test.ts(new): the four arms of the action, as an ordered step log.HomePage.*harnesses stubuseInboxBell, because they serve no inbox feed. The bell's own pins (InboxPopover.notificationDeepLink,InboxPopover.linklessFallback,InboxPopover.unsavedEditsLeave-13253) pass unchanged.markRead: markNotificationRead,with a no-op turns all 3 cases of the new Home test red. The request list is[]and the pill stays2. Restored fromHEADand verified by blob equality.Acceptance notes
useInboxBellkeeps its optimistic overlay per surface on purpose ("one surface's optimistic flip must not become another's fact before the server agrees")./home.HomePagenow mountsuseInboxBellnext to the header's. Its own docblock says two mounts are safe: the shared feed is read once, and the arrival announcer's seen set is module-scoped, so nothing is announced twice.useInboxArrivalNotifier'sopenMessage) carry their own copy of the same open logic. That copy already marks read first, so it is not a defect. Moving it ontoopenInboxNotificationwould be a one-line follow-up. Noted, not changed.Verification
All readings below are on head
86c3d08d, afterorigin/mainwas merged in.Targeted tests and typecheck
pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/console/home/ packages/app-shell/src/layout/ packages/app-shell/src/hooks/__tests__/sharedInboxFeed packages/app-shell/src/hooks/__tests__/useHomeInbox packages/app-shell/src/views/__tests__/global-notifications: Test Files 158 passed (158), Tests 1018 passed (1018).pnpm --filter @object-ui/app-shell type-check(src andtsconfig.test.json): exit 0.markRead(viascripts/ablation-replace.mjs):HomePage.openMarksRead.test.tsxfailed 3 of 3, then was restored toHEAD(blob equal,git diff HEADempty).@object-ui/app-shellsuite (1883 files) was started locally but stopped after 61 min. It was holding the shared verification lock. CI's shardedTest UIruns it in full.Derived gates (dispatch-gates --commands, reconciled with --ran: 34 derived, 34 run, 0 not measured)
Every derived family exited 0. That includes
node scripts/check-sdui-manifest.mjsand its--self-test, the changeset gates,pnpm check:type-check-coverage,pnpm check:type-check-debt(re-measured under the lock) andpnpm --dir ui exec vitest run scripts/(169 files passed, 2 skipped).pnpm --dir ui check:new-line-citations: 0 new citations.Generated by Claude Code