diff options
| author | David Hill <[email protected]> | 2026-01-24 18:08:40 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2026-01-24 18:59:07 +0000 |
| commit | e5d2d984b6f753b48dcde8642b0658f992b4c0dd (patch) | |
| tree | 16f2fadd50765b1e442900d427b3946eb86c5003 | |
| parent | bfb0885371d9b5b06ea8bb521f054f3e3b36cb63 (diff) | |
| download | opencode-e5d2d984b6f753b48dcde8642b0658f992b4c0dd.tar.gz opencode-e5d2d984b6f753b48dcde8642b0658f992b4c0dd.zip | |
feat(app): change prompt placeholder based on comment count
| -rw-r--r-- | packages/app/src/components/prompt-input.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index c6f390fb7..3eddbb303 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -123,6 +123,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { const local = useLocal() const files = useFile() const prompt = usePrompt() + const commentCount = createMemo(() => prompt.context.items().filter((item) => !!item.comment?.trim()).length) const layout = useLayout() const comments = useComments() const params = useParams() @@ -1827,7 +1828,11 @@ export const PromptInput: Component<PromptInputProps> = (props) => { aria-label={ store.mode === "shell" ? language.t("prompt.placeholder.shell") - : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) }) + : commentCount() > 1 + ? "Summarize comments…" + : commentCount() === 1 + ? "Summarize comment…" + : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) }) } contenteditable="true" onInput={handleInput} @@ -1847,7 +1852,11 @@ export const PromptInput: Component<PromptInputProps> = (props) => { <div class="absolute top-0 inset-x-0 p-3 pr-12 text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate"> {store.mode === "shell" ? language.t("prompt.placeholder.shell") - : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) })} + : commentCount() > 1 + ? "Summarize comments…" + : commentCount() === 1 + ? "Summarize comment…" + : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) })} </div> </Show> </div> |
