feat: browser-tab notification for a parked approval (goal 0132 slice A) - #361
Merged
Conversation
Adds a generic browser-notification seam (app/useBrowserNotify.ts +
shared/browserNotify.ts) that raises a Notifications-API banner from a
live, server-mode tab when a decision needs action and that tab isn't
focused -- the tap on the shoulder the goal names as its whole value.
The parked-guardrail-approval call in App.tsx is the seam's first
consumer, not the only one it's built for: a future event just calls
it with different copy and a different click target.
Opt-in lives in Settings > Remote access ("Notify me on this device"),
requesting permission on click only, and states its own
default/granted/denied state honestly. Clicking a raised notification
focuses the tab and lands on the Review queue via existing in-app
navigation.
- shouldNotifyBrowserTab is a pure, unit-tested predicate (server mode
AND unfocused AND unseen dedupe key).
- remote-access.spec.ts covers the opt-in control's presence and its
default/granted/denied states, plus the click -> requestPermission ->
granted round trip.
- testing.md's manual-only registry gets the real-OS-banner entry (no
CI surface can raise or click a real system notification).
- userdocs/reference/settings.md documents the control; llms-full.txt
regenerated via go generate ./internal/docsgen.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW5GkkAG8du7tNdYLk2zSd
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.
Summary
app/useBrowserNotify.ts+shared/browserNotify.ts,{dedupeKey, title, body, onClick}) that raises a Notifications-API banner from a live, server-mode tab when something needs action and that tab isn't focused -- gated by a pure, unit-tested predicate (shouldNotifyBrowserTab).App.tsx), reusing the existingpendingApprovalDescriptioncopy and in-appsetView({kind:'review'})navigation on click. A future "run finished"/"agent acted while away" notification is a new call site, not a change to the seam..claude/rules/testing.md's manual-only registry (no CI surface can raise or click a real system notification).userdocs/reference/settings.md, regeneratedllms-full.txtviago generate ./internal/docsgen.Test plan
frontend/src/app/browserNotifyPredicate.test.ts-- 8 cases covering the predicate's full input range (Vitest).frontend/e2e/remote-access.spec.ts-- opt-in control presence, default/granted/denied states, and the click -> requestPermission -> granted transition (Playwright, real mill-server binary).🤖 Generated with Claude Code
https://claude.ai/code/session_01FW5GkkAG8du7tNdYLk2zSd