From 122ae9c519b554945a3a6ac06ac6517e0966ffdf Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:37:24 +0000 Subject: [PATCH 1/2] fix(ui): send the tour's question, focus a new note's title, keep Import clear of Ask The welcome tour's question now arrives in Chat sent, New note opens with the title focused and "Untitled" selected, the paste import's buttons scroll clear of the floating Ask button, and the seeded indexing routine reads "Run the embed step on recordings not yet searchable by meaning" instead of "... on undefined". Clicks survey: 271 from 274. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018XZkebEbpvyi9y3qmDVD8V --- ci/clicks/baseline.json | 82 ++++++++++--------- .../__tests__/routines-model.test.ts | 4 + .../__tests__/welcome-tour.test.tsx | 2 +- .../components/home/welcome-tour.tsx | 2 +- .../components/import/paste-tab.tsx | 3 +- .../components/notes/note-page.tsx | 14 +++- .../components/notes/notes-home.tsx | 2 +- .../components/notes/notes-tree.tsx | 2 +- .../components/routines/routine-model.ts | 10 ++- 9 files changed, 74 insertions(+), 47 deletions(-) diff --git a/ci/clicks/baseline.json b/ci/clicks/baseline.json index 97dcfc0d1..5c0c8aab7 100644 --- a/ci/clicks/baseline.json +++ b/ci/clicks/baseline.json @@ -1,5 +1,5 @@ { - "surveyed": "2026-10-10T20:28:52.714Z", + "surveyed": "2026-10-10T21:37:10.951Z", "commit": "", "viewport": "1400x900", "journeys": [ @@ -85,7 +85,7 @@ } ], "id": "install", - "ms": 1925, + "ms": 2289, "ok": true }, { @@ -122,7 +122,7 @@ } ], "id": "first-admin", - "ms": 515, + "ms": 476, "ok": true }, { @@ -167,7 +167,7 @@ } ], "id": "setup-wizard", - "ms": 690, + "ms": 623, "ok": true }, { @@ -175,7 +175,7 @@ "feature": "Ask the first question from the welcome tour", "note": "", "clicks": 0, - "keys": 44, + "keys": 43, "prompts": 0, "steps": [ { @@ -193,18 +193,10 @@ "clicks": 0, "keys": 1, "prompts": 0 - }, - { - "page": "/chat", - "kind": "key", - "what": "Enter again: the question waits in Chat's composer", - "clicks": 0, - "keys": 1, - "prompts": 0 } ], "id": "first-question", - "ms": 2409, + "ms": 1231, "ok": true }, { @@ -242,14 +234,14 @@ { "page": "/import", "kind": "click", - "what": "Import (covered by something else on the page)", + "what": "Import", "clicks": 1, "keys": 0, "prompts": 0 } ], "id": "import-paste", - "ms": 7044, + "ms": 4101, "ok": true }, { @@ -278,7 +270,7 @@ } ], "id": "library-open", - "ms": 2819, + "ms": 2541, "ok": true }, { @@ -315,7 +307,7 @@ } ], "id": "search-word", - "ms": 3260, + "ms": 3195, "ok": true }, { @@ -352,7 +344,7 @@ } ], "id": "jump-to", - "ms": 2357, + "ms": 2312, "ok": true }, { @@ -397,15 +389,15 @@ } ], "id": "chat-ask", - "ms": 3638, + "ms": 3810, "ok": true }, { "module": "Notes", "feature": "Write a note", "note": "", - "clicks": 4, - "keys": 36, + "clicks": 3, + "keys": 35, "prompts": 0, "steps": [ { @@ -428,8 +420,8 @@ "page": "/notes/:id", "kind": "replace", "what": "title", - "clicks": 1, - "keys": 9, + "clicks": 0, + "keys": 8, "prompts": 0 }, { @@ -442,7 +434,7 @@ } ], "id": "note-create", - "ms": 3515, + "ms": 3341, "ok": true }, { @@ -487,7 +479,7 @@ } ], "id": "topic-add", - "ms": 3026, + "ms": 3271, "ok": true }, { @@ -532,7 +524,7 @@ } ], "id": "pipeline-create", - "ms": 2909, + "ms": 2788, "ok": true }, { @@ -577,7 +569,7 @@ } ], "id": "routine-create", - "ms": 2735, + "ms": 2712, "ok": true }, { @@ -614,7 +606,7 @@ } ], "id": "extension-add", - "ms": 2637, + "ms": 2537, "ok": true }, { @@ -651,7 +643,7 @@ } ], "id": "sensor-webhook", - "ms": 2687, + "ms": 2825, "ok": true }, { @@ -696,7 +688,7 @@ } ], "id": "settings-change", - "ms": 3646, + "ms": 3290, "ok": true }, { @@ -757,7 +749,7 @@ } ], "id": "person-add", - "ms": 3268, + "ms": 3021, "ok": true }, { @@ -810,7 +802,7 @@ } ], "id": "api-token", - "ms": 2869, + "ms": 2822, "ok": true }, { @@ -839,7 +831,7 @@ } ], "id": "namespace-switch", - "ms": 2348, + "ms": 2246, "ok": true } ], @@ -904,6 +896,12 @@ "reach": 1, "controls": 4 }, + { + "page": "/costs", + "label": "Costs", + "reach": 1, + "controls": 4 + }, { "page": "/pipelines", "label": "Pipelines", @@ -956,7 +954,7 @@ "page": "/extensions", "label": "Extensions", "reach": 1, - "controls": 6 + "controls": 7 }, { "page": "/sensors", @@ -998,7 +996,7 @@ "page": "/settings/speech-providers", "label": "Settings › Speech providers", "reach": 2, - "controls": 18 + "controls": 22 }, { "page": "/settings/voice-ids", @@ -1028,13 +1026,13 @@ "page": "/settings/ai", "label": "Settings › AI assistant", "reach": 2, - "controls": 48 + "controls": 53 }, { "page": "/settings/search", "label": "Settings › Search", "reach": 2, - "controls": 17 + "controls": 18 }, { "page": "/settings/reports", @@ -1106,7 +1104,7 @@ "page": "/settings/telemetry", "label": "Settings › Telemetry", "reach": 2, - "controls": 10 + "controls": 12 }, { "page": "/settings/fedora", @@ -1126,6 +1124,12 @@ "reach": 2, "controls": 23 }, + { + "page": "/settings/backups", + "label": "Settings › Backups", + "reach": 2, + "controls": 9 + }, { "page": "/settings/storage", "label": "Settings › Storage", diff --git a/nextjs-frontend/__tests__/routines-model.test.ts b/nextjs-frontend/__tests__/routines-model.test.ts index bf753b0cc..9565acfba 100644 --- a/nextjs-frontend/__tests__/routines-model.test.ts +++ b/nextjs-frontend/__tests__/routines-model.test.ts @@ -53,6 +53,10 @@ describe("routine actions", () => { expect(actionText({ type: "workflow", workflow: 4, recordings: "all" }, names)).toBe( "Run Meeting notes on all recordings", ); + // the seeded "Index for search by meaning" routine: steps of its own, on what isn't indexed yet + expect(actionText({ type: "pipeline", steps: ["embed"], recordings: "unindexed" }, names)).toBe( + "Run the embed step on recordings not yet searchable by meaning", + ); expect(routineText(actions, names)).toBe( "Sync every watched folder, then run each namespace’s pipeline on recordings not processed yet, " + "then organise the graph with Organise the entity graph (propose only)", diff --git a/nextjs-frontend/__tests__/welcome-tour.test.tsx b/nextjs-frontend/__tests__/welcome-tour.test.tsx index 0bf9fef9d..56f36bba7 100644 --- a/nextjs-frontend/__tests__/welcome-tour.test.tsx +++ b/nextjs-frontend/__tests__/welcome-tour.test.tsx @@ -40,7 +40,7 @@ describe("welcome tour", () => { const qc = show(); fireEvent.change(screen.getByLabelText("Ask the assistant"), { target: { value: "what's new?" } }); fireEvent.click(screen.getByRole("button", { name: "Ask" })); - expect(push).toHaveBeenCalledWith("/chat?global=1&q=what%27s+new%3F"); + expect(push).toHaveBeenCalledWith("/chat?global=1&q=what%27s+new%3F&send=1"); await waitFor(() => expect(finishTour).toHaveBeenCalledTimes(1)); await waitFor(() => expect(qc.getQueryData(["me"])).toMatchObject({ toured_at: expect.any(String) })); }); diff --git a/nextjs-frontend/components/home/welcome-tour.tsx b/nextjs-frontend/components/home/welcome-tour.tsx index 54319f4f3..1b34fe687 100644 --- a/nextjs-frontend/components/home/welcome-tour.tsx +++ b/nextjs-frontend/components/home/welcome-tour.tsx @@ -85,7 +85,7 @@ export function WelcomeTour() { className="flex gap-2" onSubmit={(e) => { e.preventDefault(); - close(assistantChatHref({ q: q.trim() || undefined })); + close(assistantChatHref({ q: q.trim() || undefined, send: true })); }} > -
+ {/* room at the bottom so Import scrolls clear of the floating Ask button */} +
{!text.trim() ? (

Paste a transcript on the left to see how it will be read. Nothing is saved until you import. diff --git a/nextjs-frontend/components/notes/note-page.tsx b/nextjs-frontend/components/notes/note-page.tsx index b4cd99c62..26e127b59 100644 --- a/nextjs-frontend/components/notes/note-page.tsx +++ b/nextjs-frontend/components/notes/note-page.tsx @@ -4,7 +4,7 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { ArrowUpRight, FileText, History, Link2, Shapes, Sparkles, Trash2 } from "lucide-react"; import dynamic from "next/dynamic"; import Link from "next/link"; -import { useRouter } from "next/navigation"; +import { useRouter, useSearchParams } from "next/navigation"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { Notes } from "@/app/openapi-client"; @@ -66,6 +66,9 @@ export function NotePage({ id, about }: { id?: number; about?: string }) { const [linking, setLinking] = useState(false); const [view, setView] = useState("page"); const loadedFor = useRef(null); + // Just made with New note (?new=1): the title takes the focus with "Untitled" selected, so typing names it + const fresh = useRef(useSearchParams().get("new") === "1"); + const titleRef = useRef(null); useEffect(() => { if (!page) return; const k = page.about ?? `page:${page.id}`; @@ -77,6 +80,14 @@ export function NotePage({ id, about }: { id?: number; about?: string }) { setPlace(saved?.place ?? ""); setView((saved?.view as View | null) ?? "page"); }, [page, saved]); + useEffect(() => { + const el = titleRef.current; + if (!fresh.current || !el || !title || !page?.can_edit) return; + fresh.current = false; + el.focus(); + el.select(); + window.history.replaceState(window.history.state, "", window.location.pathname); + }, [title, page?.can_edit]); // Saving: changes gather for a moment, then go in one request. A thing's draft becomes its page on the first one. const pending = useRef({}); @@ -272,6 +283,7 @@ export function NotePage({ id, about }: { id?: number; about?: string }) {

{ diff --git a/nextjs-frontend/components/notes/notes-home.tsx b/nextjs-frontend/components/notes/notes-home.tsx index f46c1c15c..8eb743ec9 100644 --- a/nextjs-frontend/components/notes/notes-home.tsx +++ b/nextjs-frontend/components/notes/notes-home.tsx @@ -36,7 +36,7 @@ export function NotesHome() { mutationFn: () => data(Notes.createPage({ client, body: { ns: target!, title: "Untitled" } })), onSuccess: (p) => { qc.invalidateQueries({ queryKey: ["notes-tree"] }); - router.push(`/notes/${p.id}`); + router.push(`/notes/${p.id}?new=1`); }, onError: (err) => toast({ diff --git a/nextjs-frontend/components/notes/notes-tree.tsx b/nextjs-frontend/components/notes/notes-tree.tsx index 7173b3f8e..1347fd256 100644 --- a/nextjs-frontend/components/notes/notes-tree.tsx +++ b/nextjs-frontend/components/notes/notes-tree.tsx @@ -91,7 +91,7 @@ function NamespaceNotes({ onSuccess: (p, parent) => { if (parent != null && !open.has(parent)) toggle(parent); qc.invalidateQueries({ queryKey: ["notes-tree", ns] }); - router.push(`/notes/${p.id}`); + router.push(`/notes/${p.id}?new=1`); onNavigate?.(); }, onError: fail("Couldn’t add a note"), diff --git a/nextjs-frontend/components/routines/routine-model.ts b/nextjs-frontend/components/routines/routine-model.ts index 3b500c216..ee1da7cc5 100644 --- a/nextjs-frontend/components/routines/routine-model.ts +++ b/nextjs-frontend/components/routines/routine-model.ts @@ -4,7 +4,7 @@ */ import type { Tone } from "@/components/ui/badge"; -export type Pick = "new" | "unprocessed" | "all"; +export type Pick = "new" | "unprocessed" | "all" | "unindexed"; export type SyncAction = { type: "sync"; watches?: number[] | null }; export type PipelineAction = { type: "pipeline"; @@ -75,6 +75,7 @@ export const PICK_LABEL: Record = { new: "new recordings (since the last run)", unprocessed: "recordings not processed yet", all: "all recordings", + unindexed: "recordings not yet searchable by meaning", }; export function newAction(type: RoutineAction["type"]): RoutineAction { @@ -107,8 +108,13 @@ export function actionText(a: RoutineAction, names: Names): string { } const on = PICK_LABEL[a.recordings ?? "new"]; if (a.type === "pipeline") { + const steps = (a.steps ?? []).filter((x): x is string => typeof x === "string"); const p = - a.pipeline != null ? (names.pipeline(a.pipeline) ?? `pipeline #${a.pipeline}`) : "each namespace’s pipeline"; + a.pipeline != null + ? (names.pipeline(a.pipeline) ?? `pipeline #${a.pipeline}`) + : steps.length + ? `the ${steps.join(", ")} step${steps.length > 1 ? "s" : ""}` + : "each namespace’s pipeline"; return `Run ${p} on ${on}`; } if (a.workflow == null) return "Run a workflow (choose one)"; From fac2af49346c6735a891e3cdf34e8ed8c45ee03c Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:43:14 +0000 Subject: [PATCH 2/2] fix(ui): focus where people type next on setup, Search and Chat; the installer takes the one model server found The setup link's form starts at the email, Search and a new Chat conversation start in their box, and the web installer picks the model server when it finds exactly one. The Chat journey no longer clicks New conversation, which /chat already shows. Clicks survey: 266 from 271. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018XZkebEbpvyi9y3qmDVD8V --- ci/clicks/baseline.json | 70 +++++++------------ ci/clicks/journeys.mjs | 5 +- installer/page.html | 2 + nextjs-frontend/__tests__/setupForm.test.tsx | 8 +-- .../components/auth/setup-form.tsx | 3 +- nextjs-frontend/components/chat/chat-app.tsx | 3 +- .../components/search/search-page.tsx | 5 ++ 7 files changed, 45 insertions(+), 51 deletions(-) diff --git a/ci/clicks/baseline.json b/ci/clicks/baseline.json index 5c0c8aab7..794570df8 100644 --- a/ci/clicks/baseline.json +++ b/ci/clicks/baseline.json @@ -1,5 +1,5 @@ { - "surveyed": "2026-10-10T21:37:10.951Z", + "surveyed": "2026-10-10T21:42:56.433Z", "commit": "", "viewport": "1400x900", "journeys": [ @@ -7,7 +7,7 @@ "module": "Setup", "feature": "Install with the web installer (defaults, local model found)", "note": "The install line in a terminal, then the browser installer. The browser opens on its own on a desktop; on a server the link is opened by hand (counted). A computer missing Docker also asks for its password.", - "clicks": 8, + "clicks": 7, "keys": 2, "prompts": 0, "steps": [ @@ -43,14 +43,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "installer:/", - "kind": "click", - "what": "pick the model server found on this computer", - "clicks": 1, - "keys": 0, - "prompts": 0 - }, { "page": "installer:/", "kind": "click", @@ -85,14 +77,14 @@ } ], "id": "install", - "ms": 2289, + "ms": 1749, "ok": true }, { "module": "Setup", "feature": "Create the first admin (passkey)", "note": "From the setup link, which fills in the setup code.", - "clicks": 2, + "clicks": 1, "keys": 17, "prompts": 1, "steps": [ @@ -100,7 +92,7 @@ "page": "/setup", "kind": "type", "what": "email", - "clicks": 1, + "clicks": 0, "keys": 17, "prompts": 0 }, @@ -122,7 +114,7 @@ } ], "id": "first-admin", - "ms": 476, + "ms": 409, "ok": true }, { @@ -167,7 +159,7 @@ } ], "id": "setup-wizard", - "ms": 623, + "ms": 572, "ok": true }, { @@ -196,7 +188,7 @@ } ], "id": "first-question", - "ms": 1231, + "ms": 1175, "ok": true }, { @@ -241,7 +233,7 @@ } ], "id": "import-paste", - "ms": 4101, + "ms": 4120, "ok": true }, { @@ -270,14 +262,14 @@ } ], "id": "library-open", - "ms": 2541, + "ms": 2598, "ok": true }, { "module": "Search", "feature": "Search for a word and see where it was said", "note": "", - "clicks": 2, + "clicks": 1, "keys": 10, "prompts": 0, "steps": [ @@ -293,7 +285,7 @@ "page": "/search", "kind": "type", "what": "the word", - "clicks": 1, + "clicks": 0, "keys": 9, "prompts": 0 }, @@ -307,7 +299,7 @@ } ], "id": "search-word", - "ms": 3195, + "ms": 3202, "ok": true }, { @@ -351,7 +343,7 @@ "module": "Chat", "feature": "Ask the assistant in Chat", "note": "", - "clicks": 3, + "clicks": 1, "keys": 34, "prompts": 0, "steps": [ @@ -363,19 +355,11 @@ "keys": 0, "prompts": 0 }, - { - "page": "/chat", - "kind": "click", - "what": "New conversation", - "clicks": 1, - "keys": 0, - "prompts": 0 - }, { "page": "/chat", "kind": "type", "what": "question", - "clicks": 1, + "clicks": 0, "keys": 33, "prompts": 0 }, @@ -389,7 +373,7 @@ } ], "id": "chat-ask", - "ms": 3810, + "ms": 2750, "ok": true }, { @@ -434,7 +418,7 @@ } ], "id": "note-create", - "ms": 3341, + "ms": 3328, "ok": true }, { @@ -479,7 +463,7 @@ } ], "id": "topic-add", - "ms": 3271, + "ms": 3367, "ok": true }, { @@ -524,7 +508,7 @@ } ], "id": "pipeline-create", - "ms": 2788, + "ms": 2676, "ok": true }, { @@ -569,7 +553,7 @@ } ], "id": "routine-create", - "ms": 2712, + "ms": 2854, "ok": true }, { @@ -606,7 +590,7 @@ } ], "id": "extension-add", - "ms": 2537, + "ms": 2571, "ok": true }, { @@ -643,7 +627,7 @@ } ], "id": "sensor-webhook", - "ms": 2825, + "ms": 2608, "ok": true }, { @@ -688,7 +672,7 @@ } ], "id": "settings-change", - "ms": 3290, + "ms": 3279, "ok": true }, { @@ -749,7 +733,7 @@ } ], "id": "person-add", - "ms": 3021, + "ms": 2964, "ok": true }, { @@ -802,7 +786,7 @@ } ], "id": "api-token", - "ms": 2822, + "ms": 2797, "ok": true }, { @@ -831,7 +815,7 @@ } ], "id": "namespace-switch", - "ms": 2246, + "ms": 2314, "ok": true } ], @@ -1032,7 +1016,7 @@ "page": "/settings/search", "label": "Settings › Search", "reach": 2, - "controls": 18 + "controls": 17 }, { "page": "/settings/reports", diff --git a/ci/clicks/journeys.mjs b/ci/clicks/journeys.mjs index cd8a78bd5..936d0b006 100644 --- a/ci/clicks/journeys.mjs +++ b/ci/clicks/journeys.mjs @@ -37,7 +37,9 @@ export const JOURNEYS = [ await meter.click(page.locator("#next"), "Continue (how it runs)"); const found = page.getByRole("button", { name: /Ollama · \d+ models/ }); await found.waitFor(); - await meter.click(found, "pick the model server found on this computer"); + // picked already when it's the only one found + if (!(await found.evaluate((el) => el.classList.contains("on")))) + await meter.click(found, "pick the model server found on this computer"); await meter.click(page.locator("#next"), "Continue (AI model)"); await page.getByRole("heading", { name: "Extras" }).waitFor(); await meter.click(page.locator("#next"), "Continue (extras)"); @@ -166,7 +168,6 @@ export const JOURNEYS = [ from: "/", async run({ page, meter }) { await meter.click(nav(page, "Chat"), "Chat"); - await meter.click(page.getByRole("button", { name: "New conversation" }), "New conversation"); await meter.type(page.getByRole("textbox", { name: "Your question" }), "Who said what about Raspberry Pi?", "question"); await meter.press("Enter", "Enter to send"); await page.getByText(ANSWER).first().waitFor({ timeout: 60000 }); diff --git a/installer/page.html b/installer/page.html index ee5f430f4..e0fbf07aa 100644 --- a/installer/page.html +++ b/installer/page.html @@ -271,6 +271,8 @@

Install Lens

// 3. AI model --------------------------------------------------------------------------------------------------- async function detect() { try { S.servers = (await api("/api/models/detect")).servers; } catch { S.servers = []; } + // One model server running here and nothing picked yet: take it, as Lens's own setup does (another is a click away) + if (S.servers.length === 1 && !S.llm.preset) return pickLocal(S.servers[0]); if (S.step === 2) render(); } function pickLocal(s) { diff --git a/nextjs-frontend/__tests__/setupForm.test.tsx b/nextjs-frontend/__tests__/setupForm.test.tsx index fb8d6ec3c..b81e74c4c 100644 --- a/nextjs-frontend/__tests__/setupForm.test.tsx +++ b/nextjs-frontend/__tests__/setupForm.test.tsx @@ -49,11 +49,11 @@ afterEach(() => { }); describe("SetupForm", () => { - it("fills in the code from the setup link and starts at the name", () => { + it("fills in the code from the setup link and starts at the email", () => { renderForm("fr0m-link"); expect(screen.getByLabelText("Setup code")).toHaveValue("fr0m-link"); - expect(screen.getByLabelText("Name")).toHaveFocus(); + expect(screen.getByLabelText("Email")).toHaveFocus(); expect(screen.getByText("The setup code from your link is filled in.")).toBeInTheDocument(); expect(screen.queryByText("make setup-code")).not.toBeInTheDocument(); }); @@ -119,9 +119,9 @@ describe("SetupForm", () => { ); }); - it("fills in the code from the setup link and starts at the name", () => { + it("fills in the code from the setup link and starts at the email", () => { renderForm("fr0m-link"); expect(screen.getByLabelText("Setup code")).toHaveValue("fr0m-link"); - expect(screen.getByLabelText("Name")).toHaveFocus(); + expect(screen.getByLabelText("Email")).toHaveFocus(); }); }); diff --git a/nextjs-frontend/components/auth/setup-form.tsx b/nextjs-frontend/components/auth/setup-form.tsx index d2be45cad..e20178066 100644 --- a/nextjs-frontend/components/auth/setup-form.tsx +++ b/nextjs-frontend/components/auth/setup-form.tsx @@ -101,7 +101,6 @@ export function SetupForm({ initialCode = "" }: { initialCode?: string }) { name="name" label="Name" autoComplete="name" - autoFocus={Boolean(initialCode)} value={name} onChange={(e) => setName(e.target.value)} /> @@ -110,6 +109,8 @@ export function SetupForm({ initialCode = "" }: { initialCode?: string }) { label="Email" type="email" autoComplete="email" + // the setup link filled the code in: email is the one field left that's needed (name is optional) + autoFocus={Boolean(initialCode)} required value={email} onChange={(e) => { diff --git a/nextjs-frontend/components/chat/chat-app.tsx b/nextjs-frontend/components/chat/chat-app.tsx index fc800d396..0aee7f28a 100644 --- a/nextjs-frontend/components/chat/chat-app.tsx +++ b/nextjs-frontend/components/chat/chat-app.tsx @@ -793,7 +793,8 @@ export function ChatApp() { hasFiles={files.ready} uploading={files.sending} busy={Boolean(live)} - autoFocus={composing} + // a new conversation (nothing open, or one asked for): typing goes straight into it + autoFocus={composing || !showThread} placeholder={ voice.listening ? "Listening…" diff --git a/nextjs-frontend/components/search/search-page.tsx b/nextjs-frontend/components/search/search-page.tsx index 654744ce9..2132de1ac 100644 --- a/nextjs-frontend/components/search/search-page.tsx +++ b/nextjs-frontend/components/search/search-page.tsx @@ -82,6 +82,11 @@ export function SearchPage() { const index = useRecordingIndex(); useEffect(() => setDraft(q), [q]); + // Arriving with nothing searched yet: the box has the focus, so typing searches + const arrivedEmpty = useRef(!q); + useEffect(() => { + if (arrivedEmpty.current) inputRef.current?.focus(); + }, []); useEffect(() => { const onKey = (e: KeyboardEvent) => { const t = e.target as HTMLElement;