Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/tui/src/config/keybind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const Definitions = {
"diff.single_patch": keybind("s", "Toggle single patch view"),
"diff.switch_source": keybind("d", "Switch diff viewer source"),
"diff.toggle_view": keybind("v", "Toggle diff viewer split or unified view"),
"diff.toggle_fullscreen": keybind("f", "Toggle diff viewer full screen"),
"diff.mark_reviewed": keybind("m", "Toggle selected diff file reviewed"),
"diff.help": keybind("?,shift+?,shift+/", "Show more diff viewer shortcuts"),

Expand Down
23 changes: 19 additions & 4 deletions packages/tui/src/feature-plugins/prompt/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Plugin } from "@opencode/plugin/tui"
import { createMemo, createSignal, Match, Show, Switch } from "solid-js"
import { contextUsage, formatContextUsage } from "../../util/session"
import { useTerminalDimensions } from "@opentui/solid"
import { TextAttributes } from "@opentui/core"
import { useInteractivity } from "../../context/interactivity"
import { stringWidth } from "../../util/string-width"

const money = new Intl.NumberFormat("en-US", {
Expand Down Expand Up @@ -47,6 +49,8 @@ export function PromptFooter(props: {
].filter((item): item is string => Boolean(item))
})
const live = createMemo(() => Boolean(subagents() || shells()))
// Prompt hints read as disabled while the session does not own input, e.g. while a side panel is focused.
const interactive = useInteractivity()
const shortcut = (id: string) => props.context.keymap.shortcuts(id)[0]
const layout = createMemo(() => {
const command = shortcut("command.palette.show")
Expand Down Expand Up @@ -93,14 +97,25 @@ export function PromptFooter(props: {
</box>
</Match>
<Match when={props.showDetails && layout().shortcuts}>
<text fg={props.context.theme.text.base} flexShrink={0}>
{shortcut("agent.cycle")} <span style={{ fg: props.context.theme.text.muted }}>agents</span>
<text
fg={interactive() ? props.context.theme.text.base : props.context.theme.text.formfield.disabled}
attributes={interactive() ? 0 : TextAttributes.DIM}
flexShrink={0}
>
{shortcut("agent.cycle")}{" "}
<span style={interactive() ? { fg: props.context.theme.text.muted } : {}}>agents</span>
</text>
</Match>
</Switch>
<Show when={props.showDetails && layout().shortcuts}>
<text fg={props.context.theme.text.base} wrapMode="none" flexShrink={0}>
{shortcut("command.palette.show")} <span style={{ fg: props.context.theme.text.muted }}>commands</span>
<text
fg={interactive() ? props.context.theme.text.base : props.context.theme.text.formfield.disabled}
attributes={interactive() ? 0 : TextAttributes.DIM}
wrapMode="none"
flexShrink={0}
>
{shortcut("command.palette.show")}{" "}
<span style={interactive() ? { fg: props.context.theme.text.muted } : {}}>commands</span>
</text>
</Show>
</Match>
Expand Down
Loading
Loading