@burdenoff/microfe-healthybowl 2026.813.16 → 2026.813.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/assistant/composer/AssistantComposer.js +50 -46
- package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
- package/dist/healthybowl/components/PlanExecutionPanel.js +161 -154
- package/dist/healthybowl/components/PlanExecutionPanel.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/usePlanExecution.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +252 -238
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/dist/hooks/useAssistantAttachments.js +4 -3
- package/dist/hooks/useAssistantAttachments.js.map +1 -1
- package/dist/utils/assistantAttachments.js +70 -64
- package/dist/utils/assistantAttachments.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
-
import "../../../utils/assistantAttachments.js";
|
|
3
|
-
import { useVoiceInput as
|
|
2
|
+
import { getSendableAttachments as t } from "../../../utils/assistantAttachments.js";
|
|
3
|
+
import { useVoiceInput as ee } from "../../../hooks/useVoiceInput.js";
|
|
4
4
|
import { useAssistantAttachments as n } from "../../../hooks/useAssistantAttachments.js";
|
|
5
5
|
import { AssistantAttachmentButton as r } from "./AssistantAttachmentButton.js";
|
|
6
6
|
import { AssistantAttachmentChips as i } from "./AssistantAttachmentChips.js";
|
|
@@ -11,36 +11,36 @@ import { ArrowUp as d, Loader2 as f } from "lucide-react";
|
|
|
11
11
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/assistant/composer/AssistantComposer.tsx
|
|
13
13
|
var h = 200, g = ({ onSend: g, disabled: _ = !1, placeholder: v, mode: y, availableModes: b, onModeChange: x }) => {
|
|
14
|
-
let S = e(), C = l(null), [w, T] = u(""), [E, D] = u(!1), O = l(0), { attachments: k, isBusy: A,
|
|
14
|
+
let S = e(), C = l(null), [w, T] = u(""), [E, D] = u(!1), O = l(0), { attachments: k, isBusy: A, sendBlocker: j, rejection: M, addFiles: N, remove: P, retry: F, clear: I, clearRejection: L, canAddMore: R } = n(), z = ee({ onFinalize: s((e) => {
|
|
15
15
|
T((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
16
|
-
}, []) }),
|
|
16
|
+
}, []) }), B = v ?? S("healthybowl.assistant.composer.placeholder", "Ask HealthyBowl anything…"), V = w.trim(), H = t(k), U = k.filter((e) => e.status === "error"), W = (V.length > 0 || H.length > 0) && !_ && j === null;
|
|
17
17
|
c(() => {
|
|
18
18
|
let e = C.current;
|
|
19
19
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, h)}px`);
|
|
20
20
|
}, [w]);
|
|
21
|
-
let
|
|
22
|
-
|
|
21
|
+
let G = s(() => {
|
|
22
|
+
W && (z.isListening && z.stop(), g(w.trim(), H), T(""), I());
|
|
23
23
|
}, [
|
|
24
|
-
|
|
24
|
+
W,
|
|
25
25
|
g,
|
|
26
26
|
w,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
32
|
-
}, [
|
|
27
|
+
H,
|
|
28
|
+
I,
|
|
29
|
+
z
|
|
30
|
+
]), K = s((e) => {
|
|
31
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), G());
|
|
32
|
+
}, [G]), q = s((e) => {
|
|
33
33
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
34
|
-
t.length !== 0 && (e.preventDefault(),
|
|
35
|
-
}, [
|
|
34
|
+
t.length !== 0 && (e.preventDefault(), N(t));
|
|
35
|
+
}, [N]), J = s((e) => {
|
|
36
36
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (O.current += 1, D(!0));
|
|
37
|
-
}, []),
|
|
37
|
+
}, []), Y = s(() => {
|
|
38
38
|
O.current = Math.max(0, O.current - 1), O.current === 0 && D(!1);
|
|
39
|
-
}, []),
|
|
39
|
+
}, []), X = s((e) => {
|
|
40
40
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
41
|
-
}, []),
|
|
42
|
-
e.preventDefault(), O.current = 0, D(!1),
|
|
43
|
-
}, [
|
|
41
|
+
}, []), Z = s((e) => {
|
|
42
|
+
e.preventDefault(), O.current = 0, D(!1), N(e.dataTransfer?.files ?? null);
|
|
43
|
+
}, [N]), Q = (e) => {
|
|
44
44
|
switch (e) {
|
|
45
45
|
case "too-many": return S("healthybowl.assistant.attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
46
46
|
case "too-large": return S("healthybowl.assistant.attachments.tooLarge", "That file is larger than 10 MB.");
|
|
@@ -48,8 +48,8 @@ var h = 200, g = ({ onSend: g, disabled: _ = !1, placeholder: v, mode: y, availa
|
|
|
48
48
|
case "unreadable": return S("healthybowl.assistant.attachments.unreadable", "That file could not be read.");
|
|
49
49
|
case "unsupported-image": return S("healthybowl.assistant.attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
|
|
50
50
|
}
|
|
51
|
-
},
|
|
52
|
-
switch (
|
|
51
|
+
}, $ = (() => {
|
|
52
|
+
switch (z.error) {
|
|
53
53
|
case "not-allowed": return S("healthybowl.assistant.voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
54
54
|
case "audio-capture": return S("healthybowl.assistant.voice.noMic", "No microphone was found.");
|
|
55
55
|
case "network": return S("healthybowl.assistant.voice.network", "Speech recognition is offline right now.");
|
|
@@ -60,50 +60,50 @@ var h = 200, g = ({ onSend: g, disabled: _ = !1, placeholder: v, mode: y, availa
|
|
|
60
60
|
return /* @__PURE__ */ m("div", {
|
|
61
61
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
62
62
|
children: [/* @__PURE__ */ m("div", {
|
|
63
|
-
onDragEnter:
|
|
64
|
-
onDragLeave:
|
|
65
|
-
onDragOver:
|
|
66
|
-
onDrop:
|
|
63
|
+
onDragEnter: J,
|
|
64
|
+
onDragLeave: Y,
|
|
65
|
+
onDragOver: X,
|
|
66
|
+
onDrop: Z,
|
|
67
67
|
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${E ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
|
|
68
68
|
"data-testid": "assistant-composer",
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ p(i, {
|
|
71
71
|
attachments: k,
|
|
72
|
-
onRemove:
|
|
73
|
-
onRetry:
|
|
72
|
+
onRemove: P,
|
|
73
|
+
onRetry: F,
|
|
74
74
|
disabled: _
|
|
75
75
|
}),
|
|
76
76
|
/* @__PURE__ */ m("div", {
|
|
77
77
|
className: "flex items-end gap-2",
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ p(r, {
|
|
80
|
-
onFiles:
|
|
81
|
-
canAddMore:
|
|
80
|
+
onFiles: N,
|
|
81
|
+
canAddMore: R,
|
|
82
82
|
disabled: _
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ p("textarea", {
|
|
85
85
|
ref: C,
|
|
86
86
|
value: w,
|
|
87
87
|
onChange: (e) => T(e.target.value),
|
|
88
|
-
onKeyDown:
|
|
89
|
-
onPaste:
|
|
88
|
+
onKeyDown: K,
|
|
89
|
+
onPaste: q,
|
|
90
90
|
disabled: _,
|
|
91
|
-
placeholder: E ? S("healthybowl.assistant.composer.dropHere", "Drop files to attach") :
|
|
91
|
+
placeholder: E ? S("healthybowl.assistant.composer.dropHere", "Drop files to attach") : B,
|
|
92
92
|
rows: 1,
|
|
93
93
|
className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
94
94
|
"aria-label": S("healthybowl.assistant.chatInput.ariaLabel", "Message input"),
|
|
95
95
|
"data-testid": "assistant-input"
|
|
96
96
|
}),
|
|
97
|
-
|
|
98
|
-
isListening:
|
|
99
|
-
onToggle:
|
|
97
|
+
z.isSupported && /* @__PURE__ */ p(a, {
|
|
98
|
+
isListening: z.isListening,
|
|
99
|
+
onToggle: z.toggle,
|
|
100
100
|
disabled: _
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ p("button", {
|
|
103
103
|
type: "button",
|
|
104
|
-
onClick:
|
|
105
|
-
disabled: !
|
|
106
|
-
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${
|
|
104
|
+
onClick: G,
|
|
105
|
+
disabled: !W,
|
|
106
|
+
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${W ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
|
|
107
107
|
"aria-label": S("healthybowl.assistant.chatInput.send", "Send message"),
|
|
108
108
|
"data-testid": "assistant-send",
|
|
109
109
|
children: _ || A ? /* @__PURE__ */ p(f, { className: "size-4 animate-spin" }) : /* @__PURE__ */ p(d, { className: "size-4" })
|
|
@@ -123,20 +123,24 @@ var h = 200, g = ({ onSend: g, disabled: _ = !1, placeholder: v, mode: y, availa
|
|
|
123
123
|
}), /* @__PURE__ */ p("div", {
|
|
124
124
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
125
125
|
"aria-live": "polite",
|
|
126
|
-
children:
|
|
126
|
+
children: z.isListening ? /* @__PURE__ */ m("p", {
|
|
127
127
|
className: "text-status-error-text",
|
|
128
128
|
"data-testid": "assistant-voice-status",
|
|
129
|
-
children: [/* @__PURE__ */ p("span", { className: "mr-1 inline-block size-1.5 rounded-full bg-status-error-text align-middle motion-safe:animate-pulse" }),
|
|
130
|
-
}) :
|
|
129
|
+
children: [/* @__PURE__ */ p("span", { className: "mr-1 inline-block size-1.5 rounded-full bg-status-error-text align-middle motion-safe:animate-pulse" }), z.interim || S("healthybowl.assistant.voice.listening", "Listening… speak now, tap the square to stop")]
|
|
130
|
+
}) : $ ? /* @__PURE__ */ p("p", {
|
|
131
131
|
className: "text-status-error-text",
|
|
132
132
|
"data-testid": "assistant-voice-error",
|
|
133
|
-
children:
|
|
134
|
-
}) :
|
|
133
|
+
children: $
|
|
134
|
+
}) : M ? /* @__PURE__ */ p("button", {
|
|
135
135
|
type: "button",
|
|
136
|
-
onClick:
|
|
136
|
+
onClick: L,
|
|
137
137
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
138
138
|
"data-testid": "assistant-attachment-rejection",
|
|
139
|
-
children:
|
|
139
|
+
children: Q(M)
|
|
140
|
+
}) : j === "failed" ? /* @__PURE__ */ p("p", {
|
|
141
|
+
className: "text-status-error-text",
|
|
142
|
+
"data-testid": "assistant-attachment-blocked",
|
|
143
|
+
children: U.length === 1 ? S("healthybowl.assistant.attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: U[0].filename }) : S("healthybowl.assistant.attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: U.length })
|
|
140
144
|
}) : /* @__PURE__ */ p("p", {
|
|
141
145
|
className: "text-text-muted",
|
|
142
146
|
children: S("healthybowl.assistant.composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantComposer.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantComposer.tsx"],"sourcesContent":["import {\n useCallback,\n useLayoutEffect,\n useRef,\n useState,\n type ClipboardEvent,\n type DragEvent,\n type FC,\n type KeyboardEvent,\n} from 'react';\nimport { ArrowUp, Loader2 } from 'lucide-react';\nimport type { AssistantMode, AssistantModeConfig } from '@/types/assistant';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useVoiceInput } from '@/hooks/useVoiceInput';\nimport { useAssistantAttachments } from '@/hooks/useAssistantAttachments';\nimport { MAX_ATTACHMENTS, type AssistantAttachment, type AttachmentRejection } from '@/utils/assistantAttachments';\nimport { AssistantAttachmentButton } from './AssistantAttachmentButton';\nimport { AssistantAttachmentChips } from './AssistantAttachmentChips';\nimport { AssistantVoiceButton } from './AssistantVoiceButton';\nimport { AssistantModeSelector } from './AssistantModeSelector';\n\ninterface Props {\n /**\n * Send the message. `attachments` are already uploaded and ready; the chat\n * area folds them into the prompt and onto the user bubble.\n */\n onSend: (message: string, attachments: AssistantAttachment[]) => void;\n /** True while a turn is in-flight (assistant busy) — disables send + shows the spinner. */\n disabled?: boolean;\n placeholder?: string;\n mode: AssistantMode;\n /** Role-filtered list of modes the user may pick. */\n availableModes: AssistantModeConfig[];\n onModeChange: (mode: AssistantMode) => void;\n}\n\nconst MAX_TEXTAREA_HEIGHT = 200;\n\n/**\n * AssistantComposer — the v2 input surface (per the ai-assistant-v2 mockups).\n *\n * A rounded card with, on the input row: a leading circular \"+\" attach control,\n * an auto-growing textarea, a microphone, and a prominent filled forest-green\n * circular send button. BELOW the input sit the mode pills (\"Ask\" active-green /\n * \"Take action\" outline); ABOVE it, chips for any pending attachments.\n *\n * Multimodal input (Workstreams 2–3) arrives through three converging paths —\n * the attach button, drag-and-drop onto the card, and paste (a screenshot from\n * the clipboard is the single most common way a user shares one) — plus voice\n * dictation, which appends recognised speech to the draft so it can still be\n * edited before sending.\n *\n * Fully controlled (React state for the text) with auto-grow via a layout\n * effect. Enter sends, Shift+Enter inserts a newline.\n */\nexport const AssistantComposer: FC<Props> = ({\n onSend,\n disabled = false,\n placeholder,\n mode,\n availableModes,\n onModeChange,\n}) => {\n const tr = useTr();\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [text, setText] = useState('');\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n // Nested drag-enter/leave pairs fire for every child element; count them so\n // the highlight survives dragging across the textarea and buttons.\n const dragDepthRef = useRef(0);\n\n const {\n attachments,\n isBusy: attachmentsBusy,\n rejection,\n addFiles,\n remove,\n retry,\n clear,\n clearRejection,\n canAddMore,\n } = useAssistantAttachments();\n\n const appendTranscript = useCallback((phrase: string) => {\n setText((current) => (current ? `${current.replace(/\\s+$/, '')} ${phrase}` : phrase));\n }, []);\n\n const voice = useVoiceInput({ onFinalize: appendTranscript });\n\n const resolvedPlaceholder =\n placeholder ?? tr('healthybowl.assistant.composer.placeholder', 'Ask HealthyBowl anything…');\n const trimmed = text.trim();\n const readyAttachments = attachments.filter((attachment) => attachment.status === 'ready');\n // A message may be attachments-only (\"what's wrong with this leaf?\" is often\n // just the photo), but never sends while an upload is still in flight.\n const canSend = (trimmed.length > 0 || readyAttachments.length > 0) && !disabled && !attachmentsBusy;\n\n // Auto-grow the textarea to fit its content (capped), re-measured after every\n // value change so the card breathes as the user types.\n useLayoutEffect(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, MAX_TEXTAREA_HEIGHT)}px`;\n }, [text]);\n\n const handleSend = useCallback(() => {\n if (!canSend) return;\n // Dictation left running into a send would keep appending to a cleared\n // draft; stop it so the mic state matches what the user sees.\n if (voice.isListening) voice.stop();\n onSend(text.trim(), readyAttachments);\n setText('');\n clear();\n }, [canSend, onSend, text, readyAttachments, clear, voice]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n const handlePaste = useCallback(\n (event: ClipboardEvent<HTMLTextAreaElement>) => {\n const files = Array.from(event.clipboardData?.files ?? []);\n if (files.length === 0) return;\n // Only claim the paste when it carried files; a normal text paste (which\n // also exposes an empty `files`) must still land in the textarea.\n event.preventDefault();\n addFiles(files);\n },\n [addFiles]\n );\n\n const handleDragEnter = useCallback((event: DragEvent<HTMLDivElement>) => {\n if (!Array.from(event.dataTransfer?.types ?? []).includes('Files')) return;\n dragDepthRef.current += 1;\n setIsDraggingOver(true);\n }, []);\n\n const handleDragLeave = useCallback(() => {\n dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n if (dragDepthRef.current === 0) setIsDraggingOver(false);\n }, []);\n\n const handleDragOver = useCallback((event: DragEvent<HTMLDivElement>) => {\n if (!Array.from(event.dataTransfer?.types ?? []).includes('Files')) return;\n // Required for a drop to fire at all, and stops the browser from navigating\n // away to the dropped file.\n event.preventDefault();\n }, []);\n\n const handleDrop = useCallback(\n (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n dragDepthRef.current = 0;\n setIsDraggingOver(false);\n addFiles(event.dataTransfer?.files ?? null);\n },\n [addFiles]\n );\n\n const rejectionMessage = (reason: AttachmentRejection): string => {\n switch (reason) {\n case 'too-many':\n return tr('healthybowl.assistant.attachments.tooMany', 'You can attach up to {{max}} files per message.', {\n max: MAX_ATTACHMENTS,\n });\n case 'too-large':\n return tr('healthybowl.assistant.attachments.tooLarge', 'That file is larger than 10 MB.');\n case 'empty':\n return tr('healthybowl.assistant.attachments.empty', 'That file is empty.');\n case 'unreadable':\n return tr('healthybowl.assistant.attachments.unreadable', 'That file could not be read.');\n case 'unsupported-image':\n return tr(\n 'healthybowl.assistant.attachments.unsupportedImage',\n \"This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.\"\n );\n }\n };\n\n const voiceErrorMessage = (): string | null => {\n switch (voice.error) {\n case 'not-allowed':\n return tr(\n 'healthybowl.assistant.voice.denied',\n 'Microphone access is blocked. Allow it in your browser settings to dictate.'\n );\n case 'audio-capture':\n return tr('healthybowl.assistant.voice.noMic', 'No microphone was found.');\n case 'network':\n return tr('healthybowl.assistant.voice.network', 'Speech recognition is offline right now.');\n case 'unknown':\n return tr('healthybowl.assistant.voice.failed', 'Dictation stopped unexpectedly.');\n default:\n return null;\n }\n };\n\n const voiceError = voiceErrorMessage();\n\n return (\n <div className=\"flex-shrink-0 px-3 pb-3 pt-1.5\">\n <div\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={`rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${\n isDraggingOver\n ? 'border-action-primary-bg border-dashed bg-action-primary-bg/5'\n : 'border-border-default bg-bg-sunken'\n }`}\n data-testid=\"assistant-composer\"\n >\n <AssistantAttachmentChips attachments={attachments} onRemove={remove} onRetry={retry} disabled={disabled} />\n\n {/* Input row: attach · textarea · mic · send */}\n <div className=\"flex items-end gap-2\">\n <AssistantAttachmentButton onFiles={addFiles} canAddMore={canAddMore} disabled={disabled} />\n\n <textarea\n ref={textareaRef}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n disabled={disabled}\n placeholder={\n isDraggingOver\n ? tr('healthybowl.assistant.composer.dropHere', 'Drop files to attach')\n : resolvedPlaceholder\n }\n rows={1}\n className=\"min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50\"\n aria-label={tr('healthybowl.assistant.chatInput.ariaLabel', 'Message input')}\n data-testid=\"assistant-input\"\n />\n\n {voice.isSupported && (\n <AssistantVoiceButton isListening={voice.isListening} onToggle={voice.toggle} disabled={disabled} />\n )}\n\n <button\n type=\"button\"\n onClick={handleSend}\n disabled={!canSend}\n className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${\n canSend\n ? 'bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover'\n : 'bg-bg-elevated text-text-muted'\n }`}\n aria-label={tr('healthybowl.assistant.chatInput.send', 'Send message')}\n data-testid=\"assistant-send\"\n >\n {disabled || attachmentsBusy ? <Loader2 className=\"size-4 animate-spin\" /> : <ArrowUp className=\"size-4\" />}\n </button>\n </div>\n\n {/* Mode pills */}\n {availableModes.length > 1 && (\n <div className=\"mt-2 px-0.5\">\n <AssistantModeSelector\n mode={mode}\n availableModes={availableModes}\n onModeChange={onModeChange}\n disabled={disabled}\n />\n </div>\n )}\n </div>\n\n {/* One status line under the card: live dictation > voice error >\n attachment rejection > the keyboard hint. Announced politely so a\n screen-reader user hears dictation land without losing their place. */}\n <div className=\"mt-1.5 px-1 text-center text-[11px]\" aria-live=\"polite\">\n {voice.isListening ? (\n <p className=\"text-status-error-text\" data-testid=\"assistant-voice-status\">\n <span className=\"mr-1 inline-block size-1.5 rounded-full bg-status-error-text align-middle motion-safe:animate-pulse\" />\n {voice.interim ||\n tr('healthybowl.assistant.voice.listening', 'Listening… speak now, tap the square to stop')}\n </p>\n ) : voiceError ? (\n <p className=\"text-status-error-text\" data-testid=\"assistant-voice-error\">\n {voiceError}\n </p>\n ) : rejection ? (\n <button\n type=\"button\"\n onClick={clearRejection}\n className=\"text-status-error-text underline-offset-2 hover:underline\"\n data-testid=\"assistant-attachment-rejection\"\n >\n {rejectionMessage(rejection)}\n </button>\n ) : (\n <p className=\"text-text-muted\">\n {tr(\n 'healthybowl.assistant.composer.hint',\n 'Enter to send · Shift+Enter for newline · drag or paste files to attach'\n )}\n </p>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoCA,IAAM,IAAsB,KAmBf,KAAgC,EAC3C,WACA,cAAW,IACX,gBACA,SACA,mBACA,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAc,EAA4B,KAAK,EAC/C,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAgB,KAAqB,EAAS,GAAM,EAGrD,IAAe,EAAO,EAAE,EAExB,EACJ,gBACA,QAAQ,GACR,cACA,aACA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AD;OACE,KAAK;OACL,OAAO;OACP,WAAW,MAAU,EAAQ,EAAM,OAAO,MAAM;OAChD,WAAW;OACX,SAAS;OACC;OACV,aACE,IACI,EAAG,2CAA2C,uBAAuB,GACrE;OAEN,MAAM;OACN,WAAU;OACV,cAAY,EAAG,6CAA6C,gBAAgB;OAC5E,eAAY;OACZ,CAAA;MAED,EAAM,eACL,kBAAC,GAAD;OAAsB,aAAa,EAAM;OAAa,UAAU,EAAM;OAAkB;OAAY,CAAA;MAGtG,kBAAC,UAAD;OACE,MAAK;OACL,SAAS;OACT,UAAU,CAAC;OACX,WAAW,wKACT,IACI,mGACA;OAEN,cAAY,EAAG,wCAAwC,eAAe;OACtE,eAAY;iBAEX,KAAY,IAAkB,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAAG,kBAAC,GAAD,EAAS,WAAU,UAAW,CAAA;OACpG,CAAA;MACL;;IAGL,EAAe,SAAS,KACvB,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MACQ;MACU;MACF;MACJ;MACV,CAAA;KACE,CAAA;IAEJ;MAKN,kBAAC,OAAD;GAAK,WAAU;GAAsC,aAAU;aAC5D,EAAM,cACL,kBAAC,KAAD;IAAG,WAAU;IAAyB,eAAY;cAAlD,CACE,kBAAC,QAAD,EAAM,WAAU,uGAAwG,CAAA,EACvH,EAAM,WACL,EAAG,yCAAyC,+CAA+C,CAC3F;QACF,IACF,kBAAC,KAAD;IAAG,WAAU;IAAyB,eAAY;cAC/C;IACC,CAAA,GACF,IACF,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,WAAU;IACV,eAAY;cAEX,EAAiB,EAAU;IACrB,CAAA,GAET,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,uCACA,0EACD;IACC,CAAA;GAEF,CAAA,CACF"}
|
|
1
|
+
{"version":3,"file":"AssistantComposer.js","names":[],"sources":["../../../../src/components/assistant/composer/AssistantComposer.tsx"],"sourcesContent":["import {\n useCallback,\n useLayoutEffect,\n useRef,\n useState,\n type ClipboardEvent,\n type DragEvent,\n type FC,\n type KeyboardEvent,\n} from 'react';\nimport { ArrowUp, Loader2 } from 'lucide-react';\nimport type { AssistantMode, AssistantModeConfig } from '@/types/assistant';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useVoiceInput } from '@/hooks/useVoiceInput';\nimport { useAssistantAttachments } from '@/hooks/useAssistantAttachments';\nimport {\n MAX_ATTACHMENTS,\n getSendableAttachments,\n type AssistantAttachment,\n type AttachmentRejection,\n} from '@/utils/assistantAttachments';\nimport { AssistantAttachmentButton } from './AssistantAttachmentButton';\nimport { AssistantAttachmentChips } from './AssistantAttachmentChips';\nimport { AssistantVoiceButton } from './AssistantVoiceButton';\nimport { AssistantModeSelector } from './AssistantModeSelector';\n\ninterface Props {\n /**\n * Send the message. `attachments` are already uploaded and ready; the chat\n * area folds them into the prompt and onto the user bubble.\n */\n onSend: (message: string, attachments: AssistantAttachment[]) => void;\n /** True while a turn is in-flight (assistant busy) — disables send + shows the spinner. */\n disabled?: boolean;\n placeholder?: string;\n mode: AssistantMode;\n /** Role-filtered list of modes the user may pick. */\n availableModes: AssistantModeConfig[];\n onModeChange: (mode: AssistantMode) => void;\n}\n\nconst MAX_TEXTAREA_HEIGHT = 200;\n\n/**\n * AssistantComposer — the v2 input surface (per the ai-assistant-v2 mockups).\n *\n * A rounded card with, on the input row: a leading circular \"+\" attach control,\n * an auto-growing textarea, a microphone, and a prominent filled forest-green\n * circular send button. BELOW the input sit the mode pills (\"Ask\" active-green /\n * \"Take action\" outline); ABOVE it, chips for any pending attachments.\n *\n * Multimodal input (Workstreams 2–3) arrives through three converging paths —\n * the attach button, drag-and-drop onto the card, and paste (a screenshot from\n * the clipboard is the single most common way a user shares one) — plus voice\n * dictation, which appends recognised speech to the draft so it can still be\n * edited before sending.\n *\n * Fully controlled (React state for the text) with auto-grow via a layout\n * effect. Enter sends, Shift+Enter inserts a newline.\n */\nexport const AssistantComposer: FC<Props> = ({\n onSend,\n disabled = false,\n placeholder,\n mode,\n availableModes,\n onModeChange,\n}) => {\n const tr = useTr();\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [text, setText] = useState('');\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n // Nested drag-enter/leave pairs fire for every child element; count them so\n // the highlight survives dragging across the textarea and buttons.\n const dragDepthRef = useRef(0);\n\n const {\n attachments,\n isBusy: attachmentsBusy,\n sendBlocker,\n rejection,\n addFiles,\n remove,\n retry,\n clear,\n clearRejection,\n canAddMore,\n } = useAssistantAttachments();\n\n const appendTranscript = useCallback((phrase: string) => {\n setText((current) => (current ? `${current.replace(/\\s+$/, '')} ${phrase}` : phrase));\n }, []);\n\n const voice = useVoiceInput({ onFinalize: appendTranscript });\n\n const resolvedPlaceholder =\n placeholder ?? tr('healthybowl.assistant.composer.placeholder', 'Ask HealthyBowl anything…');\n const trimmed = text.trim();\n // Exactly what the model will be given — see `getSendableAttachments`.\n const sendableAttachments = getSendableAttachments(attachments);\n const failedAttachments = attachments.filter((attachment) => attachment.status === 'error');\n // A message may be attachments-only (\"what's wrong with this leaf?\" is often\n // just the photo), but never sends while an upload is in flight OR has failed:\n // `sendBlocker` covers both. Gating on the blocker rather than on\n // `attachmentsBusy` is what stops a turn going out that quietly omits a file\n // the user can still see attached — the chips are cleared by `clear()` below,\n // so the evidence would disappear at the same instant.\n const canSend = (trimmed.length > 0 || sendableAttachments.length > 0) && !disabled && sendBlocker === null;\n\n // Auto-grow the textarea to fit its content (capped), re-measured after every\n // value change so the card breathes as the user types.\n useLayoutEffect(() => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, MAX_TEXTAREA_HEIGHT)}px`;\n }, [text]);\n\n const handleSend = useCallback(() => {\n if (!canSend) return;\n // Dictation left running into a send would keep appending to a cleared\n // draft; stop it so the mic state matches what the user sees.\n if (voice.isListening) voice.stop();\n onSend(text.trim(), sendableAttachments);\n setText('');\n clear();\n }, [canSend, onSend, text, sendableAttachments, clear, voice]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n handleSend();\n }\n },\n [handleSend]\n );\n\n const handlePaste = useCallback(\n (event: ClipboardEvent<HTMLTextAreaElement>) => {\n const files = Array.from(event.clipboardData?.files ?? []);\n if (files.length === 0) return;\n // Only claim the paste when it carried files; a normal text paste (which\n // also exposes an empty `files`) must still land in the textarea.\n event.preventDefault();\n addFiles(files);\n },\n [addFiles]\n );\n\n const handleDragEnter = useCallback((event: DragEvent<HTMLDivElement>) => {\n if (!Array.from(event.dataTransfer?.types ?? []).includes('Files')) return;\n dragDepthRef.current += 1;\n setIsDraggingOver(true);\n }, []);\n\n const handleDragLeave = useCallback(() => {\n dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);\n if (dragDepthRef.current === 0) setIsDraggingOver(false);\n }, []);\n\n const handleDragOver = useCallback((event: DragEvent<HTMLDivElement>) => {\n if (!Array.from(event.dataTransfer?.types ?? []).includes('Files')) return;\n // Required for a drop to fire at all, and stops the browser from navigating\n // away to the dropped file.\n event.preventDefault();\n }, []);\n\n const handleDrop = useCallback(\n (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n dragDepthRef.current = 0;\n setIsDraggingOver(false);\n addFiles(event.dataTransfer?.files ?? null);\n },\n [addFiles]\n );\n\n const rejectionMessage = (reason: AttachmentRejection): string => {\n switch (reason) {\n case 'too-many':\n return tr('healthybowl.assistant.attachments.tooMany', 'You can attach up to {{max}} files per message.', {\n max: MAX_ATTACHMENTS,\n });\n case 'too-large':\n return tr('healthybowl.assistant.attachments.tooLarge', 'That file is larger than 10 MB.');\n case 'empty':\n return tr('healthybowl.assistant.attachments.empty', 'That file is empty.');\n case 'unreadable':\n return tr('healthybowl.assistant.attachments.unreadable', 'That file could not be read.');\n case 'unsupported-image':\n return tr(\n 'healthybowl.assistant.attachments.unsupportedImage',\n \"This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.\"\n );\n }\n };\n\n const voiceErrorMessage = (): string | null => {\n switch (voice.error) {\n case 'not-allowed':\n return tr(\n 'healthybowl.assistant.voice.denied',\n 'Microphone access is blocked. Allow it in your browser settings to dictate.'\n );\n case 'audio-capture':\n return tr('healthybowl.assistant.voice.noMic', 'No microphone was found.');\n case 'network':\n return tr('healthybowl.assistant.voice.network', 'Speech recognition is offline right now.');\n case 'unknown':\n return tr('healthybowl.assistant.voice.failed', 'Dictation stopped unexpectedly.');\n default:\n return null;\n }\n };\n\n const voiceError = voiceErrorMessage();\n\n return (\n <div className=\"flex-shrink-0 px-3 pb-3 pt-1.5\">\n <div\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n className={`rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${\n isDraggingOver\n ? 'border-action-primary-bg border-dashed bg-action-primary-bg/5'\n : 'border-border-default bg-bg-sunken'\n }`}\n data-testid=\"assistant-composer\"\n >\n <AssistantAttachmentChips attachments={attachments} onRemove={remove} onRetry={retry} disabled={disabled} />\n\n {/* Input row: attach · textarea · mic · send */}\n <div className=\"flex items-end gap-2\">\n <AssistantAttachmentButton onFiles={addFiles} canAddMore={canAddMore} disabled={disabled} />\n\n <textarea\n ref={textareaRef}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n disabled={disabled}\n placeholder={\n isDraggingOver\n ? tr('healthybowl.assistant.composer.dropHere', 'Drop files to attach')\n : resolvedPlaceholder\n }\n rows={1}\n className=\"min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50\"\n aria-label={tr('healthybowl.assistant.chatInput.ariaLabel', 'Message input')}\n data-testid=\"assistant-input\"\n />\n\n {voice.isSupported && (\n <AssistantVoiceButton isListening={voice.isListening} onToggle={voice.toggle} disabled={disabled} />\n )}\n\n <button\n type=\"button\"\n onClick={handleSend}\n disabled={!canSend}\n className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${\n canSend\n ? 'bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover'\n : 'bg-bg-elevated text-text-muted'\n }`}\n aria-label={tr('healthybowl.assistant.chatInput.send', 'Send message')}\n data-testid=\"assistant-send\"\n >\n {disabled || attachmentsBusy ? <Loader2 className=\"size-4 animate-spin\" /> : <ArrowUp className=\"size-4\" />}\n </button>\n </div>\n\n {/* Mode pills */}\n {availableModes.length > 1 && (\n <div className=\"mt-2 px-0.5\">\n <AssistantModeSelector\n mode={mode}\n availableModes={availableModes}\n onModeChange={onModeChange}\n disabled={disabled}\n />\n </div>\n )}\n </div>\n\n {/* One status line under the card: live dictation > voice error >\n attachment rejection > failed upload > the keyboard hint. Announced\n politely so a screen-reader user hears dictation land without losing\n their place.\n\n The failed-upload line ranks below `rejection` (which is transient and\n describes the file the user just picked) but above the hint, because a\n disabled send button with no stated reason is the thing this whole\n change exists to avoid. */}\n <div className=\"mt-1.5 px-1 text-center text-[11px]\" aria-live=\"polite\">\n {voice.isListening ? (\n <p className=\"text-status-error-text\" data-testid=\"assistant-voice-status\">\n <span className=\"mr-1 inline-block size-1.5 rounded-full bg-status-error-text align-middle motion-safe:animate-pulse\" />\n {voice.interim ||\n tr('healthybowl.assistant.voice.listening', 'Listening… speak now, tap the square to stop')}\n </p>\n ) : voiceError ? (\n <p className=\"text-status-error-text\" data-testid=\"assistant-voice-error\">\n {voiceError}\n </p>\n ) : rejection ? (\n <button\n type=\"button\"\n onClick={clearRejection}\n className=\"text-status-error-text underline-offset-2 hover:underline\"\n data-testid=\"assistant-attachment-rejection\"\n >\n {rejectionMessage(rejection)}\n </button>\n ) : sendBlocker === 'failed' ? (\n <p className=\"text-status-error-text\" data-testid=\"assistant-attachment-blocked\">\n {failedAttachments.length === 1\n ? tr(\n 'healthybowl.assistant.attachments.blockedOne',\n \"{{name}} didn't upload. Retry or remove it before sending.\",\n { name: failedAttachments[0].filename }\n )\n : tr(\n 'healthybowl.assistant.attachments.blockedMany',\n \"{{count}} attachments didn't upload. Retry or remove them before sending.\",\n { count: failedAttachments.length }\n )}\n </p>\n ) : (\n <p className=\"text-text-muted\">\n {tr(\n 'healthybowl.assistant.composer.hint',\n 'Enter to send · Shift+Enter for newline · drag or paste files to attach'\n )}\n </p>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAM,IAAsB,KAmBf,KAAgC,EAC3C,WACA,cAAW,IACX,gBACA,SACA,mBACA,sBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAc,EAA4B,KAAK,EAC/C,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAgB,KAAqB,EAAS,GAAM,EAGrD,IAAe,EAAO,EAAE,EAExB,EACJ,gBACA,QAAQ,GACR,gBACA,cACA,aACA,WACA,UACA,UACA,mBACA,kBACE,GAAyB,EAMvB,IAAQ,GAAc,EAAE,YAJL,GAAa,MAAmB;AACvD,KAAS,MAAa,IAAU,GAAG,EAAQ,QAAQ,QAAQ,GAAG,CAAC,GAAG,MAAW,EAAQ;IACpF,EAAE,CAAC,EAEsD,CAAC,EAEvD,IACJ,KAAe,EAAG,8CAA8C,4BAA4B,EACxF,IAAU,EAAK,MAAM,EAErB,IAAsB,EAAuB,EAAY,EACzD,IAAoB,EAAY,QAAQ,MAAe,EAAW,WAAW,QAAQ,EAOrF,KAAW,EAAQ,SAAS,KAAK,EAAoB,SAAS,MAAM,CAAC,KAAY,MAAgB;AAIvG,SAAsB;EACpB,IAAM,IAAW,EAAY;AACxB,QACL,EAAS,MAAM,SAAS,QACxB,EAAS,MAAM,SAAS,GAAG,KAAK,IAAI,E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