Skip to content

Connection cards: a plain line for clients that cannot draw them, and an app-and-state sidebar preview - #2385

Merged
milind-soni merged 1 commit into
mainfrom
fix/connector-card-text
Oct 6, 2026
Merged

milind-soni merged 1 commit into
mainfrom
fix/connector-card-text

Conversation

@milind-soni

@milind-soni milind-soni commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • server/connector-card-text.ts (new): connectorCardText(label, alias?) builds the plain line a connection card carries, e.g. "Connect GitHub to continue." or "Connect Gmail as “work” to continue.". It collapses stray whitespace, falls back to "this app" for an empty name, and never includes a link.
  • server/index.ts: each kind: "connector" message the server appends now also sets text from connectorCardText(toolkit.label, item.alias).
  • src/lib/sidebar-layout.ts: new sidebarConnectorPreview, which previews a card as " · " (Connected / Waiting for sign-in… / Connect securely, using the existing connectors.card.* strings), or just the app name once dismissed.
  • src/components/Sidebar.tsx: the bot and group previews use sidebarConnectorPreview for connector messages.
  • Tests: server/connector-card-text.test.ts (new), one new case in src/lib/sidebar-layout.test.ts, and assertions on the stored card's text added to two existing cases in server/index.test.ts.

Why

Older clients decode a message kind they don't know by its text. A connection card had no text, so those clients showed nothing while the bot sat waiting for a connection. The desktop sidebar should still preview the card by app and state in the reader's language, not by that fallback line.

How it was verified

  • pnpm typecheck, pnpm lint, pnpm i18n:check: all pass (locale catalogs valid, 10 languages, 3570 English strings). The three keys the sidebar uses (connectors.card.connected, connectors.card.waiting, connectors.card.connectSecurely) already exist in src/locales/en.json.
  • pnpm exec vitest run server/connector-card-text.test.ts src/lib/sidebar-layout.test.ts: 2 files, 19 tests pass.
  • server/index.test.ts, filtered to the two changed cases ("keeps second-account cards separate and waits for the requested alias, not an existing account" and "retries abandoned connector OAuth through Settings and in-chat cards without replacing an active account"): 2 pass.
  • Mutation check: with the text: connectorCardText(...) line removed from server/index.ts, both of those cases fail (expected undefined to be 'Connect Gmail as “work” to continue.' and expected undefined to be 'Connect Slack to continue.'). With the line restored, both pass.

Split out of #2357 and #2361.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Connector cards now include a plain-text instruction naming the app and, when applicable, the requested account.
    • Sidebar previews now show the app name alongside its connection status: “Connect securely,” “Waiting for sign-in…,” or “Connected.” Dismissed cards display only the app name.

… an app-and-state sidebar preview

Each in-chat connection card now carries a plain `text` line naming the
app (and the account alias, when there is one), so a client that does not
know the `connector` kind still shows something. The desktop sidebar
previews a card as "<app> · <state>" in the reader's language instead.

Split out of #2357 and #2361.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openmausbot-docs Ready Ready Preview Oct 6, 2026 3:22pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b0b358f-ce62-495f-b48e-8ad6d78a4ddc
📥 Commits

Reviewing files that changed from the base of the PR and between 67220c1 and d8d0ef7.

📒 Files selected for processing (7)
  • server/connector-card-text.test.ts
  • server/connector-card-text.ts
  • server/index.test.ts
  • server/index.ts
  • src/components/Sidebar.tsx
  • src/lib/sidebar-layout.test.ts
  • src/lib/sidebar-layout.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Connector messages now include plain text that names the app and optional account alias. Sidebar previews show the connector label with text that reflects its status.

Changes

Connector card display

Layer / File(s) Summary
Format connector message text
server/connector-card-text.ts, server/connector-card-text.test.ts, server/index.ts, server/index.test.ts
The server formats connector message text from the app label and optional account alias. Tests cover whitespace normalization, blank-name fallback, and stored connector text.
Render connector sidebar previews
src/lib/sidebar-layout.ts, src/lib/sidebar-layout.test.ts, src/components/Sidebar.tsx
The sidebar helper appends localized status text for connector previews. Dismissed cards show only the app label. Bot and group rows use the helper for connector messages.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: guylfe

Merge Risk: ⚪ Minimal · up to d8d0e

The change is mergeable after normal checks. A connector with a blank catalog name may have an unhelpful sidebar preview, but this does not block the connection workflow.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (2 skipped: 2… 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 both main changes: plain-text fallback text for connection cards and app-and-state sidebar previews. It is somewhat long but specific and relevant.
Description check ✅ Passed The description covers what changed, why, and how the changes were verified. It also describes the UI behavior and tests. It omits the template checklist and screenshots section, but the remaining inf…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (2 skipped: 2 too large.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch was successfully deployed

1 active deployment
Preview — d8d0ef77 Deployed Oct 6, 2026 by vercel[bot]
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.

2 participants