diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx index 6d0ca8a765ba..c1bd078f40ad 100644 --- a/apps/web/src/components/chat/ChatComposer.tsx +++ b/apps/web/src/components/chat/ChatComposer.tsx @@ -90,7 +90,7 @@ import { } from "../../lib/attachmentUploadState"; import { isCommandPaletteOpen } from "../../commandPaletteBus"; import { getTerminalFocusOwner } from "../../lib/terminalFocus"; -import { resolveShortcutCommand } from "../../keybindings"; +import { resolveShortcutCommand, shortcutLabelForCommand } from "../../keybindings"; import { type TerminalContextDraft, type TerminalContextSelection, @@ -3193,6 +3193,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) setIsStashMenuOpen(false)} diff --git a/apps/web/src/components/chat/ComposerStashMenu.test.tsx b/apps/web/src/components/chat/ComposerStashMenu.test.tsx index 7ab8005af2bc..fc32cc517cb4 100644 --- a/apps/web/src/components/chat/ComposerStashMenu.test.tsx +++ b/apps/web/src/components/chat/ComposerStashMenu.test.tsx @@ -8,6 +8,7 @@ describe("ComposerStashMenu", () => { const markup = renderToStaticMarkup( {}} onDelete={() => {}} onClose={() => {}} @@ -20,6 +21,22 @@ describe("ComposerStashMenu", () => { expect(markup).toContain('aria-label="Close stash"'); expect(markup).not.toContain("dropdown-glass"); expect(markup).not.toContain("Stashed prompts"); + expect(markup).toContain("Press Ctrl+S with a prompt in the composer to stash it."); + }); + + it("does not advertise a shortcut when stash is unbound", () => { + const markup = renderToStaticMarkup( + {}} + onDelete={() => {}} + onClose={() => {}} + />, + ); + + expect(markup).toContain("Nothing stashed yet."); + expect(markup).not.toContain("Press"); }); it("shows saved image thumbnails and incomplete image states", () => { @@ -53,6 +70,7 @@ describe("ComposerStashMenu", () => { pendingImageCount: 1, }, ]} + stashShortcutLabel="Ctrl+S" onRestore={() => {}} onDelete={() => {}} onClose={() => {}} diff --git a/apps/web/src/components/chat/ComposerStashMenu.tsx b/apps/web/src/components/chat/ComposerStashMenu.tsx index fc12831025b7..9bc29f474575 100644 --- a/apps/web/src/components/chat/ComposerStashMenu.tsx +++ b/apps/web/src/components/chat/ComposerStashMenu.tsx @@ -31,11 +31,12 @@ function stashEntrySnippet(entry: PromptStashEntry): string { */ export const ComposerStashMenu = memo(function ComposerStashMenu(props: { entries: ReadonlyArray; + stashShortcutLabel: string | null; onRestore: (entry: PromptStashEntry) => void; onDelete: (entry: PromptStashEntry) => void; onClose: () => void; }) { - const { entries, onRestore, onDelete, onClose } = props; + const { entries, stashShortcutLabel, onRestore, onDelete, onClose } = props; const drawerRef = useRef(null); const [highlightedId, setHighlightedId] = useState(entries[0]?.id ?? null); @@ -128,7 +129,10 @@ export const ComposerStashMenu = memo(function ComposerStashMenu(props: { {entries.length === 0 ? (

- Nothing stashed yet. Press ⌘S with a prompt in the composer to stash it. + Nothing stashed yet. + {stashShortcutLabel + ? ` Press ${stashShortcutLabel} with a prompt in the composer to stash it.` + : null}

) : ( entries.map((entry) => (