From d6bd91872c79d70f2b03d702ad707ad633113f63 Mon Sep 17 00:00:00 2001 From: Callum Alpass Date: Tue, 3 Nov 2026 00:17:20 +1100 Subject: [PATCH] Panels above the composer: background blocks with a left bar --- src/ui/ComposerMenu.tsx | 5 +++-- src/ui/ConfirmBar.tsx | 3 ++- src/ui/QuestionPanel.tsx | 5 +++-- src/ui/QueuePanel.tsx | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ui/ComposerMenu.tsx b/src/ui/ComposerMenu.tsx index cd7b288..e8a6703 100644 --- a/src/ui/ComposerMenu.tsx +++ b/src/ui/ComposerMenu.tsx @@ -1,5 +1,6 @@ import type { ComposerItem } from "../model/composerMenu.ts"; import { ClickRow } from "./Button.tsx"; +import { BAR } from "./edges.ts"; import { truncate } from "./text.ts"; import { colors } from "./theme.ts"; @@ -12,9 +13,9 @@ const MAX_ROWS = 8; export function ComposerMenu(props: { readonly items: readonly ComposerItem[]; readonly selected: number; readonly empty: string; readonly width: number; readonly onPick: (index: number) => void }) { const { items, selected } = props; const start = Math.max(0, Math.min(selected - Math.floor(MAX_ROWS / 2), items.length - MAX_ROWS)); - const inner = Math.max(10, props.width - 4); + const inner = Math.max(10, props.width - 3); return ( - + {items.length === 0 ? ( {props.empty} diff --git a/src/ui/ConfirmBar.tsx b/src/ui/ConfirmBar.tsx index b8f1d0c..7179758 100644 --- a/src/ui/ConfirmBar.tsx +++ b/src/ui/ConfirmBar.tsx @@ -1,4 +1,5 @@ import { Button, Buttons } from "./Button.tsx"; +import { BAR } from "./edges.ts"; import { colors } from "./theme.ts"; /** An action that waits for you to say yes: git actions, stopping a server, running an automation. */ @@ -15,7 +16,7 @@ export interface Confirmation { export function ConfirmBar(props: { readonly confirmation: Confirmation; readonly message: string; readonly onMessage: (value: string) => void; readonly onSubmit: () => void; readonly onCancel: () => void }) { const { confirmation } = props; return ( - + {confirmation.title} diff --git a/src/ui/QuestionPanel.tsx b/src/ui/QuestionPanel.tsx index 7da691b..d98dc10 100644 --- a/src/ui/QuestionPanel.tsx +++ b/src/ui/QuestionPanel.tsx @@ -4,6 +4,7 @@ import { isPendingUserInputOptionSelected, type PendingUserInputDraftAnswer } fr import type { MouseEvent } from "@opentui/core"; import { Button, Buttons, isLeftClick, useHover } from "./Button.tsx"; +import { BAR } from "./edges.ts"; import { colors } from "./theme.ts"; /** @@ -24,7 +25,7 @@ export function QuestionPanel(props: { if (!question) return null; const total = request.questions.length; return ( - + {question.header} @@ -51,7 +52,7 @@ export function QuestionPanel(props: { function Option(props: { readonly label: string; readonly description?: string | undefined; readonly prefix: string; readonly selected: boolean; readonly onPick: () => void }) { const [hover, hoverProps] = useHover(); return ( - isLeftClick(event) && props.onPick()}> + isLeftClick(event) && props.onPick()}> {props.prefix} {props.label} {props.description ? ` ${props.description}` : ""} diff --git a/src/ui/QueuePanel.tsx b/src/ui/QueuePanel.tsx index f2690d0..0a8b280 100644 --- a/src/ui/QueuePanel.tsx +++ b/src/ui/QueuePanel.tsx @@ -2,6 +2,7 @@ import type { MouseEvent } from "@opentui/core"; import type { QueuedMessage } from "../model/queue.ts"; import { Button, Buttons, isLeftClick, useHover } from "./Button.tsx"; +import { BAR } from "./edges.ts"; import { truncate } from "./text.ts"; import { colors } from "./theme.ts"; @@ -26,9 +27,9 @@ export function QueuePanel(props: { readonly queued: readonly QueuedMessage[]; r const { queued, focus } = props; const start = focus === null ? 0 : Math.max(0, Math.min(focus - 1, queued.length - VISIBLE_ROWS)); const shown = queued.slice(start, start + VISIBLE_ROWS); - const inner = Math.max(10, props.width - 8); + const inner = Math.max(10, props.width - 7); return ( - + {`${queued.length} queued${props.held ? " ยท held after the interrupt" : ""}`} {props.held && actions.resume ?