mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 09:14:22 +01:00
Updated help dialog to use dynamic keybind (#4414)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a1214fff2e
commit
154006469c
@@ -2,10 +2,12 @@ import { TextAttributes } from "@opentui/core"
|
|||||||
import { useTheme } from "@tui/context/theme"
|
import { useTheme } from "@tui/context/theme"
|
||||||
import { useDialog } from "./dialog"
|
import { useDialog } from "./dialog"
|
||||||
import { useKeyboard } from "@opentui/solid"
|
import { useKeyboard } from "@opentui/solid"
|
||||||
|
import { useKeybind } from "@tui/context/keybind"
|
||||||
|
|
||||||
export function DialogHelp() {
|
export function DialogHelp() {
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
|
const keybind = useKeybind()
|
||||||
|
|
||||||
useKeyboard((evt) => {
|
useKeyboard((evt) => {
|
||||||
if (evt.name === "return" || evt.name === "escape") {
|
if (evt.name === "return" || evt.name === "escape") {
|
||||||
@@ -20,7 +22,9 @@ export function DialogHelp() {
|
|||||||
<text fg={theme.textMuted}>esc/enter</text>
|
<text fg={theme.textMuted}>esc/enter</text>
|
||||||
</box>
|
</box>
|
||||||
<box paddingBottom={1}>
|
<box paddingBottom={1}>
|
||||||
<text fg={theme.textMuted}>Press Ctrl+P to see all available actions and commands in any context.</text>
|
<text fg={theme.textMuted}>
|
||||||
|
Press {keybind.print("command_list")} to see all available actions and commands in any context.
|
||||||
|
</text>
|
||||||
</box>
|
</box>
|
||||||
<box flexDirection="row" justifyContent="flex-end" paddingBottom={1}>
|
<box flexDirection="row" justifyContent="flex-end" paddingBottom={1}>
|
||||||
<box paddingLeft={3} paddingRight={3} backgroundColor={theme.primary} onMouseUp={() => dialog.clear()}>
|
<box paddingLeft={3} paddingRight={3} backgroundColor={theme.primary} onMouseUp={() => dialog.clear()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user