Repository navigation
feat(notifications): stack notes by sender, clear by group - #22744
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Sender stacking runs client-side over existing fields, and approvals and critical notes stay out of stacks. The only key the patch renames has its readers updated in the same patch, and rendered evidence of this revision is attached. Notes
[DESIGN-REVIEWED] 6235dd9 Description read[DESCRIPTION-READ] b4a29f95a616c59096c974d81d0b1ca324c4096a06752fcf29c0f2e5eae42caa That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ human override accepted@CrysisDeu overrode this lane for |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: every added control appears in a screenshot, two recordings cover the state changes, and the blind reader read each primary clear correctly. Its one hesitation was "not sure" on the day ⓧ, not a refusal. Notes
[UX-REVIEWED] 6235dd9 Description read[DESCRIPTION-READ] ed3724c60513b0b3899c1dcd6545e254accf1420b3a4b9bf5104b1e2697c3b24 That sha256 names everything this verdict read: the PR description, plus the 13 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ human override acceptedHuman judgment by @CrysisDeu overrides the GPT 6.1 finding for [GPT-OVERRIDE] 6235dd9 This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
ae4caea to
ef56d51
Compare
|
|
|
|
ef56d51 to
b34cd55
Compare
Human judgment recorded@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
b34cd55 to
781731e
Compare
buluoray
left a comment
There was a problem hiding this comment.
Re-reviewed at bfeaa5d.
Thanks, my blocker is fixed: stackKeyOf now returns null for a critical note without a group_key (notificationStacks.ts:29), with both tests (never stacks a critical note that carries no group_key, keeps a critical note out of its sender stack...). The eslint native-dialog allowlist entry is gone, and the focus, label-in-name, clear-all label, day-clear wording, clearFailed race and blur follow-ups are all addressed.
Still requesting changes, for the upheld GPT 6.1 BLOCK on this head (no reply yet): day clear still deletes an approval that was read but not decided. isPendingApproval (notificationStacks.ts:7-8) treats an approval as pending only while !n.acked, and opening a note acks it. So: open a pending approval, go back, clear its day, and the approval row and its Approve/Reject controls disappear while the request is still waiting. Read is not resolved. Please exclude kind === 'approval' rows from day clearing regardless of acked (or key on the approval's own resolved state), with a test that acks an approval and then clears its day.
Also on this head, each needs a fix or a reply:
- Opus 5.5 BLOCK (
NotificationFeed.tsx:283): with real network timing eachdeleteNotificationlands in its own commit, so the refocus target is dropped on the firstitemschange while the clicked Clear is still mounted, and focus still falls to<body>. The test atNotificationFeed.senderStacks.test.tsx:233passes because its mocked deletes resolve in one flush. - GPT 6.1 second finding (not upheld, worth a look): the "Ask the agent" hand-off from a failed clear inside the mobile bell sheet navigates to
/chatwithout closing the sheet. - UX BLOCK: shot-04 still shows the armed day capsule as plain "Clear"; reshoot it with the new "Clear Today" text.
The bell feed grouped rows by date only and stacked them only when a producer set group_key, which cron, subagent and most agent notes never do, so repeats piled up as near-identical rows. Clear-all sat in a separate header card behind a native confirm(), away from the rows it cleared. Notes now stack by sender the way macOS Notification Center stacks by app: the producer's group_key, else the crewmate, the cron job, or the channel and session. Approvals without a group_key stay unstacked. An expanded stack gets a header row (sender, Show less, its own clear), each date header gets a clear for that day, and closing a collapsed deck clears the whole deck. Every clear is a two-press control that disarms on pointer-leave, blur or Escape, replacing confirm(). The header controls share one 26px height. Refs #22585
bfeaa5d to
6235dd9
Compare
|
|
|
|
|
@buluoray thanks again. All four points from your re-review are in 6235dd9 (rebased on current main, which now carries #22951):
Also: the inbox toolbar clear-all is now the trash glyph with "Clear all", matching the bell (your earlier UX note). |
Human judgment recorded@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
buluoray
left a comment
There was a problem hiding this comment.
Re-reviewed at 6235dd9 (rebased; I compared this PR's own diff against bfeaa5d). Approve.
Both items from my last review are fixed:
- Approvals no longer leave with a day clear, read or not.
keepsOutOfDayClear(notificationStacks.ts:7-9) keys onkind === 'approval'alone, so reading one does not make it clearable. The new tests cover an unread and a read approval surviving a day clear, and a day holding only read approvals offering no clear at all. - The refocus target now survives deletions that commit one at a time: it holds the set of cleared notes and the control that had focus, and is only resolved once every cleared note has left
itemsor the clear settles (a tick re-runs the effect if the last delete committed first). Focus the user moved elsewhere is left alone, and a partial failure leaves focus on the surviving Clear.a day clear whose deletions commit one at a time still hands focus to the next rowdrives exactly the Opus case with deferred deletes, anda failed day clear leaves focus on the clear it pressedpins the failure side.
Checked locally on this head: NotificationFeed senderStacks, phase3, phase4 and NotificationCard.shared pass (84), and tsc -p tsconfig.app.json is clean. CI on this head has no failures so far.
Still for you, not blocking from me: the UX lane asked for shot-04 to be reshot with the "Clear Today" armed text, and the GPT note on the mobile sheet staying open after "Ask the agent".
Human judgment recorded@CrysisDeu marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Goal: Notifications group together by who sent them, and every "clear" sits right next to the notes it clears.
User feedback (#22585): "we need some work to group the notifications together better, and make the clear all more connected."
Today the bell feed groups rows by date only. Rows stack only when the producer sets
group_key. Cron, subagent and most agent notes never set it, so one cron job firing four times shows four near-identical rows. Clear-all is a small trash icon in a separate header card (a red "Clear" button on the inbox page) behind a nativeconfirm(), far from the rows it removes.Why it matters
The bell is the inbox for everything the crew does unattended. When repeats pile up, the one note that needs a person (an approval, a red build) gets buried. When clear-all is a disconnected trash icon behind a modal, there is no way to clear one sender's or one day's notes, so people either scroll past the noise or wipe everything.
Not a goal
What changed (motivation → approach → change)
Goal: mimic macOS Notification Center, which stacks by app and puts the clear control on the stack and on each section.
notificationStacks.stackKeyOfpicks the key: the producer'sgroup_keywhen set, else the crewmate (member), the cron job (job_id), or thechannelnarrowed bysession_key. An approval or a critical note without agroup_keynever stacks: an approval is its own decision, and a deck shows only its head's priority, so a critical failure followed by an ok note from the same sender would hide under it. Deep-link reveal uses the same key.stackLabelOf: crewmate, else non-system app source, else kind label such as "Cron Job"), Show less, and the stack's own clear. The clear shows the word Clear at rest and Clear this group once armed, so it never reads as "hide" or as the inbox-wide clear-all. Show less moved off the head card into this row. In the inbox page variant the "N more" pill shows only on a collapsed stack.confirm().NotificationClearButton: the first press turns the control into a confirm capsule, the second press clears, and pointer-leave, blur or Escape disarm it. Armed, its visible text is its accessible name; after a clear, focus moves to the next remaining row instead of<body>, waiting until every note in the clear has left the list (each delete commits on its own). It is one element whose size animates between states (Framer Motionlayout; reduced motion drops the motion, not the continuity). It forwards its ref to the<button>, so theuiLocationspreads on both clear-all sites register with the guide. This also removes the nativeconfirm()on this surface (see Native confirm dialog (delete session / clear notifications) kills keyboard input in the whole window until the window is re-activated #15976).ErrorNotice("Some notifications could not be cleared. Try again.") with the agent hand-off, the failed rows stay, and the next successful clear removes the notice unless another clear failed while it was running.NOTIF_CONTROL_HEIGHT.en-XAregenerated.docs/system-specs/modules/app-notifications.md.Backwards compatibility
Compatible: no API, payload, config or persisted-state change; producers that set
group_keystack exactly as before.Removes nothing: clear-all is still reachable in both places and still asks for confirmation (a second press instead of a native dialog); Show less moved from the head card to the header row; every existing control still exists.
Tests
website/src/test/NotificationFeed.senderStacks.test.tsx(new):stackKeyOfprecedence, approvals and critical notes (withoutgroup_key) never stack, shape-checked persisted fields; a critical cron failure stays visible beside a later ok run.window.confirm.NotificationClearButtonforwards its ref to the<button>, and both clear-all call sites register their UI location.website/src/test/NotificationCard.shared.test.tsx: its framer-motion stub now also providesmotion.span(used by the clear control).website/src/uiLocations/uiIndex.test.ts:NotificationClearButtonjoinsFORWARDING_PROVEN, pointing at the senderStacks tests that prove it forwards the marker's ref to its<button>.website/src/uiLocations/shell-notifications.locations.test.ts,website/src/guide/GuideLayer.uiFind.test.tsxandtest/test_find_ui_shell.py: the bell clear-all label is "Clear all notifications" (no question mark) and the page clear-all label is "Clear all".Determinism proof (the four added/changed vitest files, 87 tests):
Manual verification
Ran the worktree build in an isolated pod (
kirocrew pod up --seed minimal) and drove the real bell sheet and inbox page with Playwright, notes served in the browser. Asserted and recorded: stacks by sender with the approval alone; a deck's ⓧ deletes only its newest note and the deck shrinks to 2; day clear arms then clears; bell clear-all shows a trash glyph, arms, cancels on pointer-leave, then clears; expanded header shows sender + Show less + "Clear", arms to "Clear this group", and removes all 4 notes; inbox toolbar trash "Clear all" arms and clears; a failed day clear shows the shared notice and keeps the rows; a critical cron failure stays visible beside a later ok run. Measured in the browser: every header control is 26px tall.Screenshots / video
Bell sheet and inbox page, dark theme, desktop.
Day clear (hover, armed, failed), critical note, bell clear-all and inbox toolbar
Full flow (stacks, expand, deck head dismiss, day clear, clear-all with cancel):
notif-grouping-demo.mp4
Stack header row (expand, arm, cancel, fold, clear the stack):
stack-header-demo.mp4
Related Issues
Closes #22585
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.