diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index 252d891272f..d76d6a2e844 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -52,6 +52,7 @@ import { useClient } from "../../context/client" import { useEditorContext } from "../../context/editor" import { openEditor } from "../../editor" import { useDialog } from "../../ui/dialog" +import { DialogSelect } from "../../ui/dialog-select" import { DialogSessionRename } from "../../component/dialog-session-rename" import { DialogMessage } from "./dialog-message" import { DialogFork } from "./dialog-fork" @@ -374,6 +375,17 @@ export function Session() { }) const dialog = useDialog() const renderer = useRenderer() + const openQueuedPrompts = () => + dialog.replace(() => ( + ({ + title: prompt.text, + value: prompt.id, + footer: `${index + 1} of ${queuedPrompts().length}`, + }))} + /> + )) const unavailable = (feature: string) => { toast.show({ message: `${feature} is not implemented for V2 sessions yet`, variant: "error", duration: 5000 }) dialog.clear() @@ -876,6 +888,13 @@ export function Session() { dialog.clear() }, }, + { + title: "View queued prompts", + id: "session.queue.list", + group: "Session", + enabled: queuedPrompts().length > 0, + run: openQueuedPrompts, + }, { title: "Go to parent session", id: "session.parent", @@ -1003,7 +1022,7 @@ export function Session() { 0}> - + void }) { const theme = useTheme("elevated") - const shortcut = Keymap.useShortcut("command.palette.show") const next = createMemo(() => props.prompts[0]?.text) return ( @@ -1932,24 +1950,18 @@ function QueuedPromptDock(props: { prompts: { id: string; text: string }[] }) { border={["left"]} borderColor={theme.border.default} customBorderChars={SplitBorder.customBorderChars} + paddingTop={1} + paddingBottom={1} paddingLeft={2} paddingRight={1} backgroundColor={theme.background.default} flexDirection="row" - justifyContent="space-between" - gap={2} + onMouseUp={props.onOpen} > {props.prompts.length} queued - {(text) => <> · Next · {text()}} + {(text) => <> · {text()}} - - {(key) => ( - - {key()} view all - - )} - ) }