The open source coding agent.
TypeScript
fix(app): avoid prompt tooltip Switch on startup (#17857)
Luke Parkerdbbe931a1837
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsxindex 4fbc82a7068..42b5df9b30c 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) => {<Tooltipplacement="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()}><IconButtondata-action="prompt-submit"