refactor(app): use button shortcut in shell tray
parent
f714300e9a
commit
01d80f37dd
|
|
@ -19,9 +19,9 @@ import { useSDK } from "@/context/sdk"
|
||||||
import { useSync } from "@/context/sync"
|
import { useSync } from "@/context/sync"
|
||||||
import { useComments } from "@/context/comments"
|
import { useComments } from "@/context/comments"
|
||||||
import { Button } from "@opencode-ai/ui/button"
|
import { Button } from "@opencode-ai/ui/button"
|
||||||
|
import { ButtonShortcut } from "@opencode-ai/ui/button-shortcut"
|
||||||
import { DockShellForm, DockTray } from "@opencode-ai/ui/dock-surface"
|
import { DockShellForm, DockTray } from "@opencode-ai/ui/dock-surface"
|
||||||
import { Icon } from "@opencode-ai/ui/icon"
|
import { Icon } from "@opencode-ai/ui/icon"
|
||||||
import { Keybind } from "@opencode-ai/ui/keybind"
|
|
||||||
import { ProviderIcon } from "@opencode-ai/ui/provider-icon"
|
import { ProviderIcon } from "@opencode-ai/ui/provider-icon"
|
||||||
import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip"
|
import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip"
|
||||||
import { IconButton } from "@opencode-ai/ui/icon-button"
|
import { IconButton } from "@opencode-ai/ui/icon-button"
|
||||||
|
|
@ -1584,20 +1584,19 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<div class="absolute inset-y-0 right-0 flex items-center" style={shell()}>
|
<div class="absolute inset-y-0 right-0 flex items-center" style={shell()}>
|
||||||
<Button
|
<ButtonShortcut
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="small"
|
size="small"
|
||||||
|
shortcut="Esc"
|
||||||
|
shortcutAria="Escape"
|
||||||
class="h-6 gap-2 rounded-[6px] border-none px-0 py-0 pl-3 pr-0.75 text-13-medium text-text-base shadow-none"
|
class="h-6 gap-2 rounded-[6px] border-none px-0 py-0 pl-3 pr-0.75 text-13-medium text-text-base shadow-none"
|
||||||
tabIndex={store.mode === "shell" ? undefined : -1}
|
tabIndex={store.mode === "shell" ? undefined : -1}
|
||||||
onClick={() => setMode("normal")}
|
onClick={() => setMode("normal")}
|
||||||
aria-label={language.t("common.cancel")}
|
aria-label={language.t("common.cancel")}
|
||||||
>
|
>
|
||||||
<span>{language.t("common.cancel")}</span>
|
{language.t("common.cancel")}
|
||||||
<Keybind class="h-[18px] rounded-[3px] px-1 !bg-surface-raised-base !text-13-regular !text-text-weak !shadow-none">
|
</ButtonShortcut>
|
||||||
{language.t("common.key.esc")}
|
|
||||||
</Keybind>
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue