feat(fields): the remaining text boxes get the microphone; chatkit 0.27

The second step of the fleet's experience standard for Loki. The shared
field gained what a form's text area needs in bitbaum/chatkit#85 (0.27.0):
autoFocus, onKeyDown, a submit key, a field-level blur, name, inputProps.
Sixteen more files move onto <TextArea>; the experience audit goes
bareTextareas 17 -> 1 and the ceiling in package-plan.json follows.

Kept, file by file: Cmd/Ctrl+Enter saves where Cmd+Enter did (goal and
person notes, project description, the idea step), Escape still cancels,
Enter still sends an interview answer and confirms a queued prompt, notes
still save when focus leaves the field, and an inline editor no longer
closes when its microphone is pressed. The studio's forms still read their
text by name from the native form. The scheduled job's prompt keeps the
mono face and spell-check off. ProjectBriefFill's separate Speak button is
the field's own microphone now (the same transcribe route).

Left: control/prompt-input.tsx, a prompt box with its own attachments and
paste-to-attach. It is a composer, not a form field.

Checked: tsc, lint, the design gate, file inputs, 599 unit-test files; in a
browser, autofocus, both submit keys, Escape, save on blur and not on the
microphone, 44px microphone and 16px text at 390, and the chat and Home
composers after the bump.

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 09:47:24 +00:00
1 parent 9a9f3897cb
commit b210b7c813
22 files changed
+156 -121

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@
},
"experience": {
"ceiling": {
"bareTextareas": 17,
"bareTextareas": 1,
"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.25.0",
"@bitbaum/chatkit": "^0.27.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.25.0
version: 0.25.0(react@19.3.1)
specifier: ^0.27.0
version: 0.27.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.25.0':
resolution: {integrity: sha512-SVhGRltxG2a860pGawFAb1FdY0mr5ZGk0aOMoNT5FEmeczgZwlEfEzR5o8DQO7np8g26LiBpgqGRNEfp3AiNWw==}
'@bitbaum/chatkit@0.27.0':
resolution: {integrity: sha512-lP4Je32iCTBoxgwjWGrJd6SddsQ3jo4SSaxKZjX5Uq7DNwdUnbOI2Ti8un6La3QnPysqlNqOfC/m0VW9f2s3Xw==}
engines: {node: '>=20'}
hasBin: true
peerDependencies:
@@ -6038,7 +6038,7 @@ snapshots:
mermaid: 11.17.2
shiki: 4.5.0
'@bitbaum/chatkit@0.25.0(react@19.3.1)':
'@bitbaum/chatkit@0.27.0(react@19.3.1)':
dependencies:
pdfjs-dist: 6.4.299
react: 19.3.1
+2 -1
View File
@@ -5904,8 +5904,9 @@
.ui-fb-read-ask-text {
@apply block text-text-primary;
}
/* The ask's <TextArea>: the frame is the shared field's (.ui-text-area). */
.ui-fb-read-ask {
@apply mb-1 w-full rounded-lg border border-border-default bg-surface-base px-2.5 py-2 text-sm text-text-primary outline-none focus:border-border-interactive;
@apply mb-1 w-full;
}
.ui-fb-read-ask-actions {
@apply flex flex-wrap items-center gap-x-4;
@@ -12,6 +12,7 @@
import { useState } from "react";
import { CloudUpload, Loader2, ExternalLink } from "lucide-react";
import { Modal } from "@/components/ui/modal";
import { TextArea } from "@/components/ui/text-area";
import { postJson, throwApiError } from "@/lib/api/fetch";
type DispatchOk = { ok: true; hostedDispatchId: string; projectName: string; gitUrl: string };
@@ -87,13 +88,13 @@ export function HostedDispatchButton({
</div>
) : (
<>
<textarea
<TextArea
value={task}
onChange={(e) => setTask(e.target.value)}
onChange={setTask}
rows={5}
autoFocus
ariaLabel="The change to make"
placeholder="Describe the change… e.g. Add a CONTRIBUTING.md with build + test steps"
className="ui-input w-full resize-y"
disabled={submitting}
/>
{error && <p className="ui-error">{error}</p>}
@@ -3,6 +3,7 @@
import { Loader2, Sparkles, CheckCircle, XCircle, Copy, Rocket, ArrowLeft } from "lucide-react";
import { cn } from "@/lib/utils";
import { APP_NAME } from "@/config/brand";
import { TextArea } from "@/components/ui/text-area";
export interface Brief {
name: string;
@@ -117,18 +118,18 @@ export function DescribeStep({
}) {
return (
<>
<textarea
<TextArea
autoFocus
value={idea}
onChange={(e) => onIdeaChange(e.target.value)}
onKeyDown={(e) => e.key === "Enter" && e.metaKey && onGenerate()}
onChange={onIdeaChange}
onSubmit={onGenerate}
rows={6}
ariaLabel="Your idea"
placeholder={
"I'm building a tool that helps freelancers track invoices and get paid faster.\n" +
"Target: solo devs and designers who forget to follow up.\n" +
"Simple dashboard, automated reminders, Stripe payments…"
}
className="ui-input w-full resize-none leading-relaxed"
/>
{genError && <p className="ui-error">{genError}</p>}
<div className="flex gap-2 pt-1">
@@ -3,6 +3,7 @@
import { useState, useRef, useCallback } from "react";
import { Loader2, StickyNote } from "lucide-react";
import { patchJson } from "@/lib/api/fetch";
import { TextArea } from "@/components/ui/text-area";
import type { UserProject } from "@/db/schema/user-projects";
import { CollapsibleSection } from "./project-profile-sections";
@@ -58,13 +59,13 @@ export function NotesSection({
}
trailing={saving ? <Loader2 className="h-3 w-3 animate-spin text-text-muted" /> : undefined}
>
<textarea
<TextArea
value={value}
onChange={(e) => handleChange(e.target.value)}
onChange={handleChange}
onBlur={handleBlur}
ariaLabel="Notes"
placeholder="Free-form notes, context, or reminders for this project…"
rows={5}
className="w-full resize-y rounded-xl border border-border-subtle bg-surface-base px-3.5 py-2.5 text-sm leading-relaxed text-text-primary placeholder:text-text-muted focus:border-accent-primary/50 focus:outline-none focus:ring-1 focus:ring-accent-primary/20"
/>
</CollapsibleSection>
);
+9 -4
View File
@@ -4,6 +4,7 @@ import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
import { CheckSquare, GripVertical, Pencil, Send, Square, X } from "lucide-react";
import { cn } from "@/lib/utils";
import { TextArea } from "@/components/ui/text-area";
/**
* Props for a single queue row. The parent QueueList builds one of these
@@ -100,12 +101,15 @@ export function QueueItemRow({
{/* Content */}
{editing ? (
<textarea
<TextArea
// Mounts only when this row enters edit mode — autoFocus replaces
// the old ref + deferred .focus() (a ref may not cross render code).
autoFocus
value={editText}
onChange={(e) => onSetEditText(e.target.value)}
onChange={onSetEditText}
ariaLabel={`Queued prompt ${index + 1}`}
// Enter confirms (Shift+Enter is a new line), Escape cancels: the
// queue's own keys, so they stay here rather than in onSubmit.
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
@@ -113,10 +117,11 @@ export function QueueItemRow({
}
if (e.key === "Escape") onCancelEdit();
}}
// The whole field's blur: pressing its microphone does not confirm
// and close the editor under the finger.
onBlur={onConfirmEdit}
rows={2}
className="ui-input flex-1 resize-none text-sm"
style={{ fieldSizing: "content", maxHeight: "6rem" } as React.CSSProperties}
className="flex-1"
/>
) : (
<button
+4 -3
View File
@@ -9,6 +9,7 @@
*/
import { useState } from "react";
import { AlertCircle, Loader2, Pencil } from "lucide-react";
import { TextArea } from "@/components/ui/text-area";
import { READ_SIZE_WORD, READ_ASK_MAX, type FeedbackRead } from "@/lib/feedback/read-report";
export function ReadBlock({
@@ -63,13 +64,13 @@ export function ReadBlock({
<dt className="ui-fb-decision-fact-label">The ask</dt>
<dd className="ui-fb-decision-fact">
{editing ? (
<textarea
<TextArea
value={current}
onChange={(e) => onAsk(e.target.value)}
onChange={onAsk}
maxLength={READ_ASK_MAX}
rows={4}
className="ui-fb-read-ask"
aria-label="What the agent will be asked to do"
ariaLabel="What the agent will be asked to do"
autoFocus
/>
) : (
+5 -4
View File
@@ -16,6 +16,7 @@ import { PageLayout } from "@/components/ui/page-layout";
import { Section } from "@/components/ui/section-heading";
import { List, ListRow } from "@/components/ui/list-row";
import { EmptyState } from "@/components/ui/empty-state";
import { TextArea } from "@/components/ui/text-area";
import {
SheetAction,
SheetActions,
@@ -106,17 +107,17 @@ export function GoalDetail({
<Section title="About">
{g.descEdit.editing ? (
<div className="space-y-2">
<textarea
<TextArea
value={g.descEdit.draft}
onChange={(e) => g.descEdit.setDraft(e.target.value)}
onChange={g.descEdit.setDraft}
onKeyDown={(e) => {
if (e.key === "Escape") g.descEdit.cancel();
if (e.key === "Enter" && e.metaKey) g.commitDesc();
}}
onSubmit={g.commitDesc}
autoFocus
rows={3}
ariaLabel="Goal description"
placeholder="What this goal is for"
className="ui-input resize-none"
/>
<div className="flex items-center gap-2">
<button
+5 -4
View File
@@ -8,6 +8,7 @@ import { PageLayout } from "@/components/ui/page-layout";
import { Section as PageSection } from "@/components/ui/section-heading";
import { List, ListRow } from "@/components/ui/list-row";
import { DeleteButton } from "@/components/ui/delete-button";
import { TextArea } from "@/components/ui/text-area";
import {
SheetAction,
SheetActions,
@@ -130,17 +131,17 @@ export function PersonDetail({ person }: { person: PersonDetailData }) {
<PageSection title="Your note">
{descEdit.editing ? (
<div className="space-y-2">
<textarea
<TextArea
value={descEdit.draft}
onChange={(e) => descEdit.setDraft(e.target.value)}
onChange={descEdit.setDraft}
onKeyDown={(e) => {
if (e.key === "Escape") descEdit.cancel();
if (e.key === "Enter" && e.metaKey) commitDescription();
}}
onSubmit={commitDescription}
autoFocus
rows={4}
ariaLabel="Your note"
placeholder="How you know them, what they care about"
className="ui-input resize-none"
/>
<div className="flex items-center gap-2">
<button
+4 -3
View File
@@ -7,6 +7,7 @@ import type { ProjectHealth, ProjectHealthCheck } from "@/lib/project-health";
import { AI_FILLABLE_CHECKS, describeProjectHealth } from "@/lib/project-health";
import { setAttr, removeAttr } from "@/lib/api/attrs";
import { patchJson, postJson } from "@/lib/api/fetch";
import { TextArea } from "@/components/ui/text-area";
function scoreTone(score: number, max: number) {
const ratio = score / max;
@@ -326,13 +327,13 @@ export function HealthScoreBar({
removes the flag from the project.
</p>
) : check.fix.multiline ? (
<textarea
<TextArea
autoFocus
rows={3}
value={draft}
onChange={(e) => setDraft(e.target.value)}
onChange={setDraft}
ariaLabel={check.fix.placeholder}
placeholder={check.fix.placeholder}
className="ui-input w-full"
/>
) : (
<input
+13 -41
View File
@@ -1,17 +1,17 @@
"use client";
// The "no forms" intake. Instead of clicking through mission/vision/customers
// field by field, the user writes (or dictates via OS dictation) what the
// project should be — or pulls the answer straight from the repo's README —
// and AI fills the profile. Both paths land in the same SSOT the inline
// editors write to, so a wrong guess is one click from fixable.
// field by field, the user writes (or says, through the field's microphone)
// what the project should be — or pulls the answer straight from the repo's
// README — and AI fills the profile. Both paths land in the same SSOT the
// inline editors write to, so a wrong guess is one click from fixable.
import { useState } from "react";
import { GitBranch, ListChecks, Loader2, Mic, Sparkles, Square } from "lucide-react";
import { GitBranch, ListChecks, Loader2, Sparkles } from "lucide-react";
import { postJson } from "@/lib/api/fetch";
import { useVoiceInput } from "@/hooks/use-voice-input";
import { DOC_PASTE_MAX } from "@/lib/constants";
import { CharCount } from "@/components/ui/char-count";
import { TextArea } from "@/components/ui/text-area";
type AppliedFields = Record<string, string>;
@@ -31,11 +31,6 @@ export function ProjectBriefFill({
const [error, setError] = useState<string | null>(null);
const [appliedKeys, setAppliedKeys] = useState<string[] | null>(null);
const [createdGoals, setCreatedGoals] = useState<string[] | null>(null);
const voice = useVoiceInput({
// Speaking is the fastest "no forms" path — append so users can mix
// dictation with typed/pasted notes before one AI fill pass.
onTranscript: (t) => setText((prev) => (prev ? `${prev.trimEnd()} ${t}` : t)),
});
async function run(kind: "brief" | "enrich" | "roadmap") {
setBusy(kind);
@@ -105,13 +100,17 @@ export function ProjectBriefFill({
{open && (
<div className="space-y-2 rounded-lg border border-border-subtle bg-surface-raised p-3">
<textarea
{/* Speaking is the fastest "no forms" path: the field's microphone
appends to what is there, so dictation mixes with typed or
pasted notes before one AI fill pass. It replaces the separate
"Speak" button this form had (the same transcribe route). */}
<TextArea
value={text}
onChange={(e) => setText(e.target.value)}
onChange={setText}
autoFocus
rows={4}
ariaLabel="What this project is and should become"
placeholder="Free form — what is this project, who is it for, what should it become, what's next? Paste notes, dictate, anything. AI sorts it into the profile."
className="ui-input w-full text-base leading-relaxed sm:text-xs"
onKeyDown={(e) => {
if (e.key === "Escape") setOpen(false);
}}
@@ -145,43 +144,16 @@ export function ProjectBriefFill({
)}
Generate milestones
</button>
{voice.isSupported && (
<button
onClick={() => (voice.status === "recording" ? voice.stop() : voice.start())}
disabled={busy !== null || voice.status === "transcribing"}
className="ui-btn-chip ui-tap gap-1.5 px-3 text-xs"
title={
voice.status === "recording"
? "Stop recording"
: "Dictate — speak what this project should be"
}
>
{voice.status === "transcribing" ? (
<Loader2 className="h-3.5 w-3.5 animate-spin" />
) : voice.status === "recording" ? (
<Square className="h-3.5 w-3.5 text-status-negative" />
) : (
<Mic className="h-3.5 w-3.5 text-accent-text" />
)}
{voice.status === "recording"
? "Stop"
: voice.status === "transcribing"
? "Transcribing…"
: "Speak"}
</button>
)}
<button
onClick={() => {
setOpen(false);
setError(null);
voice.cancel();
}}
className="ui-btn-text-cancel ui-tap"
>
Cancel
</button>
</div>
{voice.error && <p className="ui-error-xs">{voice.error}</p>}
</div>
)}
+4 -3
View File
@@ -10,6 +10,7 @@ import { Loader2, RefreshCw, Check, X, Plus } from "lucide-react";
import { postJson } from "@/lib/api/fetch";
import { DOC_PASTE_MAX } from "@/lib/constants";
import { CharCount } from "@/components/ui/char-count";
import { TextArea } from "@/components/ui/text-area";
type Update = { key: string; current: string | null; proposed: string };
type NewAttr = { key: string; label: string; value: string };
@@ -119,13 +120,13 @@ export function ProjectDocSync({
{open && !preview && (
<div className="space-y-2 rounded-lg border border-border-subtle bg-surface-raised p-3">
<textarea
<TextArea
value={text}
onChange={(e) => setText(e.target.value)}
onChange={setText}
autoFocus
rows={4}
ariaLabel="The updated concept or spec"
placeholder="Paste the updated concept or spec. AI diffs it against the current fields and shows you exactly what would change before anything is saved."
className="ui-input w-full text-base leading-relaxed sm:text-xs"
onKeyDown={(e) => {
if (e.key === "Escape") setOpen(false);
}}
+4 -3
View File
@@ -3,6 +3,7 @@
import { useState } from "react";
import { useRouter } from "next/navigation";
import { Loader2, Plus, X } from "lucide-react";
import { TextArea } from "@/components/ui/text-area";
import { HEALTH_SIGNAL_CONFIG } from "./project-badges";
import { setAttr, removeAttr } from "@/lib/api/attrs";
import { timeAgo } from "@/lib/dates";
@@ -127,13 +128,13 @@ export function ProjectFlags({
{isEditing ? (
<div className="mt-2 space-y-2">
<textarea
<TextArea
autoFocus
rows={3}
value={draft}
onChange={(e) => setDraft(e.target.value)}
onChange={setDraft}
ariaLabel={`What is wrong: ${cfg.label}`}
placeholder={`What is wrong? e.g. ${cfg.label.toLowerCase()} on the checkout page`}
className="ui-textarea w-full text-sm"
/>
<div className="flex flex-wrap gap-2">
<button
@@ -5,6 +5,7 @@ import { Loader2, Pencil } from "lucide-react";
import { StatusBadge } from "./project-badges";
import { useInlineEdit } from "@/hooks/use-inline-edit";
import { cn } from "@/lib/utils";
import { TextArea } from "@/components/ui/text-area";
/** Inline-editable description (button ↔ textarea + Save/Cancel). */
export function DescriptionEditor({
@@ -48,20 +49,17 @@ export function DescriptionEditor({
if (ie.editing) {
return (
<div className="mt-1.5 space-y-1.5">
<textarea
<TextArea
value={ie.draft}
onChange={(e) => ie.setDraft(e.target.value)}
onChange={ie.setDraft}
onKeyDown={(e) => {
if (e.key === "Escape") ie.cancel();
if (e.key === "Enter" && e.metaKey) commit();
}}
onSubmit={() => void commit()}
autoFocus
rows={size === "full" ? 6 : 2}
ariaLabel="Description"
placeholder="Add a description…"
className={cn(
"ui-input-inline w-full resize-none px-2 py-1.5 text-text-primary placeholder:text-text-muted",
size !== "compact" ? "text-sm sm:text-base" : "text-xs",
)}
/>
<div className="flex items-center gap-2">
<button onClick={commit} disabled={ie.saving} className="ui-btn-save">
+4 -4
View File
@@ -22,6 +22,7 @@ import { useEffect, useRef, useState } from "react";
import { useRouter } from "next/navigation";
import { ArrowRight, Check, Loader2, MessageCircleQuestion, SkipForward } from "lucide-react";
import { postJson } from "@/lib/api/fetch";
import { TextArea } from "@/components/ui/text-area";
import {
INTERVIEW_ANSWER_MAX,
interviewIntro,
@@ -203,10 +204,10 @@ export function ProjectInterview({
<span className="mt-1 block text-sm text-text-muted">{current.hint}</span>
</label>
<textarea
<TextArea
id="project-interview-answer"
value={draft}
onChange={(event) => setDraft(event.target.value)}
onChange={setDraft}
onKeyDown={(event) => {
// Enter sends, Shift+Enter breaks the line. Five questions with a
// mouse trip between each is the form this exists to not be.
@@ -219,9 +220,8 @@ export function ProjectInterview({
maxLength={INTERVIEW_ANSWER_MAX}
autoFocus
disabled={saving}
className="ui-input w-full min-w-0"
placeholder="Type your answer…"
aria-describedby="project-interview-count"
inputProps={{ "aria-describedby": "project-interview-count" }}
/>
{/* The limit, said out loud. `maxLength` stops the keyboard at the cap
and says nothing, so an owner writing a considered answer watched
+3 -2
View File
@@ -33,8 +33,9 @@ export function HeroComposer({ signedIn }: { signedIn: boolean }) {
// Keep the words in the box while the next page loads.
return false;
}}
// One line on a 390px screen (the box holds about 38 characters).
placeholder="A website for my bakery, with a map…"
// One line on the narrowest phone: at 320px the box holds about
// thirty characters, and a longer example was cut mid-word.
placeholder="A website for my bakery…"
ariaLabel="Say what you want built"
attach={false}
voice={signedIn ? true : "visitor"}
+8 -4
View File
@@ -15,6 +15,7 @@ import {
} from "@/config/actors";
import { patchJson, deleteJson, throwApiError } from "@/lib/api/fetch";
import { Field } from "@/components/ui/form";
import { TextArea } from "@/components/ui/text-area";
export function RobotProfile({ robot }: { robot: RobotWithAttributes }) {
const router = useRouter();
@@ -141,15 +142,18 @@ export function RobotProfile({ robot }: { robot: RobotWithAttributes }) {
/>
</Field>
</div>
<Field label="Notes">
<textarea
<Field label="Notes" htmlFor="robot-notes">
<TextArea
id="robot-notes"
ariaLabel="Notes"
value={description}
onChange={(e) => setDescription(e.target.value)}
onChange={setDescription}
// The whole field's blur: tabbing or pressing away saves; pressing
// the microphone does not, and a take's words land before it does.
onBlur={() => {
if (description !== (robot.description ?? "")) void save({ description });
}}
rows={3}
className="ui-input"
/>
</Field>
</div>
+46 -16
View File
@@ -1,5 +1,6 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { useEffect, useId, useRef, useState } from "react";
import { TextArea } from "@/components/ui/text-area";
import { STUDIO, STUDIO_STATUS } from "@/config/studio";
import type { listStudioRequests, StudioReviewView } from "@/db/queries/studio-requests";
@@ -64,18 +65,12 @@ export function StudioRequests({
}
}
const value = (form: HTMLFormElement, name: string) => String(new FormData(form).get(name) ?? "");
const label = (name: string, title: string, textarea = false, initial = "") => (
<label className="block space-y-2 text-sm text-text-secondary">
{title}
{textarea ? (
<textarea
name={name}
className="ui-input min-h-28 w-full text-base"
required
maxLength={2000}
defaultValue={initial}
/>
) : (
const label = (name: string, title: string, textarea = false, initial = "") =>
textarea ? (
<StudioTextArea name={name} title={title} initial={initial} />
) : (
<label className="block space-y-2 text-sm text-text-secondary">
{title}
<input
name={name}
className="ui-input w-full text-base"
@@ -83,9 +78,8 @@ export function StudioRequests({
maxLength={2000}
defaultValue={initial}
/>
)}
</label>
);
</label>
);
const send = (title: string) => (
<button className="ui-btn-primary min-h-11" disabled={busy}>
{busy ? "Saving…" : title}
@@ -496,3 +490,39 @@ export function StudioRequests({
</div>
);
}
/**
* A studio reply, reason or assessment: words, so the shared field with its
* microphone. Still read by name from the native form (`new FormData`); the
* field is controlled here only because DictationField is, starting from the
* same initial text the plain box took as `defaultValue`.
*/
function StudioTextArea({
name,
title,
initial,
}: {
name: string;
title: string;
initial: string;
}) {
const id = useId();
const [text, setText] = useState(initial);
return (
<div className="space-y-2 text-sm text-text-secondary">
<label htmlFor={id} className="block">
{title}
</label>
<TextArea
id={id}
name={name}
ariaLabel={title}
value={text}
onChange={setText}
required
maxLength={2000}
rows={4}
/>
</div>
);
}
+13 -5
View File
@@ -6,6 +6,7 @@ import { formatDistanceToNow } from "date-fns";
import type { CronJob } from "@/lib/crons-shared";
import { humanCronSchedule } from "@/lib/crons-shared";
import { Drawer } from "@/components/ui/modal";
import { TextArea } from "@/components/ui/text-area";
import { postJson } from "@/lib/api/fetch";
import { FEEDBACK_MEDIUM_MS } from "@/lib/constants/timings";
@@ -202,7 +203,9 @@ export function JobDetail({
{/* Prompt editor */}
<div>
<div className="flex items-center justify-between mb-2">
<span className="ui-kicker text-text-secondary">Prompt</span>
<label htmlFor="job-prompt" className="ui-kicker text-text-secondary">
Prompt
</label>
{isDirty && (
<button onClick={handleSave} disabled={saving} className="ui-btn-confirm">
<Send className="h-3 w-3" />
@@ -216,12 +219,17 @@ export function JobDetail({
</span>
)}
</div>
<textarea
{/* The job's prompt: words for an agent, so the shared field with its
microphone, set in the mono face like the prompt library's
(PromptForm), with spell-check off as it always was here. */}
<TextArea
id="job-prompt"
ariaLabel="Prompt"
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
onChange={setPrompt}
rows={14}
className="w-full rounded-md bg-surface-base border border-border-subtle p-3 text-xs font-mono text-text-secondary focus:outline-none focus:border-border-strong resize-y leading-relaxed"
spellCheck={false}
className="ui-text-area-mono"
inputProps={{ spellCheck: false }}
/>
</div>
</div>
+7
View File
@@ -28,6 +28,13 @@ export type TextAreaProps = Omit<
* overrides). A label drawn by <Field> needs `htmlFor` and the same `id`
* here; a field with no visible label passes `ariaLabel`.
*
* Every other DictationField prop passes straight through (chatkit 0.27):
* `name` for a native form post, `autoFocus`, `readOnly`, `invalid`/`error`,
* `onKeyDown` (runs first), `onSubmit` (the package's submit keys: Cmd/Ctrl+
* Enter here), `onFocus`/`onBlur` (the WHOLE field's: pressing the microphone
* is not a blur, and a blur during a take waits for its words), `inputRef`,
* and `inputProps` (`spellCheck`, `aria-*`, `data-*`, `onPaste`).
*
* Code, JSON, commands and URL lists stay a plain <textarea>, with the file
* marked `experience-exempt`: dictated words would corrupt them.
*/