feat(fields): sixteen text boxes get the microphone; chatkit 0.25

Fleet experience standard, step 9. The experience audit counted 34 hand-made
text areas with no microphone; it now counts 17, and package-plan.json sets
the ceiling at today's counts so the number can only fall.

- @bitbaum/chatkit 0.22.1 -> 0.25.0. Composer behaviour and the class names
  Loki overrides are unchanged; LOKI_VOICE keeps the transcribe route's own
  sentence (showServerDetail), which names the fix.
- <TextArea> (components/ui/text-area.tsx): Loki's one adapter over chatkit's
  DictationField, drawn to match ui-input. Sixteen files use it. One file is
  exempt with its reason on its first line (URL paths, one per line).
- Field takes htmlFor, so its label names the control and a press on it
  focuses the field.
- A signed-out visitor's microphone is the browser's own recogniser
  (VISITOR_VOICE): the server leg answers 401 without a session, so on
  /change the mic recorded a whole take and then failed.
- The widget chat bundle budget goes 40 -> 41 KB: 41,414 -> 41,614 bytes
  gzipped, the two new dictation problems a person can act on.

The other seventeen wait for props the shared field gains in
bitbaum/chatkit#85 (autoFocus, onKeyDown, onBlur/onFocus, name, inputProps).

The stylesheet in this commit also carries the public-site rules of the
next one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5
This commit is contained in:
Claude committed 2026-11-12 08:11:53 +00:00
1 parent b376ead370
commit 3bae0c4034
26 files changed
+370 -81

No files matched your search

+8
View File
@@ -11,5 +11,13 @@
],
"notes": "Reuse SessionComposer and its existing ChatKit wrapper for input, attachments, dictation and failed-send drafts. No new composer or transport."
}
},
"experience": {
"ceiling": {
"bareTextareas": 17,
"localChrome": 2,
"localComposers": 1,
"mutedChats": 1
}
}
}
+1 -1
View File
@@ -127,7 +127,7 @@
"@better-auth/passkey": "^1.7.14",
"@bitbaum/accountkit": "^0.27.0",
"@bitbaum/ai-kit": "^1.24.0",
"@bitbaum/chatkit": "^0.22.1",
"@bitbaum/chatkit": "^0.25.0",
"@bitbaum/mail-kit": "^0.2.0",
"@bitbaum/searchkit": "^0.2.3",
"@bitbaum/whenkit": "^0.3.3",
+5 -5
View File
@@ -41,8 +41,8 @@ importers:
specifier: ^0.6.1
version: 0.6.1(katex@0.16.47)(mermaid@11.17.2)(react@19.3.1)(shiki@4.5.0)
'@bitbaum/chatkit':
specifier: ^0.22.1
version: 0.22.1(react@19.3.1)
specifier: ^0.25.0
version: 0.25.0(react@19.3.1)
'@bitbaum/limitkit':
specifier: ^0.2.1
version: 0.2.1
@@ -596,8 +596,8 @@ packages:
shiki:
optional: true
'@bitbaum/chatkit@0.22.1':
resolution: {integrity: sha512-hAvxeJbpsMS6Jn0TTNyiVRpbhmsQqx52dG6woCH+UbZCZhuK4czldjIU8LpHppMk/NDuz7Yg+phKxJ6HDNiIkw==}
'@bitbaum/chatkit@0.25.0':
resolution: {integrity: sha512-SVhGRltxG2a860pGawFAb1FdY0mr5ZGk0aOMoNT5FEmeczgZwlEfEzR5o8DQO7np8g26LiBpgqGRNEfp3AiNWw==}
engines: {node: '>=20'}
hasBin: true
peerDependencies:
@@ -6038,7 +6038,7 @@ snapshots:
mermaid: 11.17.2
shiki: 4.5.0
'@bitbaum/chatkit@0.22.1(react@19.3.1)':
'@bitbaum/chatkit@0.25.0(react@19.3.1)':
dependencies:
pdfjs-dist: 6.4.299
react: 19.3.1
+4 -1
View File
@@ -154,7 +154,10 @@ async function main() {
// Measured 24 KB when it landed and 33 KB on chatkit 0.13 (option cards,
// citation chips, the layered figure, the thinking row — the shapes the
// conversation is there to draw). The budget leaves room, not a blank cheque.
ok(kb(b.chat) <= 40, `the chat chunk stays small (${kb(b.chat)} KB gzipped, budget 40)`);
// 41 since chatkit 0.25 (2026-11-12): 40.45 KB on 0.22.1, 40.65 KB on 0.25,
// the ~200 bytes being the dictation problems a person can act on (sign in,
// busy) and their status mapping, which the composer in this chunk draws.
ok(kb(b.chat) <= 41, `the chat chunk stays small (${kb(b.chat)} KB gzipped, budget 41)`);
}
try {
@@ -13,6 +13,7 @@ import { useRouter, useSearchParams } from "next/navigation";
import Link from "next/link";
import { Loader2, GitBranch, Check, Copy } from "lucide-react";
import { PageLayout } from "@/components/ui/page-layout";
import { TextArea } from "@/components/ui/text-area";
// The light half only: the starters' file bodies (the fleet starter is ~0.5 MB)
// must never reach a client bundle.
import {
@@ -370,16 +371,20 @@ function NewFromScratchForm() {
</div>
<div>
<label className="block text-sm font-medium text-text-primary mb-1">
<label
htmlFor="new-from-scratch-description"
className="block text-sm font-medium text-text-primary mb-1"
>
What do you want to build?
</label>
<textarea
<TextArea
id="new-from-scratch-description"
ariaLabel="What do you want to build?"
value={description}
onChange={(e) => setDescription(e.target.value)}
onChange={setDescription}
placeholder="A peer-to-peer marketplace where cat owners find trusted sitters nearby."
maxLength={300}
rows={3}
className="ui-input w-full resize-y"
/>
<p className="text-xs text-text-tertiary mt-1">
Plain English. The agent uses this to choose the stack and build the first version.
+163 -8
View File
@@ -476,6 +476,16 @@
* {
@apply border-border outline-ring/50;
}
/* The keyboard's place on the page, wherever a component has not drawn its
own: 2px in the text colour, set off from the control. The fallback above
is one pixel at half alpha, 2.0:1 against the page in both themes, which
is below the 3:1 a focus indicator needs. :where() keeps this at zero
specificity, so every component's own focus style still wins, and
:focus-visible keeps it off mouse and touch presses. */
:where(a, button, summary, [role="button"], [role="tab"], [role="menuitem"]):focus-visible {
outline: 2px solid var(--text-primary);
outline-offset: 2px;
}
body {
@apply bg-background text-foreground;
font-size: 16px;
@@ -753,8 +763,26 @@
.ui-locked-banner-cta {
@apply inline-flex shrink-0 items-center gap-1.5 text-sm font-semibold text-text-primary;
}
/* overflow-x: clip, not hidden. `hidden` turns this element into a scroll
container, and a sticky child sticks to its nearest scroll container: the
header below was "sticky" and scrolled away with the page on every public
route (its top measured -2000px after a 2000px scroll, 2026-11-12). `clip`
cuts sideways overflow the same way without becoming one. */
.ui-public-surface {
@apply relative min-h-screen overflow-hidden bg-background text-text-primary;
@apply relative min-h-screen overflow-x-clip bg-background text-text-primary;
}
/* Keyboard focus on the public surface: a 2px ring in the text colour, set
off from what it surrounds. The base rule draws 1px at half alpha, which
measured 2.0:1 against the page in both themes and ran through the text
of a row link. Text boxes keep their own focus style. */
.ui-public-surface :is(a, button, summary, [role="button"]):focus-visible {
outline: 2px solid var(--text-primary);
outline-offset: 2px;
}
/* The first thing Tab reaches: jump past the header to the page. Drawn only
while it has focus. */
.ui-skip-link {
@apply fixed left-3 top-3 z-50 -translate-y-20 rounded-lg bg-surface-base px-4 py-3 text-sm font-medium text-text-primary shadow-panel-strong transition-transform focus-visible:translate-y-0;
}
.ui-public-nav-brand-row {
@apply flex min-w-0 items-center gap-3 sm:gap-8;
@@ -792,8 +820,8 @@
/* Dropdown panel anchored to the trigger — grid of label + description per
destination. */
.ui-public-nav-panel {
width: min(720px, calc(100vw - 48px));
@apply grid gap-2 rounded-2xl border border-border-subtle bg-surface-base p-3 lg:grid-cols-3;
width: min(560px, calc(100vw - 48px));
@apply grid grid-cols-2 gap-2 rounded-2xl border border-border-subtle bg-surface-base p-3;
box-shadow: var(--shadow-panel-strong);
}
.ui-public-nav-panel-wrap {
@@ -1093,7 +1121,7 @@
is what a phone in Auto mode shows in daylight. The white/* pattern is
only sanctioned inside the surfaces that are always dark. */
.ui-public-footer-grid {
@apply mb-8 grid grid-cols-2 gap-x-6 gap-y-8 border-t border-border-subtle pt-8 sm:grid-cols-3 sm:gap-12;
@apply mb-8 grid grid-cols-2 gap-x-6 gap-y-8 border-t border-border-subtle pt-8 sm:gap-12 lg:grid-cols-4;
}
.ui-public-footer-heading {
@apply mb-1 text-sm font-medium text-text-primary;
@@ -1101,11 +1129,22 @@
.ui-public-footer-bottom {
@apply flex flex-wrap items-center justify-between gap-3 text-xs text-text-tertiary;
}
/* Both ends on one centre line: the release link is a 44px target on a
phone, the copyright beside it was a bare line of text. */
.ui-public-footer-bottom > * {
@apply inline-flex min-h-11 items-center;
}
.ui-public-footer-fleet {
@apply mb-8 border-t border-border-subtle pt-8;
}
.ui-public-footer-fleet-summary {
@apply inline-flex min-h-11 cursor-pointer list-none items-center text-sm text-text-tertiary transition-colors hover:text-text-secondary;
@apply inline-flex min-h-11 cursor-pointer list-none items-center gap-1.5 text-sm text-text-tertiary transition-colors hover:text-text-secondary;
}
.ui-public-footer-fleet-chevron {
@apply h-3.5 w-3.5 shrink-0 transition-transform;
}
.ui-public-footer-fleet[open] .ui-public-footer-fleet-chevron {
@apply rotate-180;
}
.ui-public-footer-fleet-summary::-webkit-details-marker {
display: none;
@@ -1170,7 +1209,7 @@
the label wrapped to two lines and the pill grew past the right edge of a
390px viewport, clipping the action the whole header exists to offer. */
.ui-public-primary-action-compact {
@apply inline-flex h-10 shrink-0 items-center whitespace-nowrap rounded-full border border-border-default px-4 text-sm font-medium text-text-primary transition-colors hover:bg-surface-raised active:scale-[0.97];
@apply inline-flex min-h-11 shrink-0 items-center whitespace-nowrap rounded-full border border-border-default px-4 text-sm font-medium text-text-primary transition-colors hover:bg-surface-raised active:scale-[0.97];
}
.ui-public-section-kicker {
@apply mb-3 text-xs font-semibold text-text-muted;
@@ -1649,6 +1688,16 @@
floating, faintly-glassy panel with a top sheen, deep drop shadow, and the
same status language the real Control view uses. Data is sourced from
HOME_HERO_CONSOLE (marketing-content.ts) — no inline literals. */
/* The homepage's one action: the shared composer, at the width of the
paragraph above it, left-aligned text inside a centred hero. */
.ui-public-hero-composer {
@apply mx-auto mt-8 w-full max-w-xl text-left sm:mt-10;
}
/* The evidence, when there is no showcased project to frame: one quiet
line of real counts. */
.ui-public-hero-proof {
@apply mt-8 text-sm text-text-tertiary;
}
.ui-public-hero-console {
@apply relative mx-auto mt-10 w-full max-w-2xl overflow-hidden rounded-2xl border border-border-subtle bg-surface-base p-4 text-left sm:mt-16 sm:p-6;
}
@@ -1732,7 +1781,7 @@
@apply font-mono text-xl text-text-primary sm:text-2xl;
}
.ui-public-hero-console-metric-label {
@apply mt-0.5 text-[11px] leading-tight text-text-tertiary sm:text-xs;
@apply mt-0.5 text-xs leading-tight text-text-tertiary;
}
.ui-public-display-lg {
@apply font-semibold text-text-primary;
@@ -2213,6 +2262,71 @@
.ui-public-howto-step {
@apply flex flex-col border-t border-border-subtle py-5 text-left;
}
/* The three loop figures (components/public/LoopFigure.tsx): one frame per
step, the same size, drawn in tokens so both themes get them. */
.ui-public-loop-frame {
@apply mb-5 flex h-36 flex-col justify-center overflow-hidden rounded-xl border border-border-subtle bg-surface-base p-4 text-left;
}
.ui-public-loop-box {
@apply flex flex-col gap-3 rounded-lg border border-border-default bg-background p-3;
}
.ui-public-loop-words {
@apply text-sm leading-snug text-text-primary;
}
.ui-public-loop-box-row {
@apply flex items-center justify-between;
}
.ui-public-loop-dot {
@apply flex h-7 w-7 items-center justify-center rounded-full bg-surface-raised text-text-secondary;
}
.ui-public-loop-dot-on {
background: var(--accent-primary);
color: var(--text-inverted);
}
.ui-public-loop-run {
@apply m-0 flex list-none flex-col gap-2 p-0;
}
.ui-public-loop-run-row {
@apply flex items-center gap-2.5 text-sm text-text-secondary;
}
.ui-public-loop-run-row-now {
@apply font-medium text-text-primary;
}
.ui-public-loop-run-row-next {
@apply text-text-tertiary;
}
.ui-public-loop-run-mark {
@apply h-3.5 w-3.5 shrink-0 text-text-tertiary;
}
.ui-public-loop-run-pulse {
@apply mx-0.5 h-2.5 w-2.5 shrink-0 rounded-full bg-text-primary motion-safe:animate-pulse;
}
.ui-public-loop-run-ring {
@apply mx-0.5 h-2.5 w-2.5 shrink-0 rounded-full border border-border-strong;
}
.ui-public-loop-site {
@apply relative flex h-full flex-col gap-3;
}
.ui-public-loop-address {
@apply flex items-center gap-1.5 rounded-full border border-border-subtle bg-background px-3 py-1 text-xs text-text-tertiary;
}
.ui-public-loop-page {
@apply flex flex-col gap-2;
}
.ui-public-loop-line {
@apply block h-2 rounded-full bg-border-default;
}
.ui-public-loop-ask {
@apply absolute bottom-0 right-0 flex items-center gap-2;
}
.ui-public-loop-bubble {
@apply rounded-full border border-border-default bg-background px-3 py-1 text-xs text-text-primary;
}
.ui-public-loop-button {
@apply flex h-8 w-8 shrink-0 items-center justify-center rounded-full;
background: var(--accent-primary);
color: var(--text-inverted);
}
.ui-public-howto-num {
@apply font-mono text-sm text-text-tertiary;
}
@@ -2258,7 +2372,7 @@
text-wrap: pretty;
}
.ui-public-start-card-link {
@apply mt-3 inline-flex items-center text-sm font-medium text-text-primary;
@apply mt-auto inline-flex items-center pt-3 text-sm font-medium text-text-primary;
}
/* ── design reset: Public ──────────────────────────────────────────────
The signed-out site on the same bar as the app
@@ -3922,6 +4036,16 @@
.ui-auth-hint {
@apply text-center text-sm text-text-muted;
}
/* What the visitor said on the homepage, shown back above the form. */
.ui-auth-carried {
@apply -mt-3 mb-6 flex flex-col gap-1 rounded-lg border border-border-subtle bg-surface-base px-4 py-3 text-left;
}
.ui-auth-carried-label {
@apply text-xs text-text-tertiary;
}
.ui-auth-carried-words {
@apply line-clamp-3 text-sm text-text-primary;
}
/* the one line that puts Loki on a site — shown whole, copyable in one tap */
.ui-auth-snippet {
@apply rounded-md border border-border-subtle bg-surface-raised px-3 py-2 font-mono text-xs leading-relaxed text-text-secondary;
@@ -8923,6 +9047,37 @@
}
}
/* ── <TextArea> (components/ui/text-area.tsx): chatkit's DictationField drawn
as a Loki field ───────────────────────────────────────────────────────────
UNLAYERED for the same reason as the composer rules above: chatkit's
stylesheet is unlayered, so a rule in @layer components would lose to it.
chatkit's field already reads Loki's colours through --ck-* (:root); these
few lines make its frame the same as `ui-input` around it: the default
border (chatkit uses the subtle one), the same 10px/12px text inset, the
strong border on focus instead of an accent outline, and 14px text from
`sm` up, where ui-input is `sm:text-sm`. On a phone the text stays 16px
(chatkit's floor, so iOS does not zoom). The mic stays chatkit's 44px. */
.ui-text-area .ck-field {
border-color: var(--border-default);
padding: 0.375rem 0.625rem;
}
.ui-text-area .ck-field:focus-within {
border-color: var(--border-strong);
outline: none;
box-shadow: 0 0 0 2px color-mix(in oklab, var(--text-primary) 6%, transparent);
}
@media (min-width: 40rem) {
.ui-text-area .ck-field-input {
font-size: var(--text-sm);
line-height: var(--text-sm--line-height);
}
}
/* A prompt body (PromptForm): words for an agent, set in the mono face as the
plain field was, so {{blanks}} read as blanks. */
.ui-text-area-mono .ck-field-input {
font-family: var(--font-mono);
}
/* ── Loki chat as the whole screen (chatkit ChatScreen) ──────────────────────
UNLAYERED for the same reason as the composer rules above. The open thread
runs edge to edge and top to bottom; the phone's thread header and the
@@ -3,6 +3,7 @@
import { useState } from "react";
import { useRouter } from "next/navigation";
import { Section } from "@/components/ui/section-heading";
import { TextArea } from "@/components/ui/text-area";
import { BeforeAfter } from "@/components/public/InstantPreview";
import { BUILD_REQUESTS } from "@/config/build-requests";
import { compactRelativeDate } from "@/lib/dates";
@@ -95,12 +96,13 @@ function BuildRequestRow({ request: r }: { request: BuildRequestCard }) {
{r.status === "waiting" ? (
<div className="space-y-2">
{declining && (
<textarea
className="ui-input min-h-20 w-full text-sm"
<TextArea
ariaLabel="Why not, in a sentence they will read (optional)"
placeholder="Why not, in a sentence they will read (optional)"
maxLength={BUILD_REQUESTS.noteMax}
rows={3}
value={note}
onChange={(e) => setNote(e.target.value)}
onChange={setNote}
/>
)}
<div className="flex flex-wrap gap-2">
+5 -5
View File
@@ -6,12 +6,10 @@ import { Composer as ChatkitComposer } from "@bitbaum/chatkit/react";
import { ModelPicker } from "@/components/loki/ModelPicker";
import type { Attachment, ModelChoice } from "@/components/loki/types";
import type { ComposerMode, ComposerSendResult } from "./composer-logic";
import { LOKI_VOICE, VISITOR_VOICE } from "./voice";
export type { ComposerMode, ComposerSendResult };
/** Loki's server leg for dictation: Groq Whisper behind the operator's session. */
const TRANSCRIBE_URL = "/api/control/transcribe";
export type ComposerProps = {
/** Deliver what was written. Return `false` (or resolve to it) to keep the
* draft — a failed send must be retryable from the same box, not retyped.
@@ -37,7 +35,9 @@ export type ComposerProps = {
/** Take the next message while a turn runs; the caller sends it after. */
queue?: boolean;
attach?: boolean;
voice?: boolean;
/** `"visitor"`: the box is on a page a signed-out person uses, so the mic
* is the browser's own recogniser (see VISITOR_VOICE). */
voice?: boolean | "visitor";
/** Offer the Loki model picker (chat turns). Off where the model is the
* session's own CLI, which the composer cannot change. */
modelPicker?: boolean;
@@ -109,7 +109,7 @@ export function Composer({
disabled={disabled}
attach={attach}
onSend={(text, attachments) => onSend(text, model ? { model } : {}, attachments)}
voice={voice ? { transcribeUrl: TRANSCRIBE_URL, prefer: "server" } : false}
voice={voice === "visitor" ? VISITOR_VOICE : voice ? LOKI_VOICE : false}
tools={
<>
{modelPicker && !demo && (
+31
View File
@@ -0,0 +1,31 @@
import type { ComposerVoice } from "@bitbaum/chatkit/react";
/**
* Loki's microphone, the one server leg every chatkit box in the app uses:
* the Composer and every <TextArea>. Groq Whisper behind the operator's
* session.
*
* `prefer: "server"`: dictation here is often mixed German and English, which
* one Whisper model handles better than a browser recogniser locked to a
* single language. chatkit still falls back to the browser recogniser.
*
* `showServerDetail`: since chatkit 0.24 the route's own sentence is hidden by
* default, because a server's words are in the server's language. Loki's pages
* and its transcribe route are both English, and that sentence is the one that
* names the fix ("Pick Groq under Settings → Agent", "No speech detected"), so
* it stays.
*/
export const LOKI_VOICE = {
transcribeUrl: "/api/control/transcribe",
prefer: "server",
showServerDetail: true,
} as const satisfies ComposerVoice;
/**
* The microphone for a visitor who is not signed in (the homepage's box,
* /change): the browser's own recogniser, nothing sent to Loki. The server
* leg above answers a signed-out request with 401, so on those pages the mic
* recorded a whole take and then failed, under a hint that said "use the mic
* and say it". Where the browser has no recogniser, chatkit draws no mic.
*/
export const VISITOR_VOICE = { prefer: "browser" } as const satisfies ComposerVoice;
@@ -3,6 +3,7 @@
import { Plus, X, Loader2 } from "lucide-react";
import { Segmented } from "@/components/ui/segmented";
import { Modal } from "@/components/ui/modal";
import { TextArea } from "@/components/ui/text-area";
import type { ControlData } from "@/lib/control-types";
import { PROMPT_TEMPLATES } from "@/config/prompt-library";
@@ -174,12 +175,11 @@ export function LaunchTabModal({
</option>
))}
</select>
<textarea
<TextArea
value={initialPrompt}
onChange={(e) => onInitialPromptChange(e.target.value)}
onChange={onInitialPromptChange}
placeholder="What should the agent do first? Injected automatically once it starts."
rows={3}
className="ui-input w-full resize-none"
/>
</div>
</div>
+19 -8
View File
@@ -3,6 +3,7 @@
import { useAiForm } from "@fleet/ai-forms/react";
import { Field } from "@/components/ui/form";
import { ModalForm } from "@/components/ui/modal-form";
import { TextArea } from "@/components/ui/text-area";
import { useCreateMutation } from "@/hooks/use-create-mutation";
import { postJson } from "@/lib/api/fetch";
import { ASSIGNMENT_FORM } from "@/config/ai-forms";
@@ -106,23 +107,33 @@ export function NewAssignmentButton({
/>
</Field>
<Field label="Brief — what to do, written for them" aiTouched={form.isAiTouched("brief")}>
<textarea
<Field
label="Brief — what to do, written for them"
htmlFor="new-assignment-brief"
aiTouched={form.isAiTouched("brief")}
>
<TextArea
id="new-assignment-brief"
ariaLabel="Brief — what to do, written for them"
value={form.text("brief")}
onChange={(e) => form.setValue("brief", e.target.value)}
onChange={(next) => form.setValue("brief", next)}
rows={5}
placeholder="Who to contact, what to say, what to bring back."
className="ui-input"
/>
</Field>
<Field label="Why — the half that earns a yes" aiTouched={form.isAiTouched("reason")}>
<textarea
<Field
label="Why — the half that earns a yes"
htmlFor="new-assignment-reason"
aiTouched={form.isAiTouched("reason")}
>
<TextArea
id="new-assignment-reason"
ariaLabel="Why — the half that earns a yes"
value={form.text("reason")}
onChange={(e) => form.setValue("reason", e.target.value)}
onChange={(next) => form.setValue("reason", next)}
rows={3}
placeholder="e.g. We need a second quote before the board meeting."
className="ui-input"
/>
</Field>
+5 -3
View File
@@ -2,6 +2,7 @@
import { useState } from "react";
import { ExternalLink } from "lucide-react";
import { TextArea } from "@/components/ui/text-area";
import { postJson } from "@/lib/api/fetch";
import { deadlineLabel } from "@/lib/dates";
import {
@@ -134,14 +135,15 @@ export function SharedTaskView({ token, initialTask }: { token: string; initialT
<label className="ui-kicker block" htmlFor="crew-response-note">
Anything to say back? (optional)
</label>
<textarea
<TextArea
id="crew-response-note"
ariaLabel="Anything to say back? (optional)"
voice="visitor"
value={note}
onChange={(e) => setNote(e.target.value)}
onChange={setNote}
rows={3}
maxLength={1000}
placeholder="e.g. I can do this, but not before Thursday."
className="ui-input"
/>
<div className="flex flex-wrap gap-2">
{task.actions.map((action) => (
+6 -4
View File
@@ -13,6 +13,7 @@ import {
import { DeleteButton } from "@/components/ui/delete-button";
import { DateInput } from "@/components/ui/date-input";
import { Field } from "@/components/ui/form";
import { TextArea } from "@/components/ui/text-area";
import { LokiDispatchButton } from "@/components/shared/LokiDispatchButton";
import { deadlineLabel, toLocalDateStr } from "@/lib/dates";
import { deleteJson, patchJson, throwApiError } from "@/lib/api/fetch";
@@ -147,12 +148,13 @@ export function EventSheet({
className="ui-input"
/>
</Field>
<Field label="Notes">
<textarea
<Field label="Notes" htmlFor="event-sheet-notes">
<TextArea
id="event-sheet-notes"
ariaLabel="Notes"
value={draft.description}
onChange={(e) => setDraft({ ...draft, description: e.target.value })}
onChange={(next) => setDraft({ ...draft, description: next })}
rows={3}
className="ui-input resize-none"
/>
</Field>
{error && <p className="ui-error-xs">{error}</p>}
+6 -4
View File
@@ -3,6 +3,7 @@
import { useId, useState } from "react";
import { ModalForm } from "@/components/ui/modal-form";
import { Field } from "@/components/ui/form";
import { TextArea } from "@/components/ui/text-area";
import { DateInput } from "@/components/ui/date-input";
import { postJson } from "@/lib/api/fetch";
import type { EventRow } from "@/db/queries/events";
@@ -117,12 +118,13 @@ export function NewEventButton({
className="ui-input"
/>
</Field>
<Field label="Notes">
<textarea
<Field label="Notes" htmlFor="new-event-notes">
<TextArea
id="new-event-notes"
ariaLabel="Notes"
value={draft.description}
onChange={set("description")}
onChange={(next) => setDraft((d) => ({ ...d, description: next }))}
rows={2}
className="ui-input resize-none"
/>
</Field>
</ModalForm>
+10 -4
View File
@@ -6,6 +6,7 @@ import { createGoal } from "@/lib/api/goals";
import { GOAL_STATUS } from "@/lib/constants/statuses";
import { GOAL_FORM } from "@/config/ai-forms";
import { Field } from "@/components/ui/form";
import { TextArea } from "@/components/ui/text-area";
import { ModalForm } from "@/components/ui/modal-form";
import { useCreateMutation } from "@/hooks/use-create-mutation";
import { DateInput } from "@/components/ui/date-input";
@@ -77,13 +78,18 @@ export function NewGoalButton({
/>
</Field>
<Field label="Description" aiTouched={form.isAiTouched("description")}>
<textarea
<Field
label="Description"
htmlFor="new-goal-description"
aiTouched={form.isAiTouched("description")}
>
<TextArea
id="new-goal-description"
ariaLabel="Description"
value={form.text("description")}
onChange={(e) => form.setValue("description", e.target.value)}
onChange={(next) => form.setValue("description", next)}
placeholder="Optional context or motivation"
rows={2}
className="ui-input resize-none"
/>
</Field>
@@ -1,3 +1,4 @@
// experience-exempt: the review paths box takes URL paths, one per line; dictated words would corrupt them
/* eslint-disable @next/next/no-img-element -- Authenticated browser evidence is already encoded JPEG; it must not pass through a public image optimizer. */
"use client";
+4 -4
View File
@@ -3,6 +3,7 @@
import { useState } from "react";
import { useRouter } from "next/navigation";
import { Target, Check, X, Loader2 } from "lucide-react";
import { TextArea } from "@/components/ui/text-area";
/**
* Goal-mode editor: set a project's Definition of Done (the bar the cross-model
@@ -85,14 +86,13 @@ export function GoalEditor({
<Target className="h-3 w-3" /> Definition of done — one turn&apos;s bar, checkable from the
handoff alone
</dt>
<textarea
className="ui-input w-full"
<TextArea
rows={2}
value={dod}
onChange={(e) => setDod(e.target.value)}
onChange={setDod}
placeholder="e.g. `npm run verify` passes, with its real output in the handoff; work committed and pushed"
maxLength={300}
aria-label="Definition of done"
ariaLabel="Definition of done"
/>
<div className="flex items-center gap-2">
<label className="text-xs font-medium text-text-muted">Stop after</label>
+6 -3
View File
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
import { useAiForm } from "@fleet/ai-forms/react";
import { Field } from "@/components/ui/form";
import { ModalForm } from "@/components/ui/modal-form";
import { TextArea } from "@/components/ui/text-area";
import { useCreateMutation } from "@/hooks/use-create-mutation";
import { postJson } from "@/lib/api/fetch";
import { PREVIEW_FORM } from "@/config/ai-forms";
@@ -95,15 +96,17 @@ export function NewPreviewButton({
</Field>
<Field
label="What do you know about them?"
htmlFor="new-preview-about"
hint="Links, where they are, what they do — the more, the closer the first version."
aiTouched={form.isAiTouched("about")}
>
<textarea
<TextArea
id="new-preview-about"
ariaLabel="What do you know about them?"
value={form.text("about")}
onChange={(e) => form.setValue("about", e.target.value)}
onChange={(next) => form.setValue("about", next)}
placeholder="e.g. DJ in Zurich, dub techno. ra.co/dj/francescotarallo"
rows={4}
className="ui-input"
/>
</Field>
<Field
+4 -3
View File
@@ -25,6 +25,7 @@ import { useSiteDeployment } from "@/hooks/use-site-deployment";
import { SiteDeploymentStatus } from "./SiteDeploymentStatus";
import { DOC_PASTE_MAX } from "@/lib/constants";
import { CharCount } from "@/components/ui/char-count";
import { TextArea } from "@/components/ui/text-area";
import { LinkGithubButton } from "@/components/onboarding/LinkGithubButton";
import { kickoffAutoHref } from "@/lib/integrations/orangecat-handoff-mode";
import {
@@ -194,14 +195,14 @@ export function ProjectKickoff({
<label htmlFor="project-kickoff-brief" className="ui-micro-label">
The brief — everything is written from this
</label>
<textarea
<TextArea
id="project-kickoff-brief"
ariaLabel="The brief — everything is written from this"
value={text}
onChange={(e) => setText(e.target.value)}
onChange={setText}
rows={5}
disabled={running}
placeholder={`What is ${projectName}, who is it for, and what should exist at the end? A paragraph is plenty — everything else is derived from it.`}
className="ui-input w-full text-base leading-relaxed sm:text-sm"
/>
<CharCount length={text.length} max={DOC_PASTE_MAX} />
{isThinBrief(text) && (
+3 -3
View File
@@ -2,6 +2,7 @@
import { useState } from "react";
import { ExternalLink, FileText, Loader2, Plus, Trash2 } from "lucide-react";
import { TextArea } from "@/components/ui/text-area";
import type { ProjectResource } from "./project-detail-types";
import { putJson, throwApiError } from "@/lib/api/fetch";
@@ -226,12 +227,11 @@ export function ProjectResources({
placeholder="URL, file path, or reference"
className="ui-input min-h-11 w-full"
/>
<textarea
<TextArea
value={notes}
onChange={(e) => setNotes(e.target.value)}
onChange={setNotes}
placeholder="Notes, access details, or why this matters"
rows={3}
className="ui-input w-full resize-none"
/>
<div className="flex flex-wrap items-center gap-2">
<button
+5 -3
View File
@@ -4,6 +4,7 @@ import { useId, useState } from "react";
import { Loader2, X } from "lucide-react";
import { Modal } from "@/components/ui/modal";
import { Segmented } from "@/components/ui/segmented";
import { TextArea } from "@/components/ui/text-area";
import type { Project } from "./types";
import type { UserPromptCard } from "./UserPromptsSection";
@@ -160,13 +161,14 @@ export function PromptForm({
<label className="ui-prompt-field-label" htmlFor="prompt-body">
The prompt
</label>
<textarea
<TextArea
id="prompt-body"
ariaLabel="The prompt"
value={body}
onChange={(e) => setBody(e.target.value)}
onChange={setBody}
placeholder="What the agent should do."
rows={7}
className="ui-input font-mono text-sm"
className="ui-text-area-mono"
/>
<p className="mt-1.5 text-sm text-text-secondary">
Write <code>{`{{name}}`}</code> for a blank to fill in when it runs.
+6 -4
View File
@@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from "react";
import { ExternalLink } from "lucide-react";
import { ROUTES } from "@/config/auth";
import { Segmented } from "@/components/ui/segmented";
import { TextArea } from "@/components/ui/text-area";
import {
OPEN_SOURCE_STARTERS,
OPEN_SOURCE_STARTER_IDS,
@@ -151,17 +152,18 @@ export function TakeRepoBrief({
<label htmlFor="take-brief-text" className="ui-change-brief-label">
What yours is for
</label>
<textarea
<TextArea
id="take-brief-text"
className="ui-input min-h-24 w-full resize-y text-base"
ariaLabel="What yours is for"
voice={signedIn ? true : "visitor"}
rows={4}
maxLength={TAKE.maxWishes}
placeholder={`e.g. “A ${starter.name} for my climbing club: our name, green, and only the parts we need.”`}
value={wishes}
disabled={!ready || sending}
onChange={(e) => {
onChange={(next) => {
requestId.current = "";
setWishes(e.target.value);
setWishes(next);
}}
/>
+8 -4
View File
@@ -17,6 +17,7 @@ import { useSiteConsultation } from "@/hooks/use-site-consultation";
import { appendToBrief, extractWebsite, saysMoreThanAddress } from "@/lib/website-from-speech";
import { clearWebsiteDraft, parseWebsiteDraft, saveWebsiteDraft } from "@/lib/website-draft";
import { Segmented } from "@/components/ui/segmented";
import { TextArea } from "@/components/ui/text-area";
/**
* "Change your website", told in your own words — typed or spoken.
@@ -220,6 +221,8 @@ export function WebsiteChangeBrief({ signedIn }: { signedIn: boolean }) {
placeholder={hasBrief ? "Anything else? Say it or type it…" : copy.placeholder}
ariaLabel="Describe your website and what should change"
attach={false}
// Signed out, the server's transcriber answers 401: use the browser's.
voice={signedIn ? true : "visitor"}
disabled={!ready || sending}
hint="Type it, or use the mic and say it — in any language."
/>
@@ -271,9 +274,10 @@ export function WebsiteChangeBrief({ signedIn }: { signedIn: boolean }) {
<label htmlFor="change-brief-text" className="ui-change-brief-label">
{report ? "Anything else you want (optional)" : copy.changesLabel}
</label>
<textarea
<TextArea
id="change-brief-text"
className="ui-input min-h-24 w-full resize-y text-base"
ariaLabel={report ? "Anything else you want (optional)" : copy.changesLabel}
voice={signedIn ? true : "visitor"}
rows={Math.min(
10,
Math.max(3, changes.split("\n").length + Math.ceil(changes.length / 40)),
@@ -283,9 +287,9 @@ export function WebsiteChangeBrief({ signedIn }: { signedIn: boolean }) {
}
maxLength={COMMISSION.maxChanges}
value={changes}
onChange={(e) => {
onChange={(next) => {
requestId.current = "";
setChanges(e.target.value);
setChanges(next);
}}
/>
+4 -3
View File
@@ -6,6 +6,7 @@ import { patchJson } from "@/lib/api/fetch";
import type { UserPreferencesData } from "@/db/queries/user-preferences";
import { TOAST_SHORT_MS } from "@/lib/constants/timings";
import { Segmented } from "@/components/ui/segmented";
import { TextArea } from "@/components/ui/text-area";
// Quick-start voices — fill the textarea, then the user tunes from there.
// These are starting points, not an enum; the field is free text.
@@ -87,11 +88,11 @@ export function VoiceSettings({ initialPrefs }: Props) {
/>
<div className="space-y-1.5">
<textarea
<TextArea
ariaLabel="Writing voice"
value={voice}
onChange={(e) => setVoice(e.target.value.slice(0, MAX))}
onChange={(next) => setVoice(next.slice(0, MAX))}
rows={4}
className="ui-input"
placeholder="e.g. Concise and direct. Lead with the answer, no preamble. Plain language, no jargon."
/>
<p className="ui-kicker text-right">
+5 -1
View File
@@ -3,6 +3,7 @@ export function Field({
required = false,
aiTouched = false,
hint,
htmlFor,
children,
}: {
label: string;
@@ -11,11 +12,14 @@ export function Field({
aiTouched?: boolean;
/** One plain line under the field — what it is for, so the label stays a label. */
hint?: string;
/** The id of the control inside, so the label names it (and a press on the
* label focuses it). */
htmlFor?: string;
children: React.ReactNode;
}) {
return (
<div>
<label className="ui-kicker mb-1.5 block">
<label htmlFor={htmlFor} className="ui-kicker mb-1.5 block">
{label}
{required && <span className="text-status-negative"> *</span>}
{aiTouched && <span className="ui-assist-flag">AI</span>}
+44
View File
@@ -0,0 +1,44 @@
"use client";
import { DictationField, type DictationFieldProps } from "@bitbaum/chatkit/react";
import { LOKI_VOICE, VISITOR_VOICE } from "@/components/composer/voice";
import { cn } from "@/lib/utils";
export type TextAreaProps = Omit<
DictationFieldProps,
"value" | "onValueChange" | "voice" | "improve"
> & {
value: string;
onChange: (next: string) => void;
/** `"visitor"` on a page a signed-out person uses: the browser's own
* recogniser, since Loki's server leg answers them with 401 (the same
* choice as the Composer's `voice="visitor"`). */
voice?: true | "visitor";
};
/**
* Every text box in Loki that a person writes words into: the fleet's
* DictationField (@bitbaum/chatkit), so it has the microphone, 16px text on
* a phone and 44px controls, with Loki's own transcription as the server leg
* (the same as the Composer's; the browser's recogniser for a signed-out
* visitor). Not a hand-made <textarea>: fleet AGENTS.md,
* "The experience belongs to the package".
*
* The frame is drawn to match `ui-input` (globals.css, next to the composer
* overrides). A label drawn by <Field> needs `htmlFor` and the same `id`
* here; a field with no visible label passes `ariaLabel`.
*
* Code, JSON, commands and URL lists stay a plain <textarea>, with the file
* marked `experience-exempt`: dictated words would corrupt them.
*/
export function TextArea({ value, onChange, voice = true, className, ...rest }: TextAreaProps) {
return (
<DictationField
{...rest}
value={value}
onValueChange={onChange}
voice={voice === "visitor" ? VISITOR_VOICE : LOKI_VOICE}
className={cn("ui-text-area", className)}
/>
);
}