Skip to content

Commit cba1b24

Browse files
committed
style: dim Background Sound chooser hint
1 parent 8515eae commit cba1b24

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/vue-tui/component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,13 @@ function backgroundView(snapshot: PublicationSnapshot, noColor: boolean) {
666666
bold: index === selected,
667667
color: index === selected && !noColor ? "cyan" : undefined,
668668
}, () => `${index === selected ? "› " : " "}${label.padEnd(20)}${value}`);
669+
const soundRow = (sound: string) => h(Box, { flexDirection: "row" }, () => [
670+
h(Text, {
671+
bold: selected === 1,
672+
color: selected === 1 && !noColor ? "cyan" : undefined,
673+
}, () => `${selected === 1 ? "› " : " "}${"Sound".padEnd(20)}${sound}`),
674+
h(Text, { dimColor: true }, () => " · Press Enter to choose"),
675+
]);
669676
if (state.status === "hidden") return null;
670677
if (state.status === "candidate" || state.status === "probing") {
671678
return h(Box, { flexDirection: "column", flexGrow: 1, paddingX: 2, paddingY: 1 }, () => [
@@ -691,7 +698,7 @@ function backgroundView(snapshot: PublicationSnapshot, noColor: boolean) {
691698
h(Text, { bold: true }, () => "Background Sounds · macOS"),
692699
h(Text, () => ""),
693700
row(0, "Background Sounds", snapshotValue.enabled ? "● On" : "○ Off"),
694-
row(1, "Sound", `${snapshotValue.sound.label} · Enter to choose`),
701+
soundRow(snapshotValue.sound.label),
695702
row(2, "Volume", `[${"■".repeat(filled)}${"·".repeat(10 - filled)}] ${snapshotValue.volumePercent}%${pendingVolume === null ? "" : ` → ${pendingVolume}% pending`}`),
696703
h(Text, { dimColor: true }, () => ` ${"State".padEnd(20)}${busy ? "Refreshing from macOS…" : stale ? "Stale · press u to retry" : "Confirmed from macOS"}`),
697704
stale ? h(Text, { color: noColor ? undefined : "red" }, () => state.error) : null,

tests/vue-tui.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("TMU top-level surface smoke", () => {
5555
await terminal.stdin.write("u");
5656
await sleep(0);
5757
expect(terminal.lastFrame()).toContain("Background Sounds ● On");
58-
expect(terminal.lastFrame()).toContain("Sound Rain · Enter to choose");
58+
expect(terminal.lastFrame()).toContain("Sound Rain · Press Enter to choose");
5959
expect(terminal.lastFrame()).toContain("60%");
6060
expect(terminal.lastFrame()).toContain("Confirmed from macOS");
6161
await terminal.stdin.write("?");
@@ -98,7 +98,7 @@ describe("TMU top-level surface smoke", () => {
9898
const frame = terminal.lastFrame()!;
9999
expect(frame).toContain("Background Sounds · macOS");
100100
expect(frame).toContain("Background Sounds ○ Off");
101-
expect(frame).toContain("Sound Rain · Enter to choose");
101+
expect(frame).toContain("Sound Rain · Press Enter to choose");
102102
expect(frame).toContain("Confirmed from macOS");
103103
expect(frame.split("\n").every((line) => Array.from(line).length <= columns)).toBe(true);
104104
});
@@ -135,7 +135,7 @@ describe("TMU top-level surface smoke", () => {
135135
await terminal.stdin.write("\r");
136136

137137
expect(writes).toEqual(["sound-16"]);
138-
expect(terminal.lastFrame()).toContain("Sound 16 · Enter to choose");
138+
expect(terminal.lastFrame()).toContain("Sound 16 · Press Enter to choose");
139139
});
140140

141141
test("scrolls the one-column picker when terminal height cannot show all 16 sounds", async () => {
@@ -227,7 +227,7 @@ describe("TMU top-level surface smoke", () => {
227227

228228
expect(writes).toEqual(["enabled:true", "sound:Ocean", "volume:50"]);
229229
expect(terminal.lastFrame()).toContain("● On");
230-
expect(terminal.lastFrame()).toContain("Ocean · Enter to choose");
230+
expect(terminal.lastFrame()).toContain("Ocean · Press Enter to choose");
231231
expect(terminal.lastFrame()).toContain("50%");
232232
expect(coordinator.uiState.background.selectedRow).toBe(2);
233233
await terminal.stdin.write("k");

0 commit comments

Comments
 (0)