Skip to content

Commit 71f0bd8

Browse files
committed
feat(tui): paint overlay choices with native Select
1 parent e0e31cd commit 71f0bd8

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎src/tui/overlay-paint.test.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,15 @@ describe("overlay host never shares cells with the prompt border", () => {
117117
size,
118118
);
119119

120-
const expected = [
121-
` ▶ ${ITEMS[0]}`,
122-
...ITEMS.slice(1).map((i) => ` ${i}`),
123-
];
120+
// Selection is text color only: no marker column, so each row is the label.
121+
const expected = ITEMS.map((i) => ` ${i}`);
124122
// Row 0 is the title/how-to line: the supplied title must show; its
125123
// exact hint wording is not part of this contract.
126124
expect(interior[0]).toContain("model");
127125
expectCleanInterior(interior.slice(1), expected);
128126

129127
// The selected row must be intact, not overwritten by the model label.
130-
expect(interior).toContain(` ▶ ${ITEMS[0]}`);
128+
expect(interior).toContain(` ${ITEMS[0]}`);
131129
for (const row of interior) {
132130
expect(row.includes(MODEL_LABEL)).toBe(false);
133131
expect(row.includes("alice")).toBe(false);

‎src/tui/overlay-view.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ export function createOverlayView(ctx: RenderContext) {
368368
);
369369
list.setHeight(list.height, 1);
370370
list.select.showSelectionIndicator = false;
371+
list.select.showScrollIndicator = false;
371372
list.select.options = lines.map((line) => ({
372373
name: line,
373374
description: "",
@@ -444,7 +445,8 @@ export function createOverlayView(ctx: RenderContext) {
444445
// nothing wraps, nothing clips. A cramped host may already have dropped
445446
// that air.
446447
list.setHeight(list.height, list.rowsPerItem);
447-
list.select.showSelectionIndicator = true;
448+
list.select.showSelectionIndicator = false;
449+
list.select.showScrollIndicator = false;
448450
list.select.options = presentation.items.map((label, i) => {
449451
const id = presentation.itemIds?.[i];
450452
return id === undefined

‎src/tui/shell/overlay-list.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ export function createOverlayList(
171171
width: "100%",
172172
flexShrink: 0,
173173
showDescription: shape.rowsPerItem > 1,
174-
showSelectionIndicator: true,
174+
showSelectionIndicator: false,
175+
showScrollIndicator: false,
176+
wrapSelection: false,
175177
itemSpacing: 0,
176178
// Selection is a text colour, not a filled band: the highlighted row
177179
// already stands out, and a block would fight the host's background.

0 commit comments

Comments
 (0)