Skip to content

Commit d67e2c8

Browse files
committed
fix: agent tree selection highlighting in AI configuration widget
1 parent c91cb3c commit d67e2c8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/ai-ide/src/browser/ai-configuration/agent-configuration-widget.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ export class AIAgentConfigurationWidget extends ReactWidget {
9999

100100
protected render(): React.ReactNode {
101101
return <div className='ai-agent-configuration-main'>
102-
<div className='configuration-agents-list preferences-tree-widget theia-TreeContainer' style={{ width: '25%' }}>
102+
<div className='configuration-agents-list theia-Tree theia-TreeContainer' style={{ width: '25%' }}>
103103
<ul>
104-
{this.agentService.getAllAgents().map(agent =>
105-
<li key={agent.id} className='theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode' onClick={() => this.setActiveAgent(agent)}>
104+
{this.agentService.getAllAgents().map(agent => {
105+
const isActive = this.aiConfigurationSelectionService.getActiveAgent()?.id === agent.id;
106+
const className = `theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode${isActive ? ' theia-mod-selected' : ''}`;
107+
return <li key={agent.id} className={className} onClick={() => this.setActiveAgent(agent)}>
106108
{this.renderAgentName(agent)}
107-
</li>
108-
)}
109+
</li>;
110+
})}
109111
</ul>
110112
<div className='configuration-agents-add'>
111113
<button

0 commit comments

Comments
 (0)