@@ -2,6 +2,8 @@ import { Plugin } from "@opencode/plugin/tui" |
2 | 2 | import { createMemo, createSignal, Match, Show, Switch } from "solid-js" |
3 | 3 | import { contextUsage, formatContextUsage } from "../../util/session" |
4 | 4 | import { useTerminalDimensions } from "@opentui/solid" |
| 5 | +import { TextAttributes } from "@opentui/core" |
| 6 | +import { useInteractivity } from "../../context/interactivity" |
5 | 7 | import { stringWidth } from "../../util/string-width" |
6 | 8 |
|
7 | 9 | const money = new Intl.NumberFormat("en-US", { |
@@ -47,6 +49,8 @@ export function PromptFooter(props: { |
47 | 49 | ].filter((item): item is string => Boolean(item)) |
48 | 50 | }) |
49 | 51 | const live = createMemo(() => Boolean(subagents() || shells())) |
| 52 | + // Prompt hints read as disabled while the session does not own input, e.g. while a side panel is focused. |
| 53 | + const interactive = useInteractivity() |
50 | 54 | const shortcut = (id: string) => props.context.keymap.shortcuts(id)[0] |
51 | 55 | const layout = createMemo(() => { |
52 | 56 | const command = shortcut("command.palette.show") |
@@ -93,14 +97,25 @@ export function PromptFooter(props: { |
93 | 97 | </box> |
94 | 98 | </Match> |
95 | 99 | <Match when={props.showDetails && layout().shortcuts}> |
96 | | - <text fg={props.context.theme.text.base} flexShrink={0}> |
97 | | - {shortcut("agent.cycle")} <span style={{ fg: props.context.theme.text.muted }}>agents</span> |
| 100 | + <text |
| 101 | + fg={interactive() ? props.context.theme.text.base : props.context.theme.text.formfield.disabled} |
| 102 | + attributes={interactive() ? 0 : TextAttributes.DIM} |
| 103 | + flexShrink={0} |
| 104 | + > |
| 105 | + {shortcut("agent.cycle")}{" "} |
| 106 | + <span style={interactive() ? { fg: props.context.theme.text.muted } : {}}>agents</span> |
98 | 107 | </text> |
99 | 108 | </Match> |
100 | 109 | </Switch> |
101 | 110 | <Show when={props.showDetails && layout().shortcuts}> |
102 | | - <text fg={props.context.theme.text.base} wrapMode="none" flexShrink={0}> |
103 | | - {shortcut("command.palette.show")} <span style={{ fg: props.context.theme.text.muted }}>commands</span> |
| 111 | + <text |
| 112 | + fg={interactive() ? props.context.theme.text.base : props.context.theme.text.formfield.disabled} |
| 113 | + attributes={interactive() ? 0 : TextAttributes.DIM} |
| 114 | + wrapMode="none" |
| 115 | + flexShrink={0} |
| 116 | + > |
| 117 | + {shortcut("command.palette.show")}{" "} |
| 118 | + <span style={interactive() ? { fg: props.context.theme.text.muted } : {}}>commands</span> |
104 | 119 | </text> |
105 | 120 | </Show> |
106 | 121 | </Match> |
|