tmux-ide 2.9.0-beta.38 → 2.9.0-beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -11279,7 +11279,7 @@ var require_package = __commonJS({
11279
11279
  "package.json"(exports, module) {
11280
11280
  module.exports = {
11281
11281
  name: "tmux-ide",
11282
- version: "2.9.0-beta.38",
11282
+ version: "2.9.0-beta.40",
11283
11283
  description: "A visual, agent-aware IDE for any tmux session, with optional workspace presets",
11284
11284
  type: "module",
11285
11285
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmux-ide",
3
- "version": "2.9.0-beta.38",
3
+ "version": "2.9.0-beta.40",
4
4
  "description": "A visual, agent-aware IDE for any tmux session, with optional workspace presets",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,6 +2,7 @@
2
2
  import { createEffect, createMemo, createSignal, For, Show } from "solid-js";
3
3
  import { clipTerminal, terminalDisplayWidth } from "../terminal-text.js";
4
4
  import { NavigationRow } from "../ui/navigation-row.jsx";
5
+ import { KeyHint } from "../ui/key-hint.jsx";
5
6
  import { TuiButton } from "../ui/button.jsx";
6
7
  import { useKeyboardRoute } from "../ui/keyboard-router.jsx";
7
8
  import { applicationPaneRenameKeyAction, applicationPaneRenamePaste, } from "./application-pane-rename-input.js";
@@ -36,12 +37,13 @@ export function HomeAgentRoster(props) {
36
37
  props.onRetry) ||
37
38
  (props.snapshot.truncatedSessions > 0 && props.onLoadMore));
38
39
  const rowHeight = () => (width() >= 60 && height() >= 16 ? 2 : 1);
40
+ const filterRows = () => (props.onSetActivityFilter && width() < 70 ? 2 : 1);
39
41
  const searchRows = () => (props.onQueryChange ? 2 : 0);
40
- const visibleCount = () => Math.max(0, Math.floor((height() - 5 - searchRows() - (showRecovery() ? 1 : 0)) / rowHeight()));
41
- const openSelected = () => {
42
+ const visibleCount = () => Math.max(0, Math.floor((height() - 4 - filterRows() - searchRows() - (showRecovery() ? 1 : 0)) / rowHeight()));
43
+ const openSelected = (source = "keyboard") => {
42
44
  const row = props.snapshot.rows.find((row) => row.key === props.selection.selectedKey);
43
45
  if (props.inputActive && visibleCount() > 0 && row?.paneId && !stale(row))
44
- props.onOpen(row, "keyboard");
46
+ props.onOpen(row, source);
45
47
  };
46
48
  createEffect(() => props.onViewport(visibleCount()));
47
49
  const offset = () => Math.max(0, Math.min(props.selection.scrollOffset, Math.max(0, props.snapshot.rows.length - visibleCount())));
@@ -56,12 +58,13 @@ export function HomeAgentRoster(props) {
56
58
  const session = width() >= 44 ? Math.floor(label * 0.43) : 0;
57
59
  return { status, agent: label - session, session };
58
60
  };
61
+ const filtered = () => Boolean(props.query || (props.activityFilter && props.activityFilter !== "all"));
59
62
  const title = () => {
60
63
  if (props.snapshot.phase === "unavailable")
61
64
  return "Agent overview unavailable";
62
65
  if (props.snapshot.phase === "loading" && props.snapshot.rows.length === 0)
63
66
  return "Loading agent overview…";
64
- if (props.query && props.snapshot.rows.length === 0)
67
+ if (filtered() && props.snapshot.rows.length === 0)
65
68
  return "No matching agents";
66
69
  if (props.snapshot.phase === "live" && props.snapshot.rows.length === 0)
67
70
  return "No agents reported";
@@ -97,7 +100,15 @@ export function HomeAgentRoster(props) {
97
100
  return false;
98
101
  const key = event.name.toLowerCase();
99
102
  const filter = !editing() &&
100
- (key === "f" ? props.onCycleMachine : key === "a" ? props.onToggleAttention : undefined);
103
+ (key === "f"
104
+ ? props.onCycleMachine
105
+ : key === "a"
106
+ ? props.onToggleAttention
107
+ : key === "w" && props.onSetActivityFilter
108
+ ? () => props.onSetActivityFilter?.("working")
109
+ : key === "0" && props.onSetActivityFilter
110
+ ? () => props.onSetActivityFilter?.("all")
111
+ : undefined);
101
112
  if (filter) {
102
113
  event.preventDefault();
103
114
  event.stopPropagation();
@@ -150,30 +161,42 @@ export function HomeAgentRoster(props) {
150
161
  {clipTerminal(title(), width())}
151
162
  </text>
152
163
  </box>
153
- <box width={width()} height={1} flexShrink={0} flexDirection="row">
154
- <text width={Math.max(0, width() - (props.onToggleAttention ? 16 : 0))} height={1} fg={props.theme.roles.text.secondary} onMouseDown={(event) => {
155
- if (!props.inputActive || event.button !== 0)
156
- return;
157
- event.preventDefault();
158
- event.stopPropagation();
159
- props.onCycleMachine?.();
160
- }}>
161
- {clipTerminal(props.filterLabel ? `${props.filterLabel} · f machine` : "", Math.max(0, width() - (props.onToggleAttention ? 16 : 0)))}
162
- </text>
163
- <Show when={props.onToggleAttention}>
164
- <TuiButton theme={props.theme} label="Attention" shortcut="a" size="compact" variant="ghost" background={props.theme.roles.surfaces.canvas} width={Math.min(16, width())} onPress={() => {
164
+ <box width={width()} height={filterRows()} flexShrink={0} flexDirection={filterRows() > 1 ? "column" : "row"} overflow="hidden">
165
+ <KeyHint theme={props.theme} keys="f" label={props.filterLabel?.split(" · ")[0] ?? "All machines"} width={props.onSetActivityFilter && filterRows() === 1
166
+ ? Math.max(1, width() - 47)
167
+ : props.onSetActivityFilter
168
+ ? Math.min(width(), 28)
169
+ : Math.max(1, Math.min(28, width() - 16))} quiet button onPress={() => {
165
170
  if (props.inputActive)
166
- props.onToggleAttention?.();
171
+ props.onCycleMachine?.();
167
172
  }}/>
168
- </Show>
173
+ <box height={1} flexShrink={0} flexDirection="row" overflow="hidden" width={Math.min(width(), 47)}>
174
+ <Show when={props.onSetActivityFilter} fallback={<KeyHint theme={props.theme} keys="a" label="Attention" quiet button onPress={() => {
175
+ if (props.inputActive)
176
+ props.onToggleAttention?.();
177
+ }}/>}>
178
+ <For each={[
179
+ { key: "0", label: "All", value: "all" },
180
+ { key: "w", label: "Working", value: "working" },
181
+ { key: "a", label: "Needs attention", value: "attention" },
182
+ ]}>
183
+ {(filter) => (<KeyHint theme={props.theme} keys={filter.key} label={filter.value === "attention" && width() < 47 ? "Attention" : filter.label} quiet button selected={(props.activityFilter ?? "all") === filter.value} onPress={() => {
184
+ if (props.inputActive)
185
+ props.onSetActivityFilter?.(filter.value);
186
+ }}/>)}
187
+ </For>
188
+ </Show>
189
+ </box>
169
190
  </box>
170
191
  <Show when={props.snapshot.rows.length > 0} fallback={<box height={Math.max(0, visibleCount() * rowHeight() + 1)} flexShrink={0} flexDirection="column" overflow="hidden">
171
192
  <Show when={props.snapshot.phase === "live" && !props.query}>
172
193
  <text height={1} width={width()} fg={props.theme.roles.text.primary}>
173
- {clipTerminal("Your next session starts here", width())}
194
+ {clipTerminal(filtered() ? "No agents match these filters" : "Your next session starts here", width())}
174
195
  </text>
175
196
  <text height={1} width={width()} fg={props.theme.roles.text.muted}>
176
- {clipTerminal("Open terminals, or use Commands to connect a machine.", width())}
197
+ {clipTerminal(filtered()
198
+ ? "Choose All or change the machine filter to see more agents."
199
+ : "Open terminals, or use Commands to connect a machine.", width())}
177
200
  </text>
178
201
  </Show>
179
202
  </box>}>
@@ -190,6 +213,7 @@ export function HomeAgentRoster(props) {
190
213
  });
191
214
  return (<box height={rowHeight()} flexDirection="column" backgroundColor={componentPalette(props.theme, {
192
215
  selected: props.selection.selectedKey === key,
216
+ hovered: hovered() === key,
193
217
  disabled: row().paneId === null || stale(row()),
194
218
  }).background} width={width()} flexShrink={0} onMouseDown={(event) => {
195
219
  if (!props.inputActive || event.button !== 0 || !row().paneId || stale(row()))
@@ -215,6 +239,7 @@ export function HomeAgentRoster(props) {
215
239
  ? props.theme.roles.selection.selectionText
216
240
  : props.theme.roles.text.muted} bg={componentPalette(props.theme, {
217
241
  selected: props.selection.selectedKey === key,
242
+ hovered: hovered() === key,
218
243
  disabled: row().paneId === null || stale(row()),
219
244
  }).background}>
220
245
  {clipTerminal(` ${[row().sessionName, row().machineLabel, row().serverLabel, row().harness].filter(Boolean).join(" · ")}`, width())}
@@ -231,15 +256,20 @@ export function HomeAgentRoster(props) {
231
256
  const action = applicationPaneRenameKeyAction(event, props.query ?? "");
232
257
  if (action.kind === "update")
233
258
  onQueryChange()(action.value);
234
- }} onPaste={(bytes) => onQueryChange()(applicationPaneRenamePaste(props.query ?? "", bytes))} onEditing={setEditing} onSubmit={openSelected}/>
259
+ }} onPaste={(bytes) => onQueryChange()(applicationPaneRenamePaste(props.query ?? "", bytes))} onEditing={setEditing} onSubmit={() => openSelected()}/>
235
260
  </box>)}
236
261
  </Show>
237
262
  <text width={width()} height={1} flexShrink={0} fg={props.theme.roles.text.muted}>
238
263
  {clipTerminal(coverage(), width())}
239
264
  </text>
240
- <text width={width()} height={1} flexShrink={0} fg={props.theme.roles.text.muted}>
241
- {clipTerminal(footer(), width())}
242
- </text>
265
+ <box width={width()} height={1} flexShrink={0} flexDirection="row" overflow="hidden">
266
+ <text width={Math.min(Math.max(0, width() - (footer().endsWith("Enter open") && width() >= 20 ? 12 : 0)), terminalDisplayWidth(footer().replace(/ Enter open$/u, "")))} fg={props.theme.roles.text.muted}>
267
+ {clipTerminal(footer().replace(/ Enter open$/u, ""), width())}
268
+ </text>
269
+ <Show when={footer().endsWith("Enter open") && width() >= 20}>
270
+ <KeyHint theme={props.theme} keys="Enter" label="open" quiet button onPress={() => openSelected("mouse")}/>
271
+ </Show>
272
+ </box>
243
273
  <Show when={showRecovery()}>
244
274
  <box height={1} width={width()} flexShrink={0} flexDirection="row" gap={1}>
245
275
  <Show when={(props.snapshot.phase === "unavailable" || props.snapshot.unavailableSessions > 0) &&
@@ -28,6 +28,13 @@ export function projectHomeFleet(catalog, groups, filter) {
28
28
  if (filter.attentionOnly &&
29
29
  !(agent.attention || agent.activity === "waiting" || agent.activity === "failed"))
30
30
  continue;
31
+ if (filter.workingOnly &&
32
+ (agent.disabled ||
33
+ group?.available === false ||
34
+ unavailable.has(sessionKey) ||
35
+ machine.state !== "ready" ||
36
+ agent.activity !== "running"))
37
+ continue;
31
38
  const paneKey = agent.paneId
32
39
  ? JSON.stringify([machine.id, agent.server?.serverId, agent.daemonInstanceId, agent.paneId])
33
40
  : agent.id;
@@ -119,7 +126,7 @@ export function createApplicationHomeFleetOwner(options) {
119
126
  return options.inputActive();
120
127
  },
121
128
  get agentFilterLabel() {
122
- return `${catalog().groups.find((group) => group.id === filter().machineId)?.label ?? "All machines"} · ${filter().attentionOnly ? "Needs attention" : "All agents"}`;
129
+ return `${catalog().groups.find((group) => group.id === filter().machineId)?.label ?? "All machines"} · ${filter().attentionOnly ? "Needs attention" : filter().workingOnly ? "Working" : "All agents"}`;
123
130
  },
124
131
  onCycleAgentMachine() {
125
132
  const ids = [null, ...catalog().groups.map((group) => group.id)];
@@ -128,8 +135,18 @@ export function createApplicationHomeFleetOwner(options) {
128
135
  machineId: ids[(ids.indexOf(value.machineId) + 1) % ids.length],
129
136
  }));
130
137
  },
138
+ get agentActivityFilter() {
139
+ return filter().attentionOnly ? "attention" : filter().workingOnly ? "working" : "all";
140
+ },
141
+ onSetAgentActivityFilter(activity) {
142
+ setFilter((value) => ({
143
+ ...value,
144
+ attentionOnly: activity === "attention",
145
+ workingOnly: activity === "working",
146
+ }));
147
+ },
131
148
  onToggleAgentAttention() {
132
- setFilter((value) => ({ ...value, attentionOnly: !value.attentionOnly }));
149
+ setFilter((value) => ({ ...value, attentionOnly: !value.attentionOnly, workingOnly: false }));
133
150
  },
134
151
  onRetryAgents: () => options.agents.retry?.(),
135
152
  onLoadMoreAgents: () => options.agents.loadMore?.(),
@@ -12,7 +12,6 @@ import { Surface } from "../ui/surface.jsx";
12
12
  import { useKeyboardRoute } from "../ui/keyboard-router.jsx";
13
13
  /** Pure machine navigation. All connection and session authority stays with the caller. */
14
14
  export function ApplicationMachineSidebar(props) {
15
- const [showHelp, setShowHelp] = createSignal(false);
16
15
  const [localFocused, setLocalFocused] = createSignal(false);
17
16
  const focused = () => props.model.focused?.() ?? localFocused();
18
17
  const [localCollapsed, setCollapsed] = createSignal(new Set());
@@ -31,14 +30,12 @@ export function ApplicationMachineSidebar(props) {
31
30
  const start = Math.max(0, active - tabHeight() + 1);
32
31
  return tabs.slice(start, start + tabHeight());
33
32
  };
34
- const helpHeight = () => showHelp() ? Math.min(5, Math.max(0, Math.floor(props.height / 3))) : 0;
35
33
  const machineHeight = () => Math.max(0, props.height -
36
34
  1 -
37
35
  (props.model.onAddMachine ? 1 : 0) -
38
36
  agentHeight() -
39
37
  controlsHeight() -
40
38
  searchHeight() -
41
- helpHeight() -
42
39
  tabHeight());
43
40
  const active = (row) => row.group.id === props.model.activeMachineId() &&
44
41
  (row.agent
@@ -238,7 +235,7 @@ export function ApplicationMachineSidebar(props) {
238
235
  event.preventDefault();
239
236
  event.stopPropagation();
240
237
  if (key === "help") {
241
- setShowHelp(!showHelp());
238
+ props.onHelp?.("keyboard");
242
239
  return true;
243
240
  }
244
241
  if (key === "search") {
@@ -246,10 +243,6 @@ export function ApplicationMachineSidebar(props) {
246
243
  return true;
247
244
  }
248
245
  if (key === "escape") {
249
- if (showHelp()) {
250
- setShowHelp(false);
251
- return true;
252
- }
253
246
  setLocalFocused(false);
254
247
  props.model.onBlur?.();
255
248
  return true;
@@ -309,7 +302,7 @@ export function ApplicationMachineSidebar(props) {
309
302
  <Show when={props.model.tabs?.().length && props.width >= 28}>
310
303
  <KeyHint theme={props.theme} keys="F9" label="Tabs" quiet/>
311
304
  </Show>
312
- <KeyHint theme={props.theme} keys="?" label={props.width >= 20 ? "Help" : undefined} quiet button onPress={() => setShowHelp(!showHelp())}/>
305
+ <KeyHint theme={props.theme} keys="?" label={props.width >= 20 ? "Help" : undefined} quiet button onPress={() => props.onHelp?.("mouse")}/>
313
306
  </box>
314
307
  <For each={visibleTabs()}>
315
308
  {(tab) => (<box height={1} flexDirection="row">
@@ -416,11 +409,6 @@ export function ApplicationMachineSidebar(props) {
416
409
  {props.agents}
417
410
  </scrollbox>)}
418
411
  </For>
419
- <Show when={helpHeight() > 0}>
420
- <text height={helpHeight()} fg={props.theme.roles.text.secondary}>
421
- {"j/k ↑↓ move · g/G ends\nPgUp/Dn · Ctrl-U/D half\nh/l ←→ collapse/expand\nEnter open · / search\nf favorite · Esc terminal"}
422
- </text>
423
- </Show>
424
412
  <Show when={props.model.onOpenSwitcher}>
425
413
  <KeyHint theme={props.theme} keys="F6" label="Sessions" width={props.width} quiet button onPress={() => props.model.onOpenSwitcher?.()}/>
426
414
  </Show>
@@ -19,6 +19,7 @@ export function ApplicationHomeSurface(props) {
19
19
  props.agentRoster?.phase === "live" &&
20
20
  props.agentRoster.rows.length === 0 &&
21
21
  !props.agentQuery &&
22
+ (!props.agentActivityFilter || props.agentActivityFilter === "all") &&
22
23
  applicationHomeBrandVariant(bodyWidth(), height()) === "ascii";
23
24
  const brandRows = () => (showAscii() ? APPLICATION_HOME_WORDMARK.length : 1);
24
25
  const spacious = () => height() >= 14;
@@ -116,7 +117,7 @@ export function ApplicationHomeSurface(props) {
116
117
  {clipTerminal(summary(), bodyWidth())}
117
118
  </text>
118
119
  </>}>
119
- {(snapshot) => (<HomeAgentRoster query={props.agentQuery} onQueryChange={props.onAgentQueryChange} filterLabel={props.agentFilterLabel} onCycleMachine={props.onCycleAgentMachine} onToggleAttention={props.onToggleAgentAttention} theme={props.theme} width={bodyWidth()} height={rosterHeight()} snapshot={snapshot()} selection={props.agentSelection ?? { selectedKey: null, scrollOffset: 0 }} inputActive={props.agentInputActive ?? false} onSelect={(key) => props.onSelectAgent?.(key)} onMove={(delta) => props.onMoveAgent?.(delta)} onViewport={(rows) => props.onAgentViewport?.(rows)} onOpen={(row, source) => props.onOpenAgent?.(row, source)} onRetry={props.onRetryAgents} onLoadMore={props.onLoadMoreAgents}/>)}
120
+ {(snapshot) => (<HomeAgentRoster query={props.agentQuery} onQueryChange={props.onAgentQueryChange} filterLabel={props.agentFilterLabel} activityFilter={props.agentActivityFilter} onSetActivityFilter={props.onSetAgentActivityFilter} onCycleMachine={props.onCycleAgentMachine} onToggleAttention={props.onToggleAgentAttention} theme={props.theme} width={bodyWidth()} height={rosterHeight()} snapshot={snapshot()} selection={props.agentSelection ?? { selectedKey: null, scrollOffset: 0 }} inputActive={props.agentInputActive ?? false} onSelect={(key) => props.onSelectAgent?.(key)} onMove={(delta) => props.onMoveAgent?.(delta)} onViewport={(rows) => props.onAgentViewport?.(rows)} onOpen={(row, source) => props.onOpenAgent?.(row, source)} onRetry={props.onRetryAgents} onLoadMore={props.onLoadMoreAgents}/>)}
120
121
  </Show>
121
122
  <Show when={activityHeight() > 0}>
122
123
  <box width={bodyWidth()} height={activityHeight()} flexShrink={0} flexDirection="column" overflow="hidden">
@@ -6,13 +6,17 @@ import { useKeyboardRoute } from "./keyboard-router.jsx";
6
6
  export function KeyHint(props) {
7
7
  const palette = () => componentPalette(props.theme, props, "neutral");
8
8
  const background = () => props.button
9
- ? props.theme.roles.surfaces.panelRaised
9
+ ? props.selected
10
+ ? props.theme.roles.selection.selection
11
+ : props.theme.roles.surfaces.panelRaised
10
12
  : props.quiet && !props.focused && !props.hovered
11
13
  ? props.theme.roles.surfaces.panel
12
14
  : palette().background;
13
- const foreground = () => props.quiet && !props.focused && !props.hovered
14
- ? props.theme.roles.text.muted
15
- : palette().foreground;
15
+ const foreground = () => props.selected
16
+ ? props.theme.roles.selection.selectionText
17
+ : props.quiet && !props.focused && !props.hovered
18
+ ? props.theme.roles.text.muted
19
+ : palette().foreground;
16
20
  const text = () => props.presentation ?? `${props.keys}${props.label ? ` ${props.label}` : ""}`;
17
21
  const width = () => Math.max(1, Math.floor(props.width ?? terminalDisplayWidth(text()) + 2));
18
22
  const content = () => clipTerminal(props.presentation ?? ` ${text()} `, width());
@@ -3,6 +3,7 @@ import { createEffect, createMemo, createSignal, For, Show } from "solid-js";
3
3
  import type { SemanticThemeSnapshot } from "../theme.ts";
4
4
  import { clipTerminal, terminalDisplayWidth } from "../terminal-text.ts";
5
5
  import { NavigationRow } from "../ui/navigation-row.tsx";
6
+ import { KeyHint } from "../ui/key-hint.tsx";
6
7
  import { TuiButton } from "../ui/button.tsx";
7
8
  import { useKeyboardRoute } from "../ui/keyboard-router.tsx";
8
9
  import {
@@ -24,6 +25,8 @@ export interface HomeAgentRosterProps {
24
25
  readonly query?: string;
25
26
  readonly onQueryChange?: (query: string) => void;
26
27
  readonly filterLabel?: string;
28
+ readonly activityFilter?: "all" | "working" | "attention";
29
+ readonly onSetActivityFilter?: (value: "all" | "working" | "attention") => void;
27
30
  readonly onCycleMachine?: () => void;
28
31
  readonly onToggleAttention?: () => void;
29
32
  readonly theme: SemanticThemeSnapshot;
@@ -69,13 +72,19 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
69
72
  (props.snapshot.truncatedSessions > 0 && props.onLoadMore),
70
73
  );
71
74
  const rowHeight = () => (width() >= 60 && height() >= 16 ? 2 : 1);
75
+ const filterRows = () => (props.onSetActivityFilter && width() < 70 ? 2 : 1);
72
76
  const searchRows = () => (props.onQueryChange ? 2 : 0);
73
77
  const visibleCount = () =>
74
- Math.max(0, Math.floor((height() - 5 - searchRows() - (showRecovery() ? 1 : 0)) / rowHeight()));
75
- const openSelected = () => {
78
+ Math.max(
79
+ 0,
80
+ Math.floor(
81
+ (height() - 4 - filterRows() - searchRows() - (showRecovery() ? 1 : 0)) / rowHeight(),
82
+ ),
83
+ );
84
+ const openSelected = (source: "keyboard" | "mouse" = "keyboard") => {
76
85
  const row = props.snapshot.rows.find((row) => row.key === props.selection.selectedKey);
77
86
  if (props.inputActive && visibleCount() > 0 && row?.paneId && !stale(row))
78
- props.onOpen(row, "keyboard");
87
+ props.onOpen(row, source);
79
88
  };
80
89
  createEffect(() => props.onViewport(visibleCount()));
81
90
  const offset = () =>
@@ -97,11 +106,13 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
97
106
  const session = width() >= 44 ? Math.floor(label * 0.43) : 0;
98
107
  return { status, agent: label - session, session };
99
108
  };
109
+ const filtered = () =>
110
+ Boolean(props.query || (props.activityFilter && props.activityFilter !== "all"));
100
111
  const title = () => {
101
112
  if (props.snapshot.phase === "unavailable") return "Agent overview unavailable";
102
113
  if (props.snapshot.phase === "loading" && props.snapshot.rows.length === 0)
103
114
  return "Loading agent overview…";
104
- if (props.query && props.snapshot.rows.length === 0) return "No matching agents";
115
+ if (filtered() && props.snapshot.rows.length === 0) return "No matching agents";
105
116
  if (props.snapshot.phase === "live" && props.snapshot.rows.length === 0)
106
117
  return "No agents reported";
107
118
  const count = props.snapshot.rows.length;
@@ -140,7 +151,15 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
140
151
  const key = event.name.toLowerCase();
141
152
  const filter =
142
153
  !editing() &&
143
- (key === "f" ? props.onCycleMachine : key === "a" ? props.onToggleAttention : undefined);
154
+ (key === "f"
155
+ ? props.onCycleMachine
156
+ : key === "a"
157
+ ? props.onToggleAttention
158
+ : key === "w" && props.onSetActivityFilter
159
+ ? () => props.onSetActivityFilter?.("working")
160
+ : key === "0" && props.onSetActivityFilter
161
+ ? () => props.onSetActivityFilter?.("all")
162
+ : undefined);
144
163
  if (filter) {
145
164
  event.preventDefault();
146
165
  event.stopPropagation();
@@ -204,37 +223,77 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
204
223
  {clipTerminal(title(), width())}
205
224
  </text>
206
225
  </box>
207
- <box width={width()} height={1} flexShrink={0} flexDirection="row">
208
- <text
209
- width={Math.max(0, width() - (props.onToggleAttention ? 16 : 0))}
210
- height={1}
211
- fg={props.theme.roles.text.secondary}
212
- onMouseDown={(event) => {
213
- if (!props.inputActive || event.button !== 0) return;
214
- event.preventDefault();
215
- event.stopPropagation();
216
- props.onCycleMachine?.();
226
+ <box
227
+ width={width()}
228
+ height={filterRows()}
229
+ flexShrink={0}
230
+ flexDirection={filterRows() > 1 ? "column" : "row"}
231
+ overflow="hidden"
232
+ >
233
+ <KeyHint
234
+ theme={props.theme}
235
+ keys="f"
236
+ label={props.filterLabel?.split(" · ")[0] ?? "All machines"}
237
+ width={
238
+ props.onSetActivityFilter && filterRows() === 1
239
+ ? Math.max(1, width() - 47)
240
+ : props.onSetActivityFilter
241
+ ? Math.min(width(), 28)
242
+ : Math.max(1, Math.min(28, width() - 16))
243
+ }
244
+ quiet
245
+ button
246
+ onPress={() => {
247
+ if (props.inputActive) props.onCycleMachine?.();
217
248
  }}
249
+ />
250
+ <box
251
+ height={1}
252
+ flexShrink={0}
253
+ flexDirection="row"
254
+ overflow="hidden"
255
+ width={Math.min(width(), 47)}
218
256
  >
219
- {clipTerminal(
220
- props.filterLabel ? `${props.filterLabel} · f machine` : "",
221
- Math.max(0, width() - (props.onToggleAttention ? 16 : 0)),
222
- )}
223
- </text>
224
- <Show when={props.onToggleAttention}>
225
- <TuiButton
226
- theme={props.theme}
227
- label="Attention"
228
- shortcut="a"
229
- size="compact"
230
- variant="ghost"
231
- background={props.theme.roles.surfaces.canvas}
232
- width={Math.min(16, width())}
233
- onPress={() => {
234
- if (props.inputActive) props.onToggleAttention?.();
235
- }}
236
- />
237
- </Show>
257
+ <Show
258
+ when={props.onSetActivityFilter}
259
+ fallback={
260
+ <KeyHint
261
+ theme={props.theme}
262
+ keys="a"
263
+ label="Attention"
264
+ quiet
265
+ button
266
+ onPress={() => {
267
+ if (props.inputActive) props.onToggleAttention?.();
268
+ }}
269
+ />
270
+ }
271
+ >
272
+ <For
273
+ each={
274
+ [
275
+ { key: "0", label: "All", value: "all" },
276
+ { key: "w", label: "Working", value: "working" },
277
+ { key: "a", label: "Needs attention", value: "attention" },
278
+ ] as const
279
+ }
280
+ >
281
+ {(filter) => (
282
+ <KeyHint
283
+ theme={props.theme}
284
+ keys={filter.key}
285
+ label={filter.value === "attention" && width() < 47 ? "Attention" : filter.label}
286
+ quiet
287
+ button
288
+ selected={(props.activityFilter ?? "all") === filter.value}
289
+ onPress={() => {
290
+ if (props.inputActive) props.onSetActivityFilter?.(filter.value);
291
+ }}
292
+ />
293
+ )}
294
+ </For>
295
+ </Show>
296
+ </box>
238
297
  </box>
239
298
  <Show
240
299
  when={props.snapshot.rows.length > 0}
@@ -247,10 +306,18 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
247
306
  >
248
307
  <Show when={props.snapshot.phase === "live" && !props.query}>
249
308
  <text height={1} width={width()} fg={props.theme.roles.text.primary}>
250
- {clipTerminal("Your next session starts here", width())}
309
+ {clipTerminal(
310
+ filtered() ? "No agents match these filters" : "Your next session starts here",
311
+ width(),
312
+ )}
251
313
  </text>
252
314
  <text height={1} width={width()} fg={props.theme.roles.text.muted}>
253
- {clipTerminal("Open terminals, or use Commands to connect a machine.", width())}
315
+ {clipTerminal(
316
+ filtered()
317
+ ? "Choose All or change the machine filter to see more agents."
318
+ : "Open terminals, or use Commands to connect a machine.",
319
+ width(),
320
+ )}
254
321
  </text>
255
322
  </Show>
256
323
  </box>
@@ -280,6 +347,7 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
280
347
  backgroundColor={
281
348
  componentPalette(props.theme, {
282
349
  selected: props.selection.selectedKey === key,
350
+ hovered: hovered() === key,
283
351
  disabled: row().paneId === null || stale(row()),
284
352
  }).background
285
353
  }
@@ -340,6 +408,7 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
340
408
  bg={
341
409
  componentPalette(props.theme, {
342
410
  selected: props.selection.selectedKey === key,
411
+ hovered: hovered() === key,
343
412
  disabled: row().paneId === null || stale(row()),
344
413
  }).background
345
414
  }
@@ -373,7 +442,7 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
373
442
  onQueryChange()(applicationPaneRenamePaste(props.query ?? "", bytes))
374
443
  }
375
444
  onEditing={setEditing}
376
- onSubmit={openSelected}
445
+ onSubmit={() => openSelected()}
377
446
  />
378
447
  </box>
379
448
  )}
@@ -381,9 +450,27 @@ export function HomeAgentRoster(props: HomeAgentRosterProps) {
381
450
  <text width={width()} height={1} flexShrink={0} fg={props.theme.roles.text.muted}>
382
451
  {clipTerminal(coverage(), width())}
383
452
  </text>
384
- <text width={width()} height={1} flexShrink={0} fg={props.theme.roles.text.muted}>
385
- {clipTerminal(footer(), width())}
386
- </text>
453
+ <box width={width()} height={1} flexShrink={0} flexDirection="row" overflow="hidden">
454
+ <text
455
+ width={Math.min(
456
+ Math.max(0, width() - (footer().endsWith("Enter open") && width() >= 20 ? 12 : 0)),
457
+ terminalDisplayWidth(footer().replace(/ Enter open$/u, "")),
458
+ )}
459
+ fg={props.theme.roles.text.muted}
460
+ >
461
+ {clipTerminal(footer().replace(/ Enter open$/u, ""), width())}
462
+ </text>
463
+ <Show when={footer().endsWith("Enter open") && width() >= 20}>
464
+ <KeyHint
465
+ theme={props.theme}
466
+ keys="Enter"
467
+ label="open"
468
+ quiet
469
+ button
470
+ onPress={() => openSelected("mouse")}
471
+ />
472
+ </Show>
473
+ </box>
387
474
  <Show when={showRecovery()}>
388
475
  <box height={1} width={width()} flexShrink={0} flexDirection="row" gap={1}>
389
476
  <Show
@@ -30,6 +30,8 @@ export type ApplicationHomeAgentPresentation = Pick<
30
30
  | "agentQuery"
31
31
  | "onAgentQueryChange"
32
32
  | "agentFilterLabel"
33
+ | "agentActivityFilter"
34
+ | "onSetAgentActivityFilter"
33
35
  | "onCycleAgentMachine"
34
36
  | "onToggleAgentAttention"
35
37
  | "agentRoster"
@@ -11,6 +11,7 @@ import type { ApplicationHomeAgentPresentation } from "./application-home-agents
11
11
  export interface HomeFleetFilter {
12
12
  readonly machineId: string | null;
13
13
  readonly attentionOnly: boolean;
14
+ readonly workingOnly?: boolean;
14
15
  readonly query?: string;
15
16
  }
16
17
  export function projectHomeFleet(
@@ -54,6 +55,15 @@ export function projectHomeFleet(
54
55
  !(agent.attention || agent.activity === "waiting" || agent.activity === "failed")
55
56
  )
56
57
  continue;
58
+ if (
59
+ filter.workingOnly &&
60
+ (agent.disabled ||
61
+ group?.available === false ||
62
+ unavailable.has(sessionKey) ||
63
+ machine.state !== "ready" ||
64
+ agent.activity !== "running")
65
+ )
66
+ continue;
57
67
  const paneKey = agent.paneId
58
68
  ? JSON.stringify([machine.id, agent.server?.serverId, agent.daemonInstanceId, agent.paneId])
59
69
  : agent.id;
@@ -166,7 +176,7 @@ export function createApplicationHomeFleetOwner(options: {
166
176
  return options.inputActive();
167
177
  },
168
178
  get agentFilterLabel() {
169
- return `${catalog().groups.find((group) => group.id === filter().machineId)?.label ?? "All machines"} · ${filter().attentionOnly ? "Needs attention" : "All agents"}`;
179
+ return `${catalog().groups.find((group) => group.id === filter().machineId)?.label ?? "All machines"} · ${filter().attentionOnly ? "Needs attention" : filter().workingOnly ? "Working" : "All agents"}`;
170
180
  },
171
181
  onCycleAgentMachine() {
172
182
  const ids = [null, ...catalog().groups.map((group) => group.id)];
@@ -175,8 +185,18 @@ export function createApplicationHomeFleetOwner(options: {
175
185
  machineId: ids[(ids.indexOf(value.machineId) + 1) % ids.length]!,
176
186
  }));
177
187
  },
188
+ get agentActivityFilter() {
189
+ return filter().attentionOnly ? "attention" : filter().workingOnly ? "working" : "all";
190
+ },
191
+ onSetAgentActivityFilter(activity) {
192
+ setFilter((value) => ({
193
+ ...value,
194
+ attentionOnly: activity === "attention",
195
+ workingOnly: activity === "working",
196
+ }));
197
+ },
178
198
  onToggleAgentAttention() {
179
- setFilter((value) => ({ ...value, attentionOnly: !value.attentionOnly }));
199
+ setFilter((value) => ({ ...value, attentionOnly: !value.attentionOnly, workingOnly: false }));
180
200
  },
181
201
  onRetryAgents: () => options.agents.retry?.(),
182
202
  onLoadMoreAgents: () => options.agents.loadMore?.(),
@@ -117,8 +117,8 @@ export function ApplicationMachineSidebar(props: {
117
117
  readonly theme: SemanticThemeSnapshot;
118
118
  readonly agents?: JSX.Element;
119
119
  readonly agentRows?: number;
120
+ readonly onHelp?: (source: "keyboard" | "mouse") => void;
120
121
  }) {
121
- const [showHelp, setShowHelp] = createSignal(false);
122
122
  const [localFocused, setLocalFocused] = createSignal(false);
123
123
  const focused = () => props.model.focused?.() ?? localFocused();
124
124
  const [localCollapsed, setCollapsed] = createSignal<ReadonlySet<string>>(new Set());
@@ -141,8 +141,6 @@ export function ApplicationMachineSidebar(props: {
141
141
  const start = Math.max(0, active - tabHeight() + 1);
142
142
  return tabs.slice(start, start + tabHeight());
143
143
  };
144
- const helpHeight = () =>
145
- showHelp() ? Math.min(5, Math.max(0, Math.floor(props.height / 3))) : 0;
146
144
  const machineHeight = () =>
147
145
  Math.max(
148
146
  0,
@@ -152,7 +150,6 @@ export function ApplicationMachineSidebar(props: {
152
150
  agentHeight() -
153
151
  controlsHeight() -
154
152
  searchHeight() -
155
- helpHeight() -
156
153
  tabHeight(),
157
154
  );
158
155
  const active = (row: Row) =>
@@ -378,7 +375,7 @@ export function ApplicationMachineSidebar(props: {
378
375
  event.preventDefault();
379
376
  event.stopPropagation();
380
377
  if (key === "help") {
381
- setShowHelp(!showHelp());
378
+ props.onHelp?.("keyboard");
382
379
  return true;
383
380
  }
384
381
  if (key === "search") {
@@ -386,10 +383,6 @@ export function ApplicationMachineSidebar(props: {
386
383
  return true;
387
384
  }
388
385
  if (key === "escape") {
389
- if (showHelp()) {
390
- setShowHelp(false);
391
- return true;
392
- }
393
386
  setLocalFocused(false);
394
387
  props.model.onBlur?.();
395
388
  return true;
@@ -471,7 +464,7 @@ export function ApplicationMachineSidebar(props: {
471
464
  label={props.width >= 20 ? "Help" : undefined}
472
465
  quiet
473
466
  button
474
- onPress={() => setShowHelp(!showHelp())}
467
+ onPress={() => props.onHelp?.("mouse")}
475
468
  />
476
469
  </box>
477
470
  <For each={visibleTabs()}>
@@ -657,13 +650,6 @@ export function ApplicationMachineSidebar(props: {
657
650
  </scrollbox>
658
651
  )}
659
652
  </For>
660
- <Show when={helpHeight() > 0}>
661
- <text height={helpHeight()} fg={props.theme.roles.text.secondary}>
662
- {
663
- "j/k ↑↓ move · g/G ends\nPgUp/Dn · Ctrl-U/D half\nh/l ←→ collapse/expand\nEnter open · / search\nf favorite · Esc terminal"
664
- }
665
- </text>
666
- </Show>
667
653
  <Show when={props.model.onOpenSwitcher}>
668
654
  <KeyHint
669
655
  theme={props.theme}
@@ -39,7 +39,7 @@ export function createApplicationPaletteCommandOwner(options: {
39
39
  readonly disabledReason?: (command: ApplicationPaletteCommand) => string | null;
40
40
  readonly targetKey?: () => string;
41
41
  }) {
42
- const [referencePage, setReferencePage] = createSignal<"shortcuts" | "changes">();
42
+ const [referencePage, setReferencePage] = createSignal<"shortcuts" | "changes" | "help">();
43
43
  const [closeArmed, setCloseArmed] = createSignal(false);
44
44
  const [busy, setBusy] = createSignal(false);
45
45
  let armedTarget: string | undefined;
@@ -44,7 +44,7 @@ const releases = [
44
44
  type Row = { kind: "heading" | "text" | "action" | "gap"; label: string; detail?: string };
45
45
 
46
46
  export function ApplicationReferenceSheet(props: {
47
- page: "shortcuts" | "changes";
47
+ page: "shortcuts" | "changes" | "help";
48
48
  width: number;
49
49
  height: number;
50
50
  theme: SemanticThemeSnapshot;
@@ -78,7 +78,48 @@ export function ApplicationReferenceSheet(props: {
78
78
  }
79
79
  if (!result.length) result.push({ kind: "text", label: "No matching shortcuts" });
80
80
  } else {
81
- for (const release of releases) {
81
+ const sections =
82
+ page() === "help"
83
+ ? [
84
+ {
85
+ version: "Find your work",
86
+ lines: [
87
+ "Machines are your local computer and connected SSH hosts. Each session contains terminal windows and panes.",
88
+ "Open a session or agent in the sidebar to jump to its terminal. Home brings agents from your connected machines together.",
89
+ ],
90
+ },
91
+ {
92
+ version: "Move around",
93
+ lines: [
94
+ "F1 Home · F2 Terminals · F6 Sessions · F7 Attention",
95
+ "F10 shows or hides the sidebar. F5 opens Commands for actions, appearance and keyboard shortcuts.",
96
+ ],
97
+ },
98
+ {
99
+ version: "Use the sidebar",
100
+ lines: [
101
+ "Click a row to open it. With the sidebar focused, use ↑↓ or j/k to move and Enter to open.",
102
+ "←→ or h/l collapse/expand machines. / searches sessions. f toggles a session favorite. Esc returns to the terminal.",
103
+ "PgUp/PgDn scroll a page; Ctrl-U/D scroll half a page. g/G jump to the first or last row.",
104
+ ],
105
+ },
106
+ {
107
+ version: "Follow your agents",
108
+ lines: [
109
+ "On Home, search by name and choose All, Working or Needs attention. Select an agent and press Enter to open its pane.",
110
+ "Unavailable means the connection or observation is missing; it does not mean the agent has stopped.",
111
+ ],
112
+ },
113
+ {
114
+ version: "Connect another machine",
115
+ lines: [
116
+ "Choose Add machine in the sidebar and enter an SSH alias or user@host. Set up SSH key access and host trust first.",
117
+ "Run tmux-ide --headless on the remote machine before connecting.",
118
+ ],
119
+ },
120
+ ]
121
+ : releases;
122
+ for (const release of sections) {
82
123
  if (result.length) result.push({ kind: "gap", label: "" });
83
124
  result.push({ kind: "heading", label: release.version });
84
125
  for (const line of release.lines) {
@@ -139,8 +180,18 @@ export function ApplicationReferenceSheet(props: {
139
180
  viewportHeight={props.height}
140
181
  width={metrics().width}
141
182
  height={metrics().height}
142
- title={page() === "shortcuts" ? "Keyboard shortcuts" : "What's new"}
143
- footer="Tab switch sheet · ↑↓ scroll · Esc back"
183
+ title={
184
+ page() === "help"
185
+ ? "Using tmux-ide"
186
+ : page() === "shortcuts"
187
+ ? "Keyboard shortcuts"
188
+ : "What's new"
189
+ }
190
+ footer={
191
+ page() === "help"
192
+ ? "Tab shortcuts · ↑↓ scroll · Esc back"
193
+ : "Tab switch sheet · ↑↓ scroll · Esc back"
194
+ }
144
195
  zIndex={100}
145
196
  onDismiss={props.onClose}
146
197
  >
@@ -51,8 +51,8 @@ export interface ApplicationCatalogShellProps {
51
51
  readonly paletteSelection?: Accessor<number>;
52
52
  readonly palettePreviewActive?: Accessor<boolean>;
53
53
  readonly onPaletteModalChange?: (open: boolean) => void;
54
- readonly paletteReferencePage?: Accessor<"shortcuts" | "changes" | undefined>;
55
- readonly onPaletteReferenceChange?: (page: "shortcuts" | "changes" | undefined) => void;
54
+ readonly paletteReferencePage?: Accessor<"shortcuts" | "changes" | "help" | undefined>;
55
+ readonly onPaletteReferenceChange?: (page: "shortcuts" | "changes" | "help" | undefined) => void;
56
56
  readonly paletteKeyboardHint?: Accessor<string>;
57
57
  readonly paletteQuery?: Accessor<string>;
58
58
  readonly paletteDisabledReason?: (command: ApplicationPaletteCommand) => string | null;
@@ -418,6 +418,10 @@ export function ApplicationCatalogShell(props: ApplicationCatalogShellProps): JS
418
418
  {(model) => (
419
419
  <ApplicationMachineSidebar
420
420
  model={model()}
421
+ onHelp={(source) => {
422
+ props.onSetPaletteOpen(true, source);
423
+ props.onPaletteReferenceChange?.("help");
424
+ }}
421
425
  width={chrome().sidebar.width}
422
426
  height={chrome().sidebar.height}
423
427
  theme={props.theme}
@@ -44,6 +44,8 @@ export interface ApplicationHomeSurfaceProps {
44
44
  readonly agentQuery?: string;
45
45
  readonly onAgentQueryChange?: (query: string) => void;
46
46
  readonly agentFilterLabel?: string;
47
+ readonly agentActivityFilter?: "all" | "working" | "attention";
48
+ readonly onSetAgentActivityFilter?: (value: "all" | "working" | "attention") => void;
47
49
  readonly onCycleAgentMachine?: () => void;
48
50
  readonly onToggleAgentAttention?: () => void;
49
51
  readonly agentRoster?: HomeAgentSnapshot;
@@ -74,6 +76,7 @@ export function ApplicationHomeSurface(props: ApplicationHomeSurfaceProps): JSX.
74
76
  props.agentRoster?.phase === "live" &&
75
77
  props.agentRoster.rows.length === 0 &&
76
78
  !props.agentQuery &&
79
+ (!props.agentActivityFilter || props.agentActivityFilter === "all") &&
77
80
  applicationHomeBrandVariant(bodyWidth(), height()) === "ascii";
78
81
  const brandRows = () => (showAscii() ? APPLICATION_HOME_WORDMARK.length : 1);
79
82
  const spacious = () => height() >= 14;
@@ -241,6 +244,8 @@ export function ApplicationHomeSurface(props: ApplicationHomeSurfaceProps): JSX.
241
244
  query={props.agentQuery}
242
245
  onQueryChange={props.onAgentQueryChange}
243
246
  filterLabel={props.agentFilterLabel}
247
+ activityFilter={props.agentActivityFilter}
248
+ onSetActivityFilter={props.onSetAgentActivityFilter}
244
249
  onCycleMachine={props.onCycleAgentMachine}
245
250
  onToggleAttention={props.onToggleAgentAttention}
246
251
  theme={props.theme}
@@ -106,8 +106,8 @@ export function MinimalPalette(props: {
106
106
  readonly title?: string;
107
107
  readonly onViewport?: (rows: number) => void;
108
108
  readonly onFavorite?: (command: ApplicationPaletteCommand) => void;
109
- readonly referencePage?: "shortcuts" | "changes";
110
- readonly onReferenceChange?: (page: "shortcuts" | "changes" | undefined) => void;
109
+ readonly referencePage?: "shortcuts" | "changes" | "help";
110
+ readonly onReferenceChange?: (page: "shortcuts" | "changes" | "help" | undefined) => void;
111
111
  readonly keyboardHint?: string;
112
112
  readonly previewActive?: boolean;
113
113
  readonly onModalChange?: (open: boolean) => void;
@@ -123,8 +123,8 @@ export function MinimalPalette(props: {
123
123
  }): JSX.Element {
124
124
  const [expanded, setExpanded] = createSignal(false);
125
125
  const [modal, setModal] = createSignal(false);
126
- const [sheet, setSheet] = createSignal<"shortcuts" | "changes">();
127
- const openSheet = (page: "shortcuts" | "changes" | undefined) => {
126
+ const [sheet, setSheet] = createSignal<"shortcuts" | "changes" | "help">();
127
+ const openSheet = (page: "shortcuts" | "changes" | "help" | undefined) => {
128
128
  props.onReferenceChange?.(page);
129
129
  setSheet(page);
130
130
  setModal(!!page);
@@ -100,8 +100,8 @@ export interface ApplicationShellViewProps {
100
100
  readonly paletteOpen: Accessor<boolean>;
101
101
  readonly paneRenameDialog?: Accessor<ApplicationPaneRenameDraft | null>;
102
102
  readonly paletteSelection?: Accessor<number>;
103
- readonly paletteReferencePage?: Accessor<"shortcuts" | "changes" | undefined>;
104
- readonly onPaletteReferenceChange?: (page: "shortcuts" | "changes" | undefined) => void;
103
+ readonly paletteReferencePage?: Accessor<"shortcuts" | "changes" | "help" | undefined>;
104
+ readonly onPaletteReferenceChange?: (page: "shortcuts" | "changes" | "help" | undefined) => void;
105
105
  readonly paletteKeyboardHint?: Accessor<string>;
106
106
  readonly palettePreviewActive?: Accessor<boolean>;
107
107
  readonly onPaletteModalChange?: (open: boolean) => void;
@@ -455,6 +455,10 @@ export function ApplicationShellView(props: ApplicationShellViewProps): JSX.Elem
455
455
  {(model) => (
456
456
  <ApplicationMachineSidebar
457
457
  model={model()}
458
+ onHelp={(source) => {
459
+ props.onSetPaletteOpen(true, source);
460
+ props.onPaletteReferenceChange?.("help");
461
+ }}
458
462
  agentRows={
459
463
  model()
460
464
  .groups()
@@ -23,14 +23,18 @@ export function KeyHint(props: KeyHintProps) {
23
23
  const palette = () => componentPalette(props.theme, props, "neutral");
24
24
  const background = () =>
25
25
  props.button
26
- ? props.theme.roles.surfaces.panelRaised
26
+ ? props.selected
27
+ ? props.theme.roles.selection.selection
28
+ : props.theme.roles.surfaces.panelRaised
27
29
  : props.quiet && !props.focused && !props.hovered
28
30
  ? props.theme.roles.surfaces.panel
29
31
  : palette().background;
30
32
  const foreground = () =>
31
- props.quiet && !props.focused && !props.hovered
32
- ? props.theme.roles.text.muted
33
- : palette().foreground;
33
+ props.selected
34
+ ? props.theme.roles.selection.selectionText
35
+ : props.quiet && !props.focused && !props.hovered
36
+ ? props.theme.roles.text.muted
37
+ : palette().foreground;
34
38
  const text = () => props.presentation ?? `${props.keys}${props.label ? ` ${props.label}` : ""}`;
35
39
  const width = () => Math.max(1, Math.floor(props.width ?? terminalDisplayWidth(text()) + 2));
36
40
  const content = () => clipTerminal(props.presentation ?? ` ${text()} `, width());