diff --git a/packages/app/src/components/prompt-input-v2.tsx b/packages/app/src/components/prompt-input-v2.tsx index d42a786b0d..921d8ff45c 100644 --- a/packages/app/src/components/prompt-input-v2.tsx +++ b/packages/app/src/components/prompt-input-v2.tsx @@ -60,6 +60,8 @@ export function PromptInputV2Composer(props: PromptInputV2ComposerProps) { controller={props.controller} borderUnderlay={props.borderUnderlay} class={props.class} + attachKeybind={command.keybindParts("file.attach")} + attachShortcut={command.keybind("file.attach")} modelControl={ props.controls.agents.options.map((name) => ({ id: name, label: name })), current: () => props.controls.agents.current, onSelect: props.controls.agents.select, + keybind: () => command.keybindParts("agent.cycle"), } : undefined, variant: { options: () => variants().map((value) => ({ id: value, label: value })), current: () => props.controls.model.selection.variant.current() ?? "default", onSelect: (value) => props.controls.model.selection.variant.set(value === "default" ? undefined : value), + keybind: () => command.keybindParts("model.variant.cycle"), }, submit: { stopping, diff --git a/packages/session-ui/src/v2/components/prompt-input/index.tsx b/packages/session-ui/src/v2/components/prompt-input/index.tsx index 30206cba26..c9b71dd4a4 100644 --- a/packages/session-ui/src/v2/components/prompt-input/index.tsx +++ b/packages/session-ui/src/v2/components/prompt-input/index.tsx @@ -39,6 +39,8 @@ export type PromptInputV2Props = { borderUnderlay?: boolean class?: string modelControl?: JSX.Element + attachKeybind?: string[] + attachShortcut?: string } export function PromptInputV2(props: PromptInputV2Props) { @@ -197,9 +199,9 @@ export function PromptInputV2(props: PromptInputV2Props) { {(control) => ( 1}> - + )} @@ -512,7 +518,7 @@ function PromptInputV2ConfiguredSelect(props: { return ( void }) { return ( - - - {props.currentIcon} - - {props.options.find((option) => option.id === props.current)?.label ?? props.current} - - - - - - - - - - {(option) => ( - - {option.label} - - )} - - - - - + + {props.title} + + + } + > + + + {props.currentIcon} + + {props.options.find((option) => option.id === props.current)?.label ?? props.current} + + + + + + + + + + {(option) => ( + + {option.label} + + )} + + + + + + ) } @@ -688,8 +703,3 @@ function PromptInputV2SuggestionIcon(props: { item: PromptInputV2Suggestion }) { /> ) } - -function keybindTitle(label: string, keybind?: string[]) { - if (!keybind?.length) return label - return `${label} (${keybind.join("+")})` -} diff --git a/packages/session-ui/src/v2/components/prompt-input/interaction.ts b/packages/session-ui/src/v2/components/prompt-input/interaction.ts index a003c081be..989ebcac20 100644 --- a/packages/session-ui/src/v2/components/prompt-input/interaction.ts +++ b/packages/session-ui/src/v2/components/prompt-input/interaction.ts @@ -23,6 +23,7 @@ export type PromptInputV2SelectControl = { options: Accessor current: Accessor onSelect: (id: string) => void + keybind?: Accessor } export type PromptInputV2ViewConfig = {