Skip to content

🤖 feat: immersive review assisted-mode badge + agent status bar#3432

Open
ammar-agent wants to merge 4 commits into
mainfrom
immersive-review-7f99
Open

🤖 feat: immersive review assisted-mode badge + agent status bar#3432
ammar-agent wants to merge 4 commits into
mainfrom
immersive-review-7f99

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

@ammar-agent ammar-agent commented May 31, 2026

Summary

Two gaps in full-screen Immersive Review are fixed: there's now a clear indicator when the Assisted filter is active, and a top status bar that surfaces the agent's TODO plan (vertical) alongside live chat/streaming status so reviewers waiting on the agent keep their signal without leaving review.

Background

Immersive review renders into an opaque overlay (#review-immersive-root, absolute inset-0 z-50) that covers the normal review panel.

  1. No Assisted-mode indication. The Assisted toggle/badge lives in ReviewControls, which is hidden behind that overlay. Once immersive, the diff could be filtered to agent-flagged hunks with zero on-screen indication. (The existing per-hunk assisted banner only means "this hunk was flagged" — not "the worklist filter is on".)
  2. No chat status. A common workflow is reviewing code while waiting for the agent to respond. In immersive mode the transcript, composer streaming barrier, and pinned TODO list are all hidden, so the user had no view of plan progress or streaming state.

Implementation

Issue 1 — Assisted-mode badge

  • ReviewPanel now threads assistedOnly + assistedCount + assistedUnreadCount into the immersive portal (previously only the per-hunk assistedHunkIds/comments were passed).
  • ImmersiveReviewView renders a header badge (Sparkles + --color-review-accent + unread/total via counter-nums) only while assistedOnly is on. Kept visually/semantically distinct from the per-hunk assisted banner.

Issue 2 — Agent status bar (ImmersiveReviewAgentStatusBar.tsx, mounted between header and the per-hunk banner)

  • Vertical TODO plan via the shared <TodoList>, collapsible with per-workspace persisted expand state (new getImmersiveReviewAgentBarExpandedKey), plus a summary line ("TODO · 2 in progress · 3 pending").
  • Compact streaming chip: Starting… / Streaming… / a prominent "Mux has a question".
  • Flash-free & graceful:
    • Chip is gated on the held phase from useWorkspaceStreamingStatusPhase (150ms), so starting↔streaming handoffs don't blink.
    • Because plans persist across turns, the bar stays mounted between streams and only unmounts once the held phase clears and there are no todos — no mid-review flicker.
    • Data is synchronous from WorkspaceStore (no skeleton needed); subscriptions live in this leaf so todo/stream churn doesn't re-render the large diff tree.
    • Crash-safe: falls back to empty/idle when the workspace isn't registered (renders null in tests/stories rather than throwing).

Banner scoping — the per-hunk assisted comment banner now lives inside the diff column wrapper (not above the whole body), so it spans only the diff width and lines up with the code it refers to instead of stretching across the minimap + notes sidebar.

Validation

  • New behavioral tests: ImmersiveReviewAgentStatusBar.test.tsx (plan render, idle→null, streaming/starting chips, awaiting-question precedence, collapse persistence) and an assisted-badge gating test in ImmersiveReviewView.test.tsx.
  • New Storybook stories for Chromatic coverage: ImmersiveWithAssistedMode (header badge) and ImmersiveWithAgentStatusBar (TODO plan + live streaming chip; seeds the WorkspaceStore so the bar has real state).
  • Snapshot budget: rebased on main (current limit 250); the two new immersive stories fit within budget (249/250), so no budget change or story compression was needed.

Risks

Low. The status bar is an additive, self-subscribed leaf that returns null when there's nothing to show, so it can't reserve review height or cascade re-renders into the diff. The only change to existing render paths is the new header badge (gated on assistedOnly), three new optional props threaded from ReviewPanel, and moving the assisted banner inside the diff column.


Generated with mux • Model: anthropic:claude-opus-4-8 • Thinking: xhigh • Cost: $42.40

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74833a4075

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/common/constants/storage.ts
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed: added getImmersiveReviewAgentBarExpandedKey to EPHEMERAL_WORKSPACE_KEY_FUNCTIONS so the key is deleted on workspace removal (and still not copied on fork), matching the documented intent. Please take another look.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Pushed two follow-ups:

  1. The new review-immersive-agentbar-expanded localStorage key is now in EPHEMERAL_WORKSPACE_KEY_FUNCTIONS so it's cleaned up on workspace removal (still not copied on fork).
  2. Fixed the CI-only unit test failures: the status bar now reads todos + streaming flags from a single getWorkspaceState subscription (matching PinnedTodoList) instead of a separate sidebar hook that other test files globally mock.module. The test now uses installDom + spyOn and asserts collapse persistence behaviorally via remount, and passes under all file-ordering permutations.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed review feedback:

  1. Assisted comment scoped to the diff column. The immersive assisted-review comment banner now renders inside the diff column (a flex-col wrapper around the scroll area) instead of above the whole body, so it spans only the diff width and lines up with the code it refers to — no longer stretching across the minimap and notes sidebar.
  2. TODO status bar is now visible in Storybook. Added the ImmersiveWithAgentStatusBar story, which seeds the WorkspaceStore (registers a workspace + replays a todo_write through the aggregator) so the new top status bar renders a real vertical TODO plan + live "Streaming…" chip. Seeding runs during render before the child subscribes, so it paints populated on the first frame (flash-free for Chromatic).

Note: bumped the storybook snapshot budget 303 → 307 to cover the two new immersive stories. origin/main was already computing 305 against the stale 303 limit, so this also clears that pre-existing overage.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Reverted the snapshot-budget bump (kept MAX_ESTIMATED_SNAPSHOTS=303). Made room for the two new immersive stories by consolidating four redundant AgentListItem single-state stories (Selected/ErrorState/Question/Draft) into the existing FigmaStates matrix story — no unique visual coverage lost. This also clears a pre-existing overage (origin/main was at 305 > 303).

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Surface assisted-filter mode and chat status inside full-screen immersive review.
Read todos + streaming flags from a single getWorkspaceState subscription
(matching PinnedTodoList) instead of a separate useOptionalWorkspaceSidebarState
hook, which other test files globally mock.module and which caused CI-only
failures. Rewrite the test to use installDom + spyOn and assert collapse
persistence behaviorally via remount.
- Move the immersive assisted-review comment banner inside the diff column so
  it spans only the diff width, not across the minimap + notes sidebar.
- Add ImmersiveWithAgentStatusBar story that seeds the WorkspaceStore so the
  top TODO + streaming status bar renders with real state (flash-free).
@ammar-agent ammar-agent force-pushed the immersive-review-7f99 branch from 568061b to df29340 Compare June 1, 2026 20:13
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Rebased onto latest main and dropped the story-compression work entirely. main lowered the snapshot budget to 250 and brought its own count down to 247, so the two new immersive stories now fit within budget (249/250) with no budget bump and no changes to AgentListItem.stories.tsx — both budget.test.ts and AgentListItem.stories.tsx are now identical to main. Only the immersive-review feature changes remain.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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