summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2026-03-17 21:14:30 +1000
committerGitHub <[email protected]>2026-03-17 06:14:30 -0500
commitdbbe931a18378215765706ef77750d1ca961d7d4 (patch)
tree0e6a3c39c8869deb1b3536beb3d8cda85958c068
parente14e874e513178ac056cec7be5bac4ff5fd842ef (diff)
downloadopencode-dbbe931a18378215765706ef77750d1ca961d7d4.tar.gz
opencode-dbbe931a18378215765706ef77750d1ca961d7d4.zip
fix(app): avoid prompt tooltip Switch on startup (#17857)
-rw-r--r--packages/app/src/components/prompt-input.tsx36
1 files changed, 19 insertions, 17 deletions
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx
index 4fbc82a70..42b5df9b3 100644
--- a/packages/app/src/components/prompt-input.tsx
+++ b/packages/app/src/components/prompt-input.tsx
@@ -1,6 +1,6 @@
import { useFilteredList } from "@opencode-ai/ui/hooks"
import { useSpring } from "@opencode-ai/ui/motion-spring"
-import { createEffect, on, Component, Show, onCleanup, Switch, Match, createMemo, createSignal } from "solid-js"
+import { createEffect, on, Component, Show, onCleanup, createMemo, createSignal } from "solid-js"
import { createStore } from "solid-js/store"
import { useLocal } from "@/context/local"
import { selectionFromLines, type SelectedLineRange, useFile } from "@/context/file"
@@ -244,6 +244,23 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
},
)
const working = createMemo(() => status()?.type !== "idle")
+ const tip = () => {
+ if (working()) {
+ return (
+ <div class="flex items-center gap-2">
+ <span>{language.t("prompt.action.stop")}</span>
+ <span class="text-icon-base text-12-medium text-[10px]!">{language.t("common.key.esc")}</span>
+ </div>
+ )
+ }
+
+ return (
+ <div class="flex items-center gap-2">
+ <span>{language.t("prompt.action.send")}</span>
+ <Icon name="enter" size="small" class="text-icon-base" />
+ </div>
+ )
+ }
const imageAttachments = createMemo(() =>
prompt.current().filter((part): part is ImageAttachmentPart => part.type === "image"),
)
@@ -1365,22 +1382,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
<Tooltip
placement="top"
inactive={!prompt.dirty() && !working()}
- value={
- <Switch>
- <Match when={working()}>
- <div class="flex items-center gap-2">
- <span>{language.t("prompt.action.stop")}</span>
- <span class="text-icon-base text-12-medium text-[10px]!">{language.t("common.key.esc")}</span>
- </div>
- </Match>
- <Match when={true}>
- <div class="flex items-center gap-2">
- <span>{language.t("prompt.action.send")}</span>
- <Icon name="enter" size="small" class="text-icon-base" />
- </div>
- </Match>
- </Switch>
- }
+ value={tip()}
>
<IconButton
data-action="prompt-submit"