Skip to content

fix(cas): highlight selected connection in dropdown picker - #206

Open
norman-le wants to merge 4 commits into
developfrom
chore/update-selected-connection-highlight
Open

norman-le wants to merge 4 commits into
developfrom
chore/update-selected-connection-highlight

Conversation

@norman-le

@norman-le norman-le commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The Command component (cmdk) defaults its keyboard-navigation highlight to the first item in the list. When opening the connections dropdown, this caused the wrong connection to appear selected (e.g. the first shared connection instead of the user's active connection).
  • Pass defaultValue={selectedId} to Command so the highlight starts on the currently selected connection.

Before:
image

image

After:
image

Test plan

  • Open Chat Settings → Connections → click a connected connection dropdown
  • Verify the currently selected connection has the highlighted/darker background

🤖 Generated with Claude Code

The Command component (cmdk) defaults its keyboard-navigation highlight
to the first item. Pass the currently selected connection ID as the
Command value so the highlight lands on the correct item when the
dropdown opens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 16:36

Copilot AI 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.

🟡 Changes recommended

The connection selector’s controlled active value lacks an onValueChange handler, preventing keyboard and hover navigation from updating the highlight and causing Enter to select the original connection.

1 open issue
What changed in this PR

This PR aims to make the Chat Settings connections picker initially highlight the active connection instead of the first item.

Changes:

  • Passes the selected connection ID to cmdk’s Command value, falling back to an empty string when no connection is selected.
File Description
packages/​conversational-agent-chat/​src/​components/​SettingsDialog/​ConnectionsSection.tsx Binds the picker’s active-item value to the selected connection ID.

Review effort: Balanced

Copilot AI 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.

🟡 Changes recommended

The picker fix lacks a regression test with a non-first active connection to verify that only the active option is highlighted on opening and arrow-key navigation starts from it.

1 open issue
1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Package Line Coverage
datatable 88.29%
multi-file-upload 87.27%
conversational-agent-chat 90.99%
validation-station 99.31%
external-auth 97.26%
pdf-viewer 96.26%
decisions-and-reasons 98.50%

Copilot AI 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.

🟢 Approval recommended

No active review issues block the connection picker’s initial-highlight update.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants