Skip to content

feat(console): make account switching a clear user action - #335

Merged
mohanagy merged 3 commits into
developmentfrom
feat/issue-331-account-switch-copy
Jul 31, 2026
Merged

feat(console): make account switching a clear user action#335
mohanagy merged 3 commits into
developmentfrom
feat/issue-331-account-switch-copy

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace protocol-first account switching with a concrete “Use in this chat” action
  • show client-specific accessible labels, copied payloads, and confirmations
  • distinguish the active chat from the durable default for future MCP sessions
  • centralize both available and unavailable switching guidance, including mixed catalogs
  • add the user-visible change under CHANGELOG Unreleased

Closes #331.

Security impact

Presentation-only Console change. The clipboard payload, miftah_use_profile behavior, client support, redaction, audit, credential handling, containment, and public APIs remain unchanged.

TDD evidence

  • added the focused Console contract first
  • observed the missing shared-guidance failure
  • added mixed-catalog behavior expectations and observed both unavailable-guidance failures
  • implemented the smallest Console copy and hierarchy changes
  • the behavior harness executes the real renderer and event handlers for Claude Desktop, Claude Code, Cursor, and VS Code

Validation

  • npm test — 1,821 passed, 33 platform skips on Node 22.22.3
  • npm run test:core — 426 passed, 26 platform skips
  • npm run test:coverage -- --maxWorkers=1 — complete suite and coverage thresholds passed
  • npm run lint
  • npm run typecheck
  • npm run build
  • npm run smoke:cli
  • npm run check:pack — 48 packaged files verified
  • npm run test:package — 26/26 passed
  • focused Console suite — 49/49 passed
  • changelog contracts — 4/4 passed

The standard parallel coverage invocation encountered an unchanged 1,000 ms upstream startup bound under local coverage instrumentation; each reported test passed in isolation, and the complete coverage run passed without changing timeouts or skipping tests. Current-head CI remains authoritative for the standard Linux, macOS, Windows, quality, and package matrix.

Review

CodeRabbit’s earlier review reported two findings; both are resolved in 0457ded and 9b9f756 with replies and resolved threads. Its latest incremental review was rate-limited. A separate current-head two-axis standards/spec review is being used rather than claiming CodeRabbit approval.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Console now distinguishes durable default accounts from per-chat account switching. It adds client-specific account actions and feedback, centralizes switching guidance, removes obsolete copy, and updates contract tests.

Changes

Account-switching guidance

Layer / File(s) Summary
Shared account guidance
src/console/console-assets.ts
The Console distinguishes durable MCP defaults from current-chat switching and documents the miftah_use_profile action.
Account-switch action feedback
src/console/console-assets.ts
Switch buttons, accessibility labels, copy feedback, refresh messages, and catalog rendering now identify the account and client.
Console contract coverage
tests/console-server.test.ts
Tests validate the revised labels, client-specific switching text, copy confirmation, and single-instance guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #325 — Covers the same account-switching guidance and client-specific copy changes.

Possibly related PRs

Poem

A rabbit taps “Use this account here,”
The client’s name is crisp and clear.
New sessions keep the lasting choice,
Current chats hear a separate voice.
One guide remains; old copy’s gone.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes and tests address all coding objectives in issue #331 while preserving behavior, compatibility, security handling, and public APIs.
Out of Scope Changes check ✅ Passed The modified Console copy and focused tests are directly related to issue #331 and contain no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly describes the primary change: making Console account switching a clear user action.
Description check ✅ Passed The description includes the summary, security impact, TDD evidence, validation results, changelog update, and review context.
✨ 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 feat/issue-331-account-switch-copy

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

@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

🤖 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 1323-1330: Update the shared catalog-switch-guidance handling near
the configuration-card rendering and the Line 1341 visibility logic so
unavailable account switching is rendered once in the shared element rather than
appended by each card. Remove the per-card switching paragraph created in the
configuration loop, and explicitly handle mixed catalogs so the shared guidance
reflects whether any configuration supports switching while preserving available
switch controls.

In `@tests/console-server.test.ts`:
- Around line 2292-2332: Add behavior-level tests in the account-switching
coverage around renderConfigurationCatalog and the clipboard handler, exercising
multiple configurations and supported clients rather than only inspecting
/app.js literals. Assert the rendered shared-guidance count,
client/profile-specific button text and aria-label, the clipboard payload, and
the confirmation message; retain the existing protocol-string checks as
supplemental coverage.
🪄 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: 94870f87-31f2-4aef-8ba7-401ef9fbaa69

📥 Commits

Reviewing files that changed from the base of the PR and between 06d650e and da8a02f.

📒 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
@mohanagy
mohanagy merged commit 887d114 into development Jul 31, 2026
21 of 23 checks passed
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 read like a user action

1 participant