Skip to content

Surface pending approvals globally#301

Open
fakechris wants to merge 1 commit into
mainfrom
control-center-global-approval-banner
Open

Surface pending approvals globally#301
fakechris wants to merge 1 commit into
mainfrom
control-center-global-approval-banner

Conversation

@fakechris

@fakechris fakechris commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a global pending-approval banner to the Control Center shell
  • route the banner action directly to Approvals while keeping sidebar counts and optimistic decisions aligned
  • extend UI smoke coverage for desktop routing and mobile overflow safety
  • record the UX acceptance evidence in the goal ledger

Verification

  • npm run build:control-center
  • npm run typecheck
  • npm run control-center:smoke -- --allow-missing-browser
  • npm test -- --runInBand
  • npm run build
  • npm run ledger:check
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added a global pending-approval banner visible across workbench pages, displaying pending approval count and relevant mission information with direct access to the approvals review page.
    • Implemented mobile-optimized layout for the approval banner to prevent horizontal overflow on smaller screens.
  • Tests

    • Added smoke test coverage for the new global approval banner, including visibility and navigation verification.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a global pending-approval banner to the control-center workbench that displays on all pages except mission detail. The banner shows the highest-priority pending approval with optional mission context, includes a "Review approvals" button that navigates to the approvals page, and adapts its layout for mobile screens to prevent overflow.

Changes

Global Approval Banner Feature

Layer / File(s) Summary
Approval Banner Component & Data Model
packages/control-center/src/App.tsx
App computes pendingApprovals (approvals without a decision) and uses it for the sidebar count. A new ApprovalBanner component displays the pending count and highest-priority approval's mission/action details, with a button routing to #/approvals.
Mobile Responsive Layout
packages/control-center/src/styles/app.css
Media query for screens ≤640px switches the approval banner to wrap-aligned flex layout, making the text span and action buttons full-width to prevent horizontal overflow.
Feature Acceptance & Documentation
docs/progress/agent-workbench-goal-ledger.md, scripts/control-center-ui-smoke.ts
Ledger checkpoint documents the global banner affordance, role choice, and mobile constraints. Smoke test verifies banner visibility on runtime page, the "Review approvals" navigation, and state synchronization after returning from the approvals view.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A banner hops across each workbench page,
Waving pending approvals with pride—
No mission view blocks its sage,
Just "Review approvals" to guide,
Mobile-friendly, responsive, and lean!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Surface pending approvals globally' directly and concisely summarizes the main change: making pending approvals visible across the entire workbench via a global banner.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch control-center-global-approval-banner

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
scripts/control-center-ui-smoke.ts (1)

153-174: ⚡ Quick win

Consider adding a mobile test for the approval banner.

The PR description claims to extend "mobile overflow safety" coverage, and the stack context shows a media query for screens under 640px width. However, the smoke test verifies the approval banner only on desktop (1100×760 viewport). The existing mobile test section (lines 788-861) focuses on the mission detail page but doesn't verify the runtime page approval banner.

Following the existing mobile test pattern, consider adding a mobile verification:

  1. Create a mobile page with operator scope
  2. Navigate to #/runtime
  3. Wait for the approval banner
  4. Assert viewport fit with assertWithinViewport(mobilePage, ".approval-banner", ...)
  5. Assert no horizontal overflow with assertNoPageHorizontalOverflow(mobilePage, ...)

This would prevent mobile layout regressions and align test coverage with the PR's stated goals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/control-center-ui-smoke.ts` around lines 153 - 174, Add a
mobile-specific check for the approval banner similar to the existing desktop
flow: create a mobilePage with operator scope (like operatorRuntimePage but
using the mobile viewport), navigate it to `#/runtime` (use
operatorRuntimePage.goto equivalent for mobilePage), wait for the approval
banner locator (approvalBanner or mobilePage.locator(".approval-banner")), then
call assertWithinViewport(mobilePage, ".approval-banner", ...) and
assertNoPageHorizontalOverflow(mobilePage, ...) to verify fit and no horizontal
overflow; mirror the same visibility assertions used for approvalBanner on
desktop to ensure the banner content and routing remain correct on mobile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/progress/agent-workbench-goal-ledger.md`:
- Around line 3025-3026: The docs claim the pending-approvals banner is excluded
on mission detail, but App.tsx currently renders it whenever
pendingApprovals.length > 0 without checking the route; fix by either updating
the documentation to state that the banner appears on all pages (including
mission detail) to match the implementation, or change the render logic in
App.tsx to only show the banner when pendingApprovals.length > 0 && state.route
!== "mission" (i.e., add the route check where the banner is rendered).

In `@packages/control-center/src/App.tsx`:
- Line 104: The ApprovalBanner is shown whenever pendingApprovals.length > 0 but
must be hidden on mission detail pages; update the render condition for
ApprovalBanner (the line using pendingApprovals and ApprovalBanner) to also
check the route exclusion used on line 103 (e.g., the same isMissionRoute /
isMissionDetail boolean or a check against location.pathname like
!location.pathname.startsWith('/missions/')), so the condition becomes
pendingApprovals.length > 0 && !isMissionRoute (or equivalent) before rendering
<ApprovalBanner approvals={pendingApprovals} />.

---

Nitpick comments:
In `@scripts/control-center-ui-smoke.ts`:
- Around line 153-174: Add a mobile-specific check for the approval banner
similar to the existing desktop flow: create a mobilePage with operator scope
(like operatorRuntimePage but using the mobile viewport), navigate it to
`#/runtime` (use operatorRuntimePage.goto equivalent for mobilePage), wait for
the approval banner locator (approvalBanner or
mobilePage.locator(".approval-banner")), then call
assertWithinViewport(mobilePage, ".approval-banner", ...) and
assertNoPageHorizontalOverflow(mobilePage, ...) to verify fit and no horizontal
overflow; mirror the same visibility assertions used for approvalBanner on
desktop to ensure the banner content and routing remain correct on mobile.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ced2f30f-0338-4730-b6de-b3886977c05b

📥 Commits

Reviewing files that changed from the base of the PR and between e0ffc73 and 38227f9.

📒 Files selected for processing (4)
  • docs/progress/agent-workbench-goal-ledger.md
  • packages/control-center/src/App.tsx
  • packages/control-center/src/styles/app.css
  • scripts/control-center-ui-smoke.ts

Comment on lines +3025 to +3026
- Pending approvals are now visible in the main shell with mission/action
context and a direct Review approvals action.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Documentation claims banner excludes mission detail, but code does not.

The checkpoint states that pending approvals are "visible in the main shell" and in the Workbench UX section (line 3025) claims the banner appears on "all pages except mission detail." However, the code in App.tsx line 104 renders the banner whenever pendingApprovals.length > 0 without checking state.route !== "mission".

This is an inconsistency between the ledger documentation and the actual implementation.

The code issue is flagged separately in the App.tsx review. If the mission-detail exclusion is intentional, the code needs the fix proposed there. If the banner should appear on all pages including mission detail, this documentation should be updated to reflect that.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/progress/agent-workbench-goal-ledger.md` around lines 3025 - 3026, The
docs claim the pending-approvals banner is excluded on mission detail, but
App.tsx currently renders it whenever pendingApprovals.length > 0 without
checking the route; fix by either updating the documentation to state that the
banner appears on all pages (including mission detail) to match the
implementation, or change the render logic in App.tsx to only show the banner
when pendingApprovals.length > 0 && state.route !== "mission" (i.e., add the
route check where the banner is rendered).

<Sidebar counts={counts} canCreateMission={canCreateMission} onNewMission={openNewMission} />
<div className="main">
{state.route !== "mission" && <PageToolbar />}
{pendingApprovals.length > 0 && <ApprovalBanner approvals={pendingApprovals} />}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Banner appears on mission detail pages, contradicting documented behavior.

The approval banner is rendered whenever pendingApprovals.length > 0, but according to the PR objectives, AI summary, and ledger checkpoint, it should NOT appear on mission detail pages. Line 103 shows the pattern for excluding the mission route, but line 104 does not apply the same check.

🐛 Proposed fix to exclude mission route
-        {pendingApprovals.length > 0 && <ApprovalBanner approvals={pendingApprovals} />}
+        {state.route !== "mission" && pendingApprovals.length > 0 && <ApprovalBanner approvals={pendingApprovals} />}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{pendingApprovals.length > 0 && <ApprovalBanner approvals={pendingApprovals} />}
{state.route !== "mission" && pendingApprovals.length > 0 && <ApprovalBanner approvals={pendingApprovals} />}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/control-center/src/App.tsx` at line 104, The ApprovalBanner is shown
whenever pendingApprovals.length > 0 but must be hidden on mission detail pages;
update the render condition for ApprovalBanner (the line using pendingApprovals
and ApprovalBanner) to also check the route exclusion used on line 103 (e.g.,
the same isMissionRoute / isMissionDetail boolean or a check against
location.pathname like !location.pathname.startsWith('/missions/')), so the
condition becomes pendingApprovals.length > 0 && !isMissionRoute (or equivalent)
before rendering <ApprovalBanner approvals={pendingApprovals} />.

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