Skip to content

Make Console setup and account switching actionable - #326

Merged
mohanagy merged 12 commits into
developmentfrom
feat/issue-325-console-actionable-success
Jul 31, 2026
Merged

Make Console setup and account switching actionable#326
mohanagy merged 12 commits into
developmentfrom
feat/issue-325-console-actionable-success

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Closes #325.

What changed

  • turns each named account in the connection catalog into a client-specific Copy switch request action while keeping the durable-default distinction explicit
  • replaces file-centric catalog wording with connection counts and shows rejected-file guidance only when attention is required
  • adds accessible task navigation for overview, accounts, authentication, client setup, and audit
  • makes the returning-user setup wizard lead with preset or connection type choices and moves authentication theory behind a collapsed reference after the task forms
  • adds a four-step completion handoff: connection created, exact client entry and target, truthful readiness, then second-account and switching guidance
  • reuses the existing client-snippet and readiness contracts; Console still never edits client settings or claims a generated entry proves credentials

Validation

  • npm test (142 files passed, 1815 tests passed, 33 skipped)
  • npm run test:core (22 files passed, 426 tests passed, 26 skipped)
  • npm run test:coverage (95.67% statements, 91.92% branches)
  • npm run lint
  • npm run typecheck
  • npm run build
  • npm run smoke:cli
  • npm run check:pack
  • npm run test:package

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

    • Added clearer setup completion guidance with connection and account details, verification status, next steps, and client handoff controls.
    • Added client-specific account-switch requests that can be generated and copied without changing the active session.
    • Added workspace task navigation, connection catalog attention guidance, and richer setup information.
  • Improvements

    • Improved dashboard responsiveness, accessibility, and setup flow reliability.
    • Improved recovery from expired sessions and prevented outdated setup responses from overwriting current selections.
    • Updated terminology from configuration files to MCP connections.
    • Removed the obsolete native OAuth setup shortcut.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 71c699db-90ae-4e5d-ad31-22962215c61f

📥 Commits

Reviewing files that changed from the base of the PR and between cde55b8 and 30b6126.

📒 Files selected for processing (2)
  • src/console/console-assets.ts
  • tests/console-server.test.ts
📝 Walkthrough

Walkthrough

The 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.

Changes

Console setup and account handoff

Layer / File(s) Summary
Workspace navigation and setup form
src/console/console-assets.ts, tests/console-server.test.ts
The management view provides anchored tasks, revised connection terminology, grouped presets, responsive styling, and no native OAuth shortcut.
MCP catalog and account switching
src/console/console-assets.ts, tests/console-server.test.ts
The catalog supports client selection, conditional rejected-connection guidance, and copyable client-specific account-switch requests.
Setup completion and client handoff
src/console/console-assets.ts, tests/console-server.test.ts
Completion displays setup metadata, readiness and verification states, next actions, second-account guidance, account switching, and generated client entries.
Session safety and integration coverage
src/console/console-assets.ts, tests/console-server.test.ts
Authentication epochs, recovery generations, refresh ordering, and stale-response guards protect session state. Tests cover these behaviors, accessibility, and updated wording.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Poem

A rabbit copies a switch with care,
Then guides client setup everywhere.
Four completion stages mark the way,
While MCP connections guide the day.
Fresh tasks and safe handoffs align,
And stale replies fall behind.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error 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
Title check ✅ Passed The title clearly summarizes the primary Console setup and account-switching changes.
Description check ✅ Passed The description covers scope, security boundaries, validation commands, and the external validation boundary with sufficient detail.
Linked Issues check ✅ Passed The changes implement actionable switching, connection guidance, task navigation, setup ordering, and completion handoff required by [#325].
Out of Scope Changes check ✅ Passed The source and test changes remain focused on the Console setup, account-switching, accessibility, and completion objectives in [#325].
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-325-console-actionable-success

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

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 31, 2026

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 11397fc and 9be688b.

📒 Files selected for processing (2)
  • src/console/console-assets.ts
  • tests/console-server.test.ts

Comment thread src/console/console-assets.ts Outdated
Comment thread src/console/console-assets.ts
Comment thread src/console/console-assets.ts
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 31, 2026

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9be688b and 025ce2d.

📒 Files selected for processing (2)
  • src/console/console-assets.ts
  • tests/console-server.test.ts

Comment thread src/console/console-assets.ts
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 31, 2026

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 025ce2d and cde55b8.

📒 Files selected for processing (2)
  • src/console/console-assets.ts
  • tests/console-server.test.ts

Comment thread src/console/console-assets.ts
Comment thread tests/console-server.test.ts Outdated
Comment thread tests/console-server.test.ts
Comment thread tests/console-server.test.ts
@mohanagy
mohanagy dismissed stale reviews from coderabbitai[bot], coderabbitai[bot], and coderabbitai[bot] July 31, 2026 17:32

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.

@mohanagy

Copy link
Copy Markdown
Owner Author

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.

@mohanagy
mohanagy merged commit a1d04c0 into development Jul 31, 2026
12 checks passed
@mohanagy
mohanagy deleted the feat/issue-325-console-actionable-success branch July 31, 2026 17:35
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.

[Console] Make account switching and setup completion actionable

1 participant