Add mouse support across the TUI

Drag to select copies on release. Request cards, the queue, attachments,
the PR view and the key hints get clickable buttons. Prompts, folds,
commands and diff files respond to clicks; prompts, replies, commands and
the PR view get right-click menus. Clicking a pane focuses it, the wheel
scrolls the thread list and palette, rows highlight under the pointer, and
the thread list's border drags to resize.
This commit is contained in:
Callum Alpass committed 2026-11-02 22:13:40 +11:00
1 parent fbdfb5c3e0
commit 12e1e0ba7a
27 files changed
+639 -116

No files matched your search

+3 -2
View File
@@ -1,4 +1,5 @@
import type { SettingRow } from "../model/settings.ts";
import { ClickRow } from "./Button.tsx";
import { colors } from "./theme.ts";
/** Settings in place of the conversation: tui3's own (cycled with enter or a click), then the server's, read-only. */
@@ -27,11 +28,11 @@ export function SettingsView(props: {
{props.rows.map((row, index) => {
const selected = index === props.selected;
return (
<box key={row.key} flexDirection="row" height={1} backgroundColor={selected ? colors.selectedBg : "transparent"} onMouseDown={() => props.onCycle(index)}>
<ClickRow key={row.key} flexDirection="row" height={1} selected={selected} onPress={() => props.onCycle(index)}>
<text fg={colors.muted} flexShrink={0}>{`${selected ? "▸ " : " "}${row.label.padEnd(labelWidth)}`}</text>
<text fg={colors.text} flexShrink={0}>{row.value}</text>
<text fg={colors.faint} wrapMode="none">{` ${row.help}`}</text>
</box>
</ClickRow>
);
})}
<text fg={colors.faint} marginTop={1}>T3 Code · change these in the app</text>