From cf5b6feae89e71b0fff96be175c534817b1f1e58 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Thu, 30 Jul 2026 02:14:44 -0500 Subject: [PATCH] feat(desktop): show the active @ browse scope as a popover header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the scope no longer sitting in the editor as raw syntax, the popover is where it belongs: a FOLDERS / FILES / URL header above the list, so the filter reads as the mode it is instead of as characters the user has to finish. Reuses the existing group-header style the slash menu already renders — no new chrome. --- .../src/app/chat/composer/trigger-popover.tsx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/chat/composer/trigger-popover.tsx b/apps/desktop/src/app/chat/composer/trigger-popover.tsx index 0cf57700c14..38a9ac998a9 100644 --- a/apps/desktop/src/app/chat/composer/trigger-popover.tsx +++ b/apps/desktop/src/app/chat/composer/trigger-popover.tsx @@ -7,6 +7,7 @@ import { useI18n } from '@/i18n' import { cn } from '@/lib/utils' import { COMPLETION_DRAWER_BELOW_CLASS, COMPLETION_DRAWER_CLASS, CompletionDrawerEmpty } from './completion-drawer' +import type { DirectiveScope } from './text-utils' const AT_ICON_BY_TYPE: Record = { diff: 'diff', @@ -55,6 +56,20 @@ interface ComposerTriggerPopoverProps { onHover: (index: number) => void onPick: (item: Unstable_TriggerItem) => void placement?: 'bottom' | 'top' + /** The `@kind:` browse the list is filtered to, when there is one. Rendered + * as a header so the scope reads as the mode it is — the raw `@folder:` in + * the editor otherwise looks like syntax the user has to finish by hand. */ + scope?: DirectiveScope +} + +/** What each scope is actually browsing, for the popover header. */ +const SCOPE_LABEL: Record = { + file: 'Files', + folder: 'Folders', + git: 'Git', + image: 'Images', + tool: 'Tools', + url: 'URL' } export function ComposerTriggerPopover({ @@ -64,7 +79,8 @@ export function ComposerTriggerPopover({ loading, onHover, onPick, - placement = 'top' + placement = 'top', + scope }: ComposerTriggerPopoverProps) { const { t } = useI18n() const copy = t.composer @@ -80,6 +96,11 @@ export function ComposerTriggerPopover({ onMouseDown={event => event.preventDefault()} role="listbox" > + {scope && ( +
+ {SCOPE_LABEL[scope]} +
+ )} {items.length === 0 ? ( loading ? (