Make Console setup and account switching actionable - #326
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Console now supports client-specific account-switch requests, structured setup completion, generated client-entry handoff, task navigation, conditional rejected-connection guidance, MCP connection terminology, and stale-session protection. Integration tests cover the revised flows and accessibility behavior. ChangesConsole setup and account handoff
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/console/console-assets.ts`:
- Around line 2114-2117: Ensure setup completion is preserved and rendered even
when dashboard refresh fails. Around the refresh flows in
src/console/console-assets.ts at lines 2114-2117, 2248-2248, and 2297-2297, move
completion assignment and renderSetupCompletion handling into a finally block or
shared helper so native OAuth, preset, and imported client-entry completions are
handed off after refresh errors.
- Around line 2633-2665: Update the setup completion flow around
selectedSetupCompletionClient and the generate-entry click handler to capture
the selection identity before the asynchronous api request, then discard the
response if the selection changed before it resolves. Ensure the
selection-change listener also clears setupCompletionHandoff, preventing stale
generated content or restart guidance from being associated with the new client.
- Around line 1050-1051: Update the setup-success flow around
renderSetupCompletionSwitch(setup) to move focus from the hidden setup form to
the first actionable control in setupCompletionView, and scroll the completion
view into view before or alongside focusing it. Preserve the existing behavior
that unhides setupCompletionView.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bf353c76-e77d-49ef-b57f-fa4aedc19d32
📒 Files selected for processing (2)
src/console/console-assets.tstests/console-server.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/console/console-assets.ts`:
- Around line 1052-1060: Update the completion handoff logic around
replaceSetupCompletion so refresh failures that invoke restoreUnlock do not
unhide or focus the completion view while the unlock screen is active. Preserve
the handoff separately during reauthentication if needed, and render and focus
setupCompletionClientSelect only after a successful session refresh.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a33933d5-5a65-4a4b-bd9b-c8acceecd7f3
📒 Files selected for processing (2)
src/console/console-assets.tstests/console-server.test.ts
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@src/console/console-assets.ts`:
- Around line 2284-2294: Static setup controls remain disabled after
reauthentication changes authenticationEpoch. In
src/console/console-assets.ts#L2284-L2294, reset saveSetupDraft.disabled during
successful reauthentication; in src/console/console-assets.ts#L2315-L2317, apply
the same reset to resumeSetupDraft; and in
src/console/console-assets.ts#L2594-L2596, reset runProfileReadiness.disabled
within renderProfileReadiness(). Use a shared refreshAfterAuthentication reset
if appropriate, while preserving the existing epoch guards.
In `@tests/console-server.test.ts`:
- Line 1309: Align the `authenticationEpoch` setup in the two adjacent test
harnesses: update the harness around the prepended source prologue and the
harness around the sandbox globals to inject this variable using the same style.
Preserve each harness’s existing behavior while ensuring `authenticationEpoch`
is seeded consistently for the guarded cleanup code.
- Around line 582-649: Extract the duplicated fake DOM classes, element
instances, element-ID lookup, and sandbox setup from
recoverSetupCompletionAfterUnlock and
settleStaleConfigurationSelectionAfterReauthentication into one shared factory.
Make the factory accept each harness’s status element and fetch implementation,
return the harness references needed by both tests, and update both harnesses to
use it while preserving their existing behavior.
- Line 546: Bound the wait loop around unlock.hidden with a deadline, checking
elapsed time while waiting for the console script to reveal unlock-view. If the
deadline expires, throw a descriptive error identifying that the unlock view was
not shown, while preserving the existing polling behavior when it becomes
visible.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0fe2aab2-8edb-4032-8dbe-67be4da27b7e
📒 Files selected for processing (2)
src/console/console-assets.tstests/console-server.test.ts
Superseded by later commits through 30b6126. All material findings were fixed with regression coverage; remaining test-style comments were reviewed, answered, and resolved. Current CodeRabbit check was rate-limited, so exact-head independent review and the full cross-platform CI matrix provide the final review evidence.
|
Final exact-head evidence for 30b6126:\n\n- TDD contracts were observed red before implementation for stale reauthentication responses, overlapping setup refreshes, preserved error propagation, and recovery of disabled Console controls.\n- Focused Console contract: 47/47 passed.\n- npm test: 142 files passed, 1 platform file skipped; 1,819 tests passed, 33 skipped.\n- npm run test:core: 22 files passed, 1 platform file skipped; 426 tests passed, 26 skipped.\n- npm run test:coverage: passed; 95.65% statements, 91.93% branches, 98.66% functions, 95.65% lines.\n- npm run lint, npm run typecheck, npm run build, npm run smoke:cli, npm run check:pack, and npm run test:package: passed.\n- Current-head CI: Linux, macOS, and Windows on Node 20/22/24, Linux quality, and Verify all passed.\n- All review threads are resolved. Stale CodeRabbit change requests were dismissed only after their material findings were fixed with regression coverage. The current-head CodeRabbit status is Review rate limited, so this is not represented as a current-head CodeRabbit approval.\n- Independent exact-head review: CLEAN, no remaining material finding.\n\nThis completes issue #325's technical Console contract. External evaluator evidence remains tracked separately in #25, #88, #202, and #290 and is not claimed complete here. |
Closes #325.
What changed
Validation
All commands ran under Node 22.22.3. No timeout, coverage, containment, redaction, audit, public API, or client-mutation behavior was weakened.
Validation boundary
This PR closes the technical Console contracts in #325. External multi-account and returning-user evidence remains open and must not be treated as complete; it is still tracked in #25, #88, #202, and #290.
Summary by CodeRabbit
New Features
Improvements