From fa99046c64cc2a28e413e2ff2abc1c4bbb8cd9fa Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 19 Mar 2026 19:32:55 +0000 Subject: [PATCH] Rename AI chat mention labels --- .../v6/internal/subsystems/ai-runtime.md | 3 +++ .../components/AI/Chat/MentionAutocomplete.tsx | 6 +++--- .../AI/Chat/__tests__/AIChat.test.tsx | 12 ++++++------ .../__tests__/MentionAutocomplete.test.tsx | 16 ++++++++-------- .../src/components/AI/Chat/index.tsx | 18 +++++++++--------- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md index bf2e74812..5a4408b2a 100644 --- a/docs/release-control/v6/internal/subsystems/ai-runtime.md +++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md @@ -141,6 +141,9 @@ Structured mention resolution also uses the shared AI tools discovery canonicalization helpers now, so chat prefetch and discovery responses agree on resource-type and target-ID formatting instead of maintaining chat-local copies. +The chat mention picker now also carries the canonical preferred resource +label as `label` through the structured mention payload, so mention search, +selection, and submission do not depend on a raw `displayName` field fork. The same governed-context rule also applies to the main unified AI resource overview: infrastructure, workload, alert-label, and top-consumer summaries must not leak raw resource names, cluster labels, IP addresses, or unresolved diff --git a/frontend-modern/src/components/AI/Chat/MentionAutocomplete.tsx b/frontend-modern/src/components/AI/Chat/MentionAutocomplete.tsx index e20a75f72..c764dc3f4 100644 --- a/frontend-modern/src/components/AI/Chat/MentionAutocomplete.tsx +++ b/frontend-modern/src/components/AI/Chat/MentionAutocomplete.tsx @@ -4,7 +4,7 @@ import { getSimpleStatusIndicator } from '@/utils/status'; export interface MentionResource { id: string; - displayName: string; + label: string; type: 'vm' | 'system-container' | 'app-container' | 'agent'; status?: string; node?: string; @@ -28,7 +28,7 @@ export function MentionAutocomplete(props: MentionAutocompleteProps) { if (!q) return props.resources.slice(0, 10); // Show first 10 if no query return props.resources - .filter((r) => r.displayName.toLowerCase().includes(q)) + .filter((r) => r.label.toLowerCase().includes(q)) .slice(0, 10); // Limit to 10 results }; @@ -155,7 +155,7 @@ export function MentionAutocomplete(props: MentionAutocompleteProps) { {getTypeIcon(resource.type)}
- {resource.displayName} + {resource.label} ({ MentionAutocomplete: (props: { visible: boolean; query: string; - resources: Array<{ id: string; displayName: string }>; - onSelect: (resource: { id: string; displayName: string }) => void; + resources: Array<{ id: string; label: string }>; + onSelect: (resource: { id: string; label: string }) => void; }) => (
resource.displayName).join('|')} + data-resource-labels={props.resources.map((resource) => resource.label).join('|')} >