diff --git a/packages/opencode/src/cli/cmd/run/footer.view.tsx b/packages/opencode/src/cli/cmd/run/footer.view.tsx index 1989f5f70f..bd37c1b211 100644 --- a/packages/opencode/src/cli/cmd/run/footer.view.tsx +++ b/packages/opencode/src/cli/cmd/run/footer.view.tsx @@ -155,23 +155,30 @@ export function RunFooterView(props: RunFooterViewProps) { const current = route() return current.type === "subagent" ? subagent().details[current.sessionID] : undefined }) - const command = useKeymapSelector((keymap: OpenTuiKeymap) => - formatKeyBindings( - keymap.getCommandBindings({ visibility: "registered", commands: ["command.palette.show"] }).get("command.palette.show"), - props.tuiConfig, - ) ?? "", + const command = useKeymapSelector( + (keymap: OpenTuiKeymap) => + formatKeyBindings( + keymap + .getCommandBindings({ visibility: "registered", commands: ["command.palette.show"] }) + .get("command.palette.show"), + props.tuiConfig, + ) ?? "", ) - const interrupt = useKeymapSelector((keymap: OpenTuiKeymap) => - formatKeyBindings( - keymap.getCommandBindings({ visibility: "registered", commands: ["session.interrupt"] }).get("session.interrupt"), - props.tuiConfig, - ) ?? "", + const interrupt = useKeymapSelector( + (keymap: OpenTuiKeymap) => + formatKeyBindings( + keymap + .getCommandBindings({ visibility: "registered", commands: ["session.interrupt"] }) + .get("session.interrupt"), + props.tuiConfig, + ) ?? "", ) - const variantCycle = useKeymapSelector((keymap: OpenTuiKeymap) => - formatKeyBindings( - keymap.getCommandBindings({ visibility: "registered", commands: ["variant.cycle"] }).get("variant.cycle"), - props.tuiConfig, - ) ?? "", + const variantCycle = useKeymapSelector( + (keymap: OpenTuiKeymap) => + formatKeyBindings( + keymap.getCommandBindings({ visibility: "registered", commands: ["variant.cycle"] }).get("variant.cycle"), + props.tuiConfig, + ) ?? "", ) const hints = createMemo(() => hintFlags(term().width)) const busy = createMemo(() => props.state().phase === "running") diff --git a/packages/opencode/src/cli/cmd/run/runtime.ts b/packages/opencode/src/cli/cmd/run/runtime.ts index ae4d3ad267..2e2b07398e 100644 --- a/packages/opencode/src/cli/cmd/run/runtime.ts +++ b/packages/opencode/src/cli/cmd/run/runtime.ts @@ -185,11 +185,7 @@ async function runInteractiveRuntime(input: RunRuntimeInput): Promise { variant: undefined, }) const savedTask = resolveSavedVariant(ctx.model) - const [tuiConfig, session, savedVariant] = await Promise.all([ - tuiConfigTask, - sessionTask, - savedTask, - ]) + const [tuiConfig, session, savedVariant] = await Promise.all([tuiConfigTask, sessionTask, savedTask]) const state: RuntimeState = { shown: !session.first, aborting: false, diff --git a/packages/opencode/src/cli/cmd/tui/keymap.tsx b/packages/opencode/src/cli/cmd/tui/keymap.tsx index cd46e8ccc7..461b204a20 100644 --- a/packages/opencode/src/cli/cmd/tui/keymap.tsx +++ b/packages/opencode/src/cli/cmd/tui/keymap.tsx @@ -196,10 +196,7 @@ export function formatKeySequence(parts: Parameters[0], - config: FormatConfig, -) { +export function formatKeyBindings(bindings: Parameters[0], config: FormatConfig) { return formatCommandBindingsExtra(bindings, formatOptions(config)) } diff --git a/packages/opencode/test/cli/run/footer.view.test.tsx b/packages/opencode/test/cli/run/footer.view.test.tsx index d20707e5b5..214f4637d3 100644 --- a/packages/opencode/test/cli/run/footer.view.test.tsx +++ b/packages/opencode/test/cli/run/footer.view.test.tsx @@ -178,18 +178,18 @@ async function renderFooter(input: { tuiConfig?: RunTuiConfig; onCycle?: () => v tuiConfig={config} agent="opencode" onSubmit={() => true} - onPermissionReply={() => { }} - onQuestionReply={() => { }} - onQuestionReject={() => { }} - onCycle={input.onCycle ?? (() => { })} + onPermissionReply={() => {}} + onQuestionReply={() => {}} + onQuestionReject={() => {}} + onCycle={input.onCycle ?? (() => {})} onInterrupt={() => false} - onInputClear={() => { }} - onExit={() => { }} - onModelSelect={() => { }} - onVariantSelect={() => { }} - onRows={() => { }} - onLayout={() => { }} - onStatus={() => { }} + onInputClear={() => {}} + onExit={() => {}} + onModelSelect={() => {}} + onVariantSelect={() => {}} + onRows={() => {}} + onLayout={() => {}} + onStatus={() => {}} /> ) @@ -278,14 +278,14 @@ test("direct command panel renders grouped command palette", async () => { subagents={subagents} variants={variants} variantCycle="ctrl+t" - onClose={() => { }} - onModel={() => { }} - onSubagent={() => { }} - onVariant={() => { }} - onVariantCycle={() => { }} - onCommand={() => { }} - onNew={() => { }} - onExit={() => { }} + onClose={() => {}} + onModel={() => {}} + onSubagent={() => {}} + onVariant={() => {}} + onVariantCycle={() => {}} + onCommand={() => {}} + onNew={() => {}} + onExit={() => {}} /> ), @@ -336,14 +336,14 @@ test("direct command panel shows subagent entry when available", async () => { subagents={subagents} variants={variants} variantCycle="ctrl+t" - onClose={() => { }} - onModel={() => { }} - onSubagent={() => { }} - onVariant={() => { }} - onVariantCycle={() => { }} - onCommand={() => { }} - onNew={() => { }} - onExit={() => { }} + onClose={() => {}} + onModel={() => {}} + onSubagent={() => {}} + onVariant={() => {}} + onVariantCycle={() => {}} + onCommand={() => {}} + onNew={() => {}} + onExit={() => {}} /> ), @@ -379,8 +379,8 @@ test("direct subagent panel renders active subagents", async () => { theme={() => RUN_THEME_FALLBACK.footer} tabs={tabs} current={current} - onClose={() => { }} - onSelect={() => { }} + onClose={() => {}} + onSelect={() => {}} onRows={(value) => { rows = value }} @@ -506,18 +506,18 @@ test("direct footer shows subagent indicator while prompt is running", async () tuiConfig={tuiConfig} agent="opencode" onSubmit={() => true} - onPermissionReply={() => { }} - onQuestionReply={() => { }} - onQuestionReject={() => { }} - onCycle={() => { }} + onPermissionReply={() => {}} + onQuestionReply={() => {}} + onQuestionReject={() => {}} + onCycle={() => {}} onInterrupt={() => false} - onInputClear={() => { }} - onExit={() => { }} - onModelSelect={() => { }} - onVariantSelect={() => { }} - onRows={() => { }} - onLayout={() => { }} - onStatus={() => { }} + onInputClear={() => {}} + onExit={() => {}} + onModelSelect={() => {}} + onVariantSelect={() => {}} + onRows={() => {}} + onLayout={() => {}} + onStatus={() => {}} /> ) @@ -572,7 +572,7 @@ test("direct question body separates single-select checkmark from label", async onReply={(input) => { replies.push(input) }} - onReject={() => { }} + onReject={() => {}} /> ), @@ -622,7 +622,7 @@ test("direct custom answer submits through keymap return binding", async () => { onReply={(input) => { questions.push(input) }} - onReject={() => { }} + onReject={() => {}} /> ) @@ -676,7 +676,7 @@ test("direct permission rejection submits through keymap return binding", async onConfirm={() => { submits.push(text) }} - onCancel={() => { }} + onCancel={() => {}} /> ) @@ -718,8 +718,8 @@ test("direct model panel renders current model selector", async () => { theme={() => RUN_THEME_FALLBACK.footer} providers={providers} current={current} - onClose={() => { }} - onSelect={() => { }} + onClose={() => {}} + onSelect={() => {}} /> ), @@ -757,8 +757,8 @@ test("direct variant panel renders current variant selector", async () => { theme={() => RUN_THEME_FALLBACK.footer} variants={variants} current={current} - onClose={() => { }} - onSelect={() => { }} + onClose={() => {}} + onSelect={() => {}} /> ),