Repository navigation
Connection cards: a plain line for clients that cannot draw them, and an app-and-state sidebar preview - #2385
Conversation
… 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughConnector 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. ChangesConnector card display
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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 💡
🧪 Generate unit tests (beta)
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. Comment |
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: eachkind: "connector"message the server appends now also setstextfromconnectorCardText(toolkit.label, item.alias).src/lib/sidebar-layout.ts: newsidebarConnectorPreview, which previews a card as " · " (Connected / Waiting for sign-in… / Connect securely, using the existingconnectors.card.*strings), or just the app name once dismissed.src/components/Sidebar.tsx: the bot and group previews usesidebarConnectorPreviewfor connector messages.server/connector-card-text.test.ts(new), one new case insrc/lib/sidebar-layout.test.ts, and assertions on the stored card'stextadded to two existing cases inserver/index.test.ts.Why
Older clients decode a message kind they don't know by its
text. A connection card had notext, 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 insrc/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.text: connectorCardText(...)line removed fromserver/index.ts, both of those cases fail (expected undefined to be 'Connect Gmail as “work” to continue.'andexpected 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