From b9ca30de214aaa0bfa037b6efefbafc6983cfba3 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Sun, 4 Oct 2026 04:45:05 +0800 Subject: [PATCH] style: strip the composer down to a bare editor The multi-line composer had a field label, a description block explaining the Return / cmd-return split, and an instructional placeholder. That is three competing pieces of chrome wrapped around one text area, and the action bar already renders "Send cmd-return" next to the button, so the description was restating what the UI shows. Now it is a single bare Form.TextArea: no label, no description, a one-line placeholder. Also documents why it cannot go further. Vicinae always renders a Form.TextArea inside FormField (ExtensionFormView.qml -> textareaFieldComp) and FormField.qml lays out as 2/5/2 proportional columns: a label gutter, the editor, and an empty right spacer. The editor therefore gets roughly five ninths of the width, and the right spacer stays even with no label. None of it is reachable from the extension API, so the only lever available is removing clutter, not reclaiming width. Verified: typecheck, eslint, 96 tests, vici build all pass. Not verified: the rendered result. osascript on this machine has no Accessibility permission, so the launcher UI could not be driven. --- src/lib/components/ComposeForm.tsx | 38 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/lib/components/ComposeForm.tsx b/src/lib/components/ComposeForm.tsx index 9ab665c..a149d1f 100644 --- a/src/lib/components/ComposeForm.tsx +++ b/src/lib/components/ComposeForm.tsx @@ -1,14 +1,34 @@ -import { useNavigation } from "@vicinae/api"; -import { Form, Action, ActionPanel, Icon } from "@vicinae/api"; +import { Action, ActionPanel, Form, Icon, useNavigation } from "@vicinae/api"; import { useState } from "react"; /** * The multi-line composer. * - * This exists because the launcher's search bar is single-line and there is no - * API to change that. Pressing ⌘↩ in the chat view pushes this view, where a - * real multi-line text area gives the behaviour people expect from a chat box: - * Return inserts a newline, and ⌘↩ sends. + * This view exists because the launcher's search bar is single-line and there + * is no API to change that. Pressing ⌘↩ in the chat view pushes this view, where + * a real multi-line text area gives the behaviour people expect from a chat box: + * Return inserts a newline, ⌘↩ sends. + * + * It is deliberately stripped down to a single bare editor: + * + * - no field label, so nothing competes with the text itself + * - no description block, because the action bar already renders "Send ⌘↩" + * next to the button, which documents the shortcut without a paragraph + * - the placeholder is one short line rather than an instructions sentence + * + * ## The width limit + * + * A `Form.TextArea` cannot be made truly full-width from the extension API. + * Vicinae always renders it inside its `FormField` component + * (`ExtensionFormView.qml` → `textareaFieldComp`), and `FormField.qml` always + * lays out as three columns with proportional widths 2 / 5 / 2 — a label + * gutter, the editor, and an empty right spacer. That leaves roughly five + * ninths of the width for the editor, and the spacer stays even when there is + * no label. None of it is reachable from the extension side. + * + * So the only lever here is removing clutter, not reclaiming width. If Vicinae + * ever exposes a label-less or full-width field variant, this is the file to + * simplify further. */ export interface ComposeFormProps { initialValue: string; @@ -21,7 +41,7 @@ export function ComposeForm({ initialValue, onSubmit }: ComposeFormProps) { return (
- ); } -- 2.54.0