Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add React keys in chat views #14444

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export class ChatViewTreeWidget extends TreeWidget {
toolbarContributions.length > 0 &&
toolbarContributions.map(action =>
<span
key={action.commandId}
className={`theia-ChatNodeToolbarAction ${action.icon}`}
title={action.tooltip}
onClick={e => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-chat/src/common/chat-agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export abstract class AbstractChatAgent {
protected defaultLanguageModelPurpose: string,
public iconClass: string = 'codicon codicon-copilot',
public locations: ChatAgentLocation[] = ChatAgentLocation.ALL,
public tags: String[] = ['Chat'],
public tags: string[] = ['Chat'],
public defaultLogging: boolean = true) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ Only return the exact replacement for [[MARKER]] to complete the snippet.`,
{ name: 'textUntilCurrentPosition', usedInPrompt: true, description: 'The code before the current position of the cursor.' },
{ name: 'textAfterCurrentPosition', usedInPrompt: true, description: 'The code after the current position of the cursor.' }
];
readonly tags?: String[] | undefined;
readonly tags?: string[] | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class AIAgentConfigurationWidget extends ReactWidget {
}

private renderAgentName(agent: Agent): React.ReactNode {
const tagsSuffix = agent.tags?.length ? <span>{agent.tags.map(tag => <span className='agent-tag'>{tag}</span>)}</span> : '';
const tagsSuffix = agent.tags?.length ? <span>{agent.tags.map(tag => <span key={tag} className='agent-tag'>{tag}</span>)}</span> : '';
return <span>{agent.name} {tagsSuffix}</span>;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ai-core/src/common/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export interface Agent {
readonly languageModelRequirements: LanguageModelRequirement[];

/** A list of tags to filter agents and to display capabilities in the UI */
readonly tags?: String[];
readonly tags?: string[];

/** The list of local variable identifiers this agent needs to clarify its context requirements. */
readonly agentSpecificVariables: AgentSpecificVariables[];
Expand Down
Loading