Skip to content

Inbox in the web app: pages, nav, quick view (slice C) - #2779

Merged
simple-agent-manager[bot] merged 15 commits into
mainfrom
sam/implement-slice-c-inbox-7tfsbq
Nov 16, 2026
Merged

simple-agent-manager[bot] merged 15 commits into
mainfrom
sam/implement-slice-c-inbox-7tfsbq

Conversation

@simple-agent-manager

@simple-agent-manager simple-agent-manager Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Inbox slice C (spec idea 01M7G03ZCQ6TM6CMEYDRKQ8ST9 §4.1/§6; SAM task 01M7H9HB8DFJVS28HK0F7TFSBQ). The Inbox in the web app, built on the slice A routes (PR #2776) with no contract change.

  • Pages /inbox (all projects) and /projects/:id/inbox (lazy, full-bleed). Phone: list, then the item full screen with previous/next and Back. Desktop: list beside the open item (first item shown by default, without taking focus). URL state ?filter=&item=&project=.
  • Rows, chips, stacks: one chip row (Needs you, Blocking, Tasks, Reviews, Updates; Archived behind ⋯), toggle-button semantics, active chip scrolls into view; rows with kind icon, one sentence, project · chat · age · agent state ("paused on this" amber); stacks per chat with "N from ". Updates lists the existing FYI notifications (types that are not inbox items, NOTIFICATION_INBOX_ROLE), paged.
  • Item view: kind + agent state, title, reason, the permission's command, link chips (external links show their host), collapsed Context (messages before · things done since), pinned answer controls; Archive and Open chat in the top bar.
  • One implementation, two layouts: PermissionOptions (split out of AcpPermissionCard; pinned layout puts once-options first), ApprovalDecisionButtons (split out of ApprovalItem), AttentionAnswerControls (injectable submit, "Type a different answer" beside options, radio list + pinned Send above five options; the chat HumanInputCard gets this too), shared useSecretRequest and SecretRequestForm.
  • Walk: answer → one-line receipt → next item (last of a stack → next stack; last overall → empty state); inside a stack one counter ("2 of 3 from …"); stale items (409/404 or no longer open) close themselves; a failed answer keeps the item with the error; focus moves to the new item's title, and back to the row on Back.
  • Archive: hides the item and shows "Archived · Undo" for VITE_INBOX_ARCHIVE_UNDO_MS (default 5 s) before sending; a pending archive is sent on the next archive, on unmount (navigation), on visibilitychange hidden and on pagehide, with fetch keepalive.
  • Nav: Inbox in the global nav (after Home) and the project nav (after Chat, replacing Notifications), desktop and phone drawer, each with its count; command palette entries. The inbox icon takes the bell's slot: desktop quick view (lazy-loaded) with one-tap answers only for Allow/Deny once, ≤3 short options and "Looks good"; phone opens the page.
  • Freshness: counts and lists fetch on load, refetch on window focus, and refresh when the notification socket reports something (useNotificationSocket, mounted once in AppShell: asks refresh the inbox, every event refreshes the Updates lists, bursts coalesced, reconnect catches up). No interval polling.
  • Removed: NotificationCenter (bell panel), NotificationQuestionDialog + loader, NotificationItem, attention-request, ProjectNotifications (now redirects to inbox?filter=updates), the old useNotifications hook surface and its dead API helpers. Push notifications, notification preferences and Settings → Notifications are unchanged.
  • Slice E error items: `answerSpec {type: 'actions'}` is read at runtime and rendered as pinned action buttons (first primary; Open chat navigates; retry/wake/resume POST `{action}`), so either merge order works. Malformed inbox rows are skipped and logged, never fatal (rule 50).
  • Docs: new Inbox guide, notifications/chat-features/collaboration/session-troubleshooting/recent-changes updated, inbox docs screenshots replace the old bell images.

Validation

  • pnpm lint (web lint clean; pnpm check:fast re-run after fixes)
  • pnpm typecheck
  • pnpm test — apps/web: 410 files, 5234 tests passed
  • Additional validation run: Playwright inbox-audit.spec.ts 31/31 with blocking clipped-overflow assertions; docs-screenshots-inbox.spec.ts 3/3
  • N/A: no sweep/cron/alarm candidate selection changes

Behavioural tests (real components, network mocked at fetch): tests/unit/pages/inbox-page.test.tsx (answer question/permission/secret/approval/review/free text; failed answer keeps item; stale 409 on open, 409 on answer, closed status; last of stack → next stack; last overall → empty (desktop + phone); refetch keeps item and rows mounted; archive Undo sends nothing; archive sent after the window, on unmount (keepalive), on pagehide; failed archive restores; prev/next/Back; chips; Archived view; focus refetch with app defaults and no refetchInterval; focus moves), inbox-quick-view-and-nav.test.tsx (safe one-tap only, permission once-options only, phone link, nav counts global/project, Notifications gone), nav-toggle.test.tsx (phone drawer count), useNotificationSocket.test.tsx, inbox-updates.test.tsx (collaboration types, asks excluded, malformed rows, load more), attention-answer-controls.test.tsx, inbox-model.test.ts. Rule 82: typed-card-cross-harness.test.ts, HumanInputCard, SecretRequestCard, ApprovalCard, acp-permission-card tests pass. Error actions and malformed rows: inbox-page.test.tsx ("error items and malformed rows"). Guards proven discriminating: removing the unmount flush, the stale check and refetchOnWindowFocus each turns its test red.

Staging Verification (REQUIRED for all code changes — merge-blocking)

  • Staging deployment green — Deploy Staging run 43840461398 (primary staging, sammy.party; lease, validate, deploy, smoke tests all green) on head f772427 (this branch merged with main incl. feat: run deployment builds in Cloudflare Containers (phase 3) #2721 and F1)
  • Live app verified via Playwright — signed in to https://app.sammy.party (the stored SAM_PLAYWRIGHT_* tokens returned 401 on primary staging, so I used the documented workload-identity sign-in as the staging smoke user)
  • Existing workflows confirmed working — dashboard, project chat, project inbox, the old /projects/:id/notifications URL (redirects to inbox?filter=updates) and Settings → Notifications load at 1280 and 375 with 0 console errors
  • New feature/fix verified on staging — see evidence below
  • Infrastructure verification completed — N/A: no infra changes
  • Mobile and desktop verification notes added for UI changes

Staging Verification Evidence

Real Claude Code agent (conversation task 01M7HV9TEM6BMBGRSARYBJPA2K, Artifacts project 01M4VDZZNPV0GV3S4Z6ZQD3YZ2) told to call request_human_input (options Red/Blue) and request_secret (INBOX_SMOKE_SECRET), then end its turn.

  1. GET /api/inbox listed both items for the smoke user (question attention:… with options, secret secret:…), count needsYou included both.
  2. Phone (iPhone SE 375×667): /inbox list → opened the question → tapped Red → POST …/answer 200 → receipt "Sent “Red”" and the walk moved straight to the secret item.
    • phone-question
    • phone-after-answer
  3. Desktop (1280×800): inbox icon → quick view listed the secret (no one-tap offered for secrets); opened the secret (secure form loaded) → Archive → receipt "Archived · the agent will be told · Undo" → after the Undo window POST …/archive 200 {outcome: "declined", agentNotified: true}; no horizontal overflow, 0 console errors.
    • desktop-quick-view
    • desktop-archive-undo
  4. Agent received both outcomes: its chat shows the answer "Red", the notice "Secret request … for INBOX_SMOKE_SECRET was declined", and its reply "I was told "Red" for the colour question, and that the INBOX_SMOKE_SECRET request was declined … so I have no secret value."
    • agent-chat
  5. Cleanup: chat stopped (workspace deleted), auto-provisioned node 01M7HVX67XCDNRZTYP2C1CG5M9 deleted, no nodes left; lease released (run 43845602610).

Observation (not this slice): right after the phone answer, a fresh desktop load still listed the just-answered question for a moment (slice A's session_summaries.attention_json index catching up); slice G moves questions to asks rows, which removes that lag.

UI Compliance Checklist (Required for UI changes)

  • Mobile-first layout verified
  • Accessibility checks completed (focus management, button-group filters, live-region receipts, screen-reader kind labels, 44px targets on phones)
  • Shared UI components used or exception documented (Pane, IconButton, Button, NavItem/Count, useClickOutside/useEscapeKey; the icon popover keeps its two-ref outside-click handler, commented)
  • Playwright visual audit run locally at 375x667 and 1280x800, no horizontal or clipped overflow
  • Desktop and mobile screenshots for every changed UI surface are posted in a PR comment and linked below
  • Agent/human reviewed the posted screenshots for quality control and fixed every issue found

UI Screenshot Evidence

Surface: Inbox page — list (all projects and project scope)

Surface: Inbox item view with pinned answer controls (every kind)

Surface: Receipts, archive Undo and Updates

Surface: Inbox icon (bell slot), quick view, nav items and ⋯ menu

End-to-End Verification (Required for multi-component changes)

  • Data flow traced from user input to final outcome with code path citations
  • Capability test exercises the complete happy path across system boundaries (page → request() → mocked fetch at the HTTP edge; live path on staging below)
  • All spec/doc assumptions about existing behavior verified against code
  • Gaps documented below

Data Flow Trace

  1. Agent request_human_input / request_secret → slice A list (packages/operations/src/inbox-list-core.ts) → GET /api/inbox (apps/api/src/routes/inbox.ts) → listInbox (apps/web/src/lib/api/inbox.ts) → useInboxList (components/inbox/useInbox.ts) → useInboxWalk → InboxRow / ItemPane (pages/inbox/InboxPage.tsx).
  2. Answer: InboxAnswerControls → useInboxSend / AttentionAnswerControls.submit → POST …/inbox/items/:ref/answer → answerInboxItem (packages/operations/src/inbox-write-core.ts) → the item's own store and agent notice → onAnswered → receipt + advancePast + inbox invalidation. Secrets: SecretRequestForm → fulfillSecretRequest (same record).
  3. Archive: archiveItem → usePendingArchive.schedule → (Undo window) → archiveInboxItem (keepalive) → POST …/archive → per-store archive (agent told).
  4. Freshness: notification WS → useNotificationSocket → invalidate ['auth', scope, 'inbox', 'list'|'count'] and notification lists; focus → refetchOnWindowFocus.

Untested Gaps

Real ACP permission delivery and the agent receiving answer/archive outcomes are exercised on staging (below), not in unit tests. Human-task and error items are read-only until slices H/E.

Post-Mortem (Required for bug fix PRs)

N/A: not a bug fix

Specialist Review Evidence (Required for agent-authored PRs)

  • All local reviewers completed and findings addressed before merge
  • If any reviewer did NOT complete: needs-human-review label added and merge deferred to human (N/A: all completed)
Reviewer Status Outcome
ui-ux-specialist ADDRESSED 2 HIGH (⋯ menu hidden behind the item pane; no focus management) and 9 MEDIUM fixed in a30fc3d (permission order, 44px chips, button-group filters, radio scroll cue, list Retry, sticky error receipts, live region, amber chip counts, screen-reader kind labels) plus LOW (trailing dots, duplicate Open chat, per-filter empty copy). Deferred LOW: stack row fill, chip-row edge fade, quick-view command preview, right-edge popover anchoring.
performance-reviewer ADDRESSED Quick view lazy-loaded out of the main chunk; socket invalidation narrowed to asks, coalesced, reconnect catch-up; socket-only hook; memoised rows; hidden-aware clock (0e89d4f). Permission detail stays outside TanStack Query on purpose (secure detail never cached, acp-interactions.ts).
architecture-reviewer ADDRESSED Dead notification hook surface and API helpers removed; shared useSecretRequest/useInboxSend; formatMsSpan; route builder; stale bell wording (0e89d4f).
security-auditor ADDRESSED MEDIUM: external link chips show their host and reject credentials; LOW: dot ids refused, in-app-only actionUrl (0e89d4f). Deferred LOW: archive flush on sign-out (server authorisation prevents any cross-user effect).
task-completion-validator ADDRESSED WARN → audit green with blocking clipped-overflow check; Archived view fix; tests for focus refetch/no polling, prev/next/back, chips/menu, list survives refetch, closed status, malformed rows; Updates paging; dead mock removed (0ec099f).

CodeRabbit Review Evidence (Required for agent-authored PRs)

  • CodeRabbit requested when the PR was marked ready for review
  • Waited about 15 minutes (or until a skip, rate-limit or quota reply)
  • Either CodeRabbit reviewed and no CodeRabbit feedback is unresolved, or it did not review and the observed outcome is recorded below

CodeRabbit Notes

Marked ready and labelled coderabbit-review at 05:21Z; the trusted workflow posted the command at 05:22Z and CodeRabbit replied "Review rate limited" at 05:22Z (its earlier status: "Review skipped: auto reviews are disabled"). The wait ended on that reply; no review arrived.

Exceptions (If any)

  • Scope: none
  • Rationale:
  • Expiration:

Agent Preflight (Required)

  • Preflight completed before code changes

Classification

  • external-api-change
  • cross-component-change
  • business-logic-change
  • public-surface-change
  • docs-sync-change
  • security-sensitive-change
  • ui-change
  • infra-change

External References

N/A: no external API; built against the slice A contract (packages/shared/src/types/inbox.ts, apps/api/src/routes/inbox.ts, packages/operations/src/inbox-write-core.ts) and the accepted prototype (Library /design/project-overview-inbox-2026-11-15/, branch sam/extend-existing-throwaway-inbox-0qxqpt, reference only).

Codebase Impact Analysis

apps/web only (pages/inbox, components/inbox, NavSidebar, AppShell, MobileNavDrawer, shell bars, command palette, chat cards: AcpPermissionCard, ApprovalItem, AttentionAnswerControls, HumanInputCard, SecretRequestCard; hooks useNotificationSocket/useMinuteClock; lib/api/inbox, query-options/inbox). One comment edit in apps/api/src/services/notification.ts. Docs in apps/www.

Documentation & Specs

apps/www/src/content/docs/docs/guides/inbox.md (new), notifications.md, chat-features.md, collaboration.md, session-troubleshooting.md, recent-product-changes.md, reference/api.md, astro.config.ts sidebar; docs images regenerated.

Constitution & Risk Check

Principle XI: undo window, receipt time and socket debounce are DEFAULT_* constants with VITE_* overrides; no hardcoded URLs (route builders, API_URL). Risks: notification bell removal (replaced by the inbox icon and Updates); the chat question card also gains the radio list / free-text option (intended, one implementation); F1 (#2775) will need a trivial rebase in PROJECT_NAV_ITEMS and isFullBleedRoute.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

raphaeltm and others added 9 commits November 16, 2026 05:20
…lice C)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l audit; layout fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cs screenshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Socket-only useNotificationSocket: narrow (asks only refresh the inbox), coalesced, reconnect catch-up; dead notification hook surface and API helpers removed
- Quick view lazy-loaded; shared inbox-actions (useInboxSend, stale check, permission detail)
- Shared useSecretRequest for the chat card and the inbox
- External link chips show their host and reject credentials; dot ids refused; in-app actionUrl only
- formatMsSpan for ages and deadlines; project agent-context route builder; hidden-aware minute clock
- Stale bell wording in the chat question card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ore; hidden-tab archive flush; more inbox tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion labels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager
simple-agent-manager Bot force-pushed the sam/implement-slice-c-inbox-7tfsbq branch from 4a00548 to 2c63222 Compare November 16, 2026 05:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager
simple-agent-manager Bot marked this pull request as ready for review November 16, 2026 05:21
@simple-agent-manager simple-agent-manager Bot added the coderabbit-review Trigger CodeRabbit review for opt-in PRs label Nov 16, 2026
@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…ssion order, 44px chips, button-group filters, receipts live region, list retry, per-filter empty states

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Playwright visual audit: Inbox (375×667 and 1280×800, dark)

Spec: apps/web/tests/playwright/inbox-audit.spec.ts (31 passing). Every scene asserts no document overflow and no clipped overflow inside overflow-x-hidden containers (blocking assertNoClippedOverflow), and that the pinned controls sit at the pane's bottom edge with no scroll in the shell's <main>. Stress data: 40 items across 4 projects, a three-line title with an unbroken URL, a 600-character unbroken body, a 12-step task, a 10-option question, an expiring permission, every item kind, the empty inbox and a failing list read. I opened every image below; issues found in review rounds (stray dots on wrapped meta lines, a two-line archive receipt, the radio-list Send/Type row wrapping, the permission command placed after Context, the ⋯ menu hidden behind the item pane, option order putting "Always allow" beside "Allow once", 36px chips on phones) were fixed and re-captured.

Inbox list (40 items across 4 projects, a stack, a three-line title)

Question in a stack (pinned options + Type a different answer)

10-option question (radio list + pinned Send)

Expiring permission (command in the body, buttons pinned; once-options first)

Secret

Irreversible approval

12-step task (read-only) and review (Looks good / Reply)

Three-line title with a long URL and a 600-character unbroken body

After answering: receipt, then the next item in the stack (2 of 3 → 1 of 2)

Archive receipt with Undo

Updates chip (active chip scrolled into view at 375px)

Empty inbox

List error with Retry

Project inbox

Quick view behind the inbox icon (one tap only where safe)

⋯ menu with Archived, painted over the panes

Nav: project Inbox item with its count; inbox icon in the bell's slot

raphaeltm and others added 2 commits November 16, 2026 05:33
…ne list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…are skipped, not fatal; audits open the inbox icon

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Error items with slice E actions (added in 5772236)

Kind error with answerSpec {type: 'actions'}: red icon, "Never started", Retry (primary) and Open chat pinned. Reviewed for layout, overflow and clipping at both sizes; no issues found.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions
github-actions Bot requested a deployment to staging November 16, 2026 10:05 Abandoned
@simple-agent-manager
simple-agent-manager Bot merged commit 5129d0f into main Nov 16, 2026
46 checks passed
@simple-agent-manager
simple-agent-manager Bot deleted the sam/implement-slice-c-inbox-7tfsbq branch November 16, 2026 10:10

This branch had an error being deployed

1 abandoned deployment
staging — f772427b Deployed Nov 16, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit-review Trigger CodeRabbit review for opt-in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant