@burdenoff/microfe-healthybowl 2026.901.17 → 2026.902.1
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/AssistantConversationList.js +80 -75
- package/dist/components/assistant/AssistantConversationList.js.map +1 -1
- package/dist/components/assistant/voice/VoiceCaption.js +1 -1
- package/dist/components/assistant/voice/VoiceCaption.js.map +1 -1
- package/dist/components/assistant/voice/VoiceStage.js +1 -1
- package/dist/components/assistant/voice/VoiceStage.js.map +1 -1
- package/dist/components/assistant/voice/VoiceTranscriptDrawer.js +2 -2
- package/dist/components/assistant/voice/VoiceTranscriptDrawer.js.map +1 -1
- package/dist/config/speechLabels.js +10 -0
- package/dist/config/speechLabels.js.map +1 -1
- package/dist/hooks/useVoiceInput.js +3 -1
- package/dist/hooks/useVoiceInput.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,147 +1,152 @@
|
|
|
1
1
|
import { useAssistantStore as e } from "../../store/assistantStore.js";
|
|
2
2
|
import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
3
3
|
import { ASSISTANT_MODES as n } from "../../types/assistant.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { chatTurns as r } from "../../utils/voiceTurnVisibility.js";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
import { Check as a, MessageSquare as o, PanelLeftClose as s, Pencil as c, Plus as l, Trash2 as u } from "lucide-react";
|
|
7
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/assistant/AssistantConversationList.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
let t =
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
e.stopPropagation(),
|
|
9
|
+
var m = () => {
|
|
10
|
+
let m = t(), { conversations: h, activeConversationId: g, processingByConversationId: _, setActiveConversation: v, setMode: y, createConversation: b, deleteConversation: x, renameConversation: S, setConversationListOpen: C } = e(), [w, T] = i(null), [E, D] = i(""), O = () => {
|
|
11
|
+
b(), C(!1);
|
|
12
|
+
}, k = (e) => {
|
|
13
|
+
let t = h.find((t) => t.id === e);
|
|
14
|
+
v(e), t && y(t.mode), C(!1);
|
|
15
|
+
}, A = (e, t) => {
|
|
16
|
+
T(e), D(t);
|
|
17
|
+
}, j = () => {
|
|
18
|
+
w && E.trim() && S(w, E.trim()), T(null);
|
|
19
|
+
}, M = (e, t) => {
|
|
20
|
+
e.stopPropagation(), x(t);
|
|
20
21
|
};
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ p("div", {
|
|
22
23
|
className: "absolute inset-0 z-10 flex flex-col bg-bg-surface animate-in slide-in-from-left-2 fade-in duration-200",
|
|
23
24
|
"data-testid": "conversation-list",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
+
children: [/* @__PURE__ */ p("div", {
|
|
25
26
|
className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ f("span", {
|
|
27
28
|
className: "text-[13px] font-semibold text-text-primary",
|
|
28
|
-
children:
|
|
29
|
-
}), /* @__PURE__ */
|
|
29
|
+
children: m("healthybowl.assistant.conversations.title", "History")
|
|
30
|
+
}), /* @__PURE__ */ p("div", {
|
|
30
31
|
className: "flex items-center gap-0.5",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ f("button", {
|
|
32
33
|
type: "button",
|
|
33
|
-
onClick:
|
|
34
|
+
onClick: O,
|
|
34
35
|
className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
|
|
35
|
-
"aria-label":
|
|
36
|
+
"aria-label": m("healthybowl.assistant.conversations.new", "New conversation"),
|
|
36
37
|
"data-testid": "new-conversation",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
}), /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ f(l, { className: "size-4" })
|
|
39
|
+
}), /* @__PURE__ */ p("button", {
|
|
39
40
|
type: "button",
|
|
40
|
-
onClick: () =>
|
|
41
|
+
onClick: () => C(!1),
|
|
41
42
|
className: "flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
|
|
42
|
-
"aria-label":
|
|
43
|
+
"aria-label": m("healthybowl.assistant.conversations.collapse", "Collapse history"),
|
|
43
44
|
"data-testid": "collapse-conversation-list",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ f(s, { className: "size-4" }), /* @__PURE__ */ f("span", {
|
|
45
46
|
className: "text-[11px] font-medium",
|
|
46
|
-
children:
|
|
47
|
+
children: m("healthybowl.assistant.conversations.collapseLabel", "Collapse")
|
|
47
48
|
})]
|
|
48
49
|
})]
|
|
49
50
|
})]
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ f("div", {
|
|
51
52
|
className: "flex-1 overflow-y-auto",
|
|
52
|
-
children:
|
|
53
|
+
children: h.length === 0 ? /* @__PURE__ */ p("div", {
|
|
53
54
|
className: "flex flex-col items-center justify-center h-full text-center px-4",
|
|
54
55
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ f(o, { className: "size-6 text-text-muted mb-2" }),
|
|
57
|
+
/* @__PURE__ */ f("p", {
|
|
57
58
|
className: "text-xs text-text-muted",
|
|
58
|
-
children:
|
|
59
|
+
children: m("healthybowl.assistant.conversations.empty", "No conversations yet")
|
|
59
60
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ f("button", {
|
|
61
62
|
type: "button",
|
|
62
|
-
onClick:
|
|
63
|
+
onClick: O,
|
|
63
64
|
className: "mt-2 text-xs text-action-primary-bg hover:underline",
|
|
64
|
-
children:
|
|
65
|
+
children: m("healthybowl.assistant.conversations.startNew", "Start a new conversation")
|
|
65
66
|
})
|
|
66
67
|
]
|
|
67
|
-
}) : /* @__PURE__ */
|
|
68
|
+
}) : /* @__PURE__ */ f("div", {
|
|
68
69
|
className: "py-1",
|
|
69
|
-
children:
|
|
70
|
-
let t = e.id ===
|
|
71
|
-
return /* @__PURE__ */
|
|
70
|
+
children: h.map((e) => {
|
|
71
|
+
let t = e.id === g, i = e.id === w, o = n.find((t) => t.id === e.mode), s = r(e.messages), l = s[s.length - 1], h = s.length === 0 && e.messages.length > 0, v = _[e.id];
|
|
72
|
+
return /* @__PURE__ */ f("div", {
|
|
72
73
|
role: "button",
|
|
73
74
|
tabIndex: 0,
|
|
74
75
|
onKeyDown: (t) => {
|
|
75
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), !
|
|
76
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), !i && k(e.id));
|
|
76
77
|
},
|
|
77
|
-
onClick: () => !
|
|
78
|
+
onClick: () => !i && k(e.id),
|
|
78
79
|
className: `group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${t ? "bg-bg-elevated border-l-2 border-action-primary-bg" : ""}`,
|
|
79
|
-
children:
|
|
80
|
+
children: i ? /* @__PURE__ */ p("div", {
|
|
80
81
|
className: "flex items-center gap-1",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
82
|
-
"aria-label":
|
|
83
|
-
value:
|
|
84
|
-
onChange: (e) =>
|
|
82
|
+
children: [/* @__PURE__ */ f("input", {
|
|
83
|
+
"aria-label": m("healthybowl.assistant.conversations.renameLabel", "Conversation title"),
|
|
84
|
+
value: E,
|
|
85
|
+
onChange: (e) => D(e.target.value),
|
|
85
86
|
onKeyDown: (e) => {
|
|
86
|
-
e.key === "Enter" &&
|
|
87
|
+
e.key === "Enter" && j(), e.key === "Escape" && T(null);
|
|
87
88
|
},
|
|
88
89
|
className: "flex-1 text-xs bg-bg-sunken border border-border-default rounded px-2 py-1 text-text-primary focus:outline-none focus:border-action-primary-bg",
|
|
89
90
|
onClick: (e) => e.stopPropagation()
|
|
90
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ f("button", {
|
|
91
92
|
type: "button",
|
|
92
93
|
onClick: (e) => {
|
|
93
|
-
e.stopPropagation(),
|
|
94
|
+
e.stopPropagation(), j();
|
|
94
95
|
},
|
|
95
96
|
className: "p-1 hover:bg-bg-sunken rounded",
|
|
96
|
-
"aria-label":
|
|
97
|
-
children: /* @__PURE__ */
|
|
97
|
+
"aria-label": m("healthybowl.assistant.conversations.saveTitle", "Save title"),
|
|
98
|
+
children: /* @__PURE__ */ f(a, { className: "size-3 text-status-success-text" })
|
|
98
99
|
})]
|
|
99
|
-
}) : /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
}) : /* @__PURE__ */ p(d, { children: [
|
|
101
|
+
/* @__PURE__ */ p("div", {
|
|
101
102
|
className: "flex items-center justify-between",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ f("span", {
|
|
103
104
|
className: "text-xs font-medium text-text-primary truncate flex-1",
|
|
104
105
|
children: e.title
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ p("div", {
|
|
106
107
|
className: "hidden group-hover:flex group-focus-within:flex items-center gap-0.5 ml-1",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ f("button", {
|
|
108
109
|
type: "button",
|
|
109
110
|
onClick: (t) => {
|
|
110
|
-
t.stopPropagation(),
|
|
111
|
+
t.stopPropagation(), A(e.id, e.title);
|
|
111
112
|
},
|
|
112
113
|
className: "p-0.5 hover:bg-bg-sunken rounded",
|
|
113
|
-
"aria-label":
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
}), /* @__PURE__ */
|
|
114
|
+
"aria-label": m("healthybowl.assistant.conversations.rename", "Rename conversation"),
|
|
115
|
+
children: /* @__PURE__ */ f(c, { className: "size-3 text-text-muted" })
|
|
116
|
+
}), /* @__PURE__ */ f("button", {
|
|
116
117
|
type: "button",
|
|
117
|
-
onClick: (t) =>
|
|
118
|
+
onClick: (t) => M(t, e.id),
|
|
118
119
|
className: "p-0.5 hover:bg-bg-sunken rounded",
|
|
119
|
-
"aria-label":
|
|
120
|
+
"aria-label": m("healthybowl.assistant.conversations.delete", "Delete conversation"),
|
|
120
121
|
"data-testid": "delete-conversation",
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ f(u, { className: "size-3 text-status-error-text" })
|
|
122
123
|
})]
|
|
123
124
|
})]
|
|
124
125
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ p("div", {
|
|
126
127
|
className: "flex items-center gap-1.5 mt-0.5",
|
|
127
128
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ f("span", {
|
|
129
130
|
className: "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded",
|
|
130
|
-
children:
|
|
131
|
+
children: o?.label ?? e.mode
|
|
131
132
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ p("span", {
|
|
133
134
|
className: "text-[10px] text-text-muted",
|
|
134
|
-
children: [
|
|
135
|
+
children: [s.length, " msgs"]
|
|
135
136
|
}),
|
|
136
|
-
|
|
137
|
+
v && v.status !== "idle" && /* @__PURE__ */ f("span", {
|
|
137
138
|
className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
|
|
138
|
-
children:
|
|
139
|
+
children: v.status
|
|
139
140
|
})
|
|
140
141
|
]
|
|
141
142
|
}),
|
|
142
|
-
|
|
143
|
+
l && /* @__PURE__ */ f("p", {
|
|
144
|
+
className: "text-[10px] text-text-muted truncate mt-0.5",
|
|
145
|
+
children: l.content.slice(0, 60)
|
|
146
|
+
}),
|
|
147
|
+
h && /* @__PURE__ */ f("p", {
|
|
143
148
|
className: "text-[10px] text-text-muted truncate mt-0.5",
|
|
144
|
-
children:
|
|
149
|
+
children: m("healthybowl.assistant.conversationList.voiceOnly", "Spoken conversation")
|
|
145
150
|
})
|
|
146
151
|
] })
|
|
147
152
|
}, e.id);
|
|
@@ -151,6 +156,6 @@ var p = () => {
|
|
|
151
156
|
});
|
|
152
157
|
};
|
|
153
158
|
//#endregion
|
|
154
|
-
export {
|
|
159
|
+
export { m as AssistantConversationList };
|
|
155
160
|
|
|
156
161
|
//# sourceMappingURL=AssistantConversationList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantConversationList.js","names":[],"sources":["../../../src/components/assistant/AssistantConversationList.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { Plus, Trash2, MessageSquare, PanelLeftClose, Pencil, Check } from 'lucide-react';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { ASSISTANT_MODES } from '@/types/assistant';\nimport { useTr } from '../../shared/hooks/useTr';\n\nexport const AssistantConversationList: FC = () => {\n const tr = useTr();\n const {\n conversations,\n activeConversationId,\n processingByConversationId,\n setActiveConversation,\n setMode,\n createConversation,\n deleteConversation,\n renameConversation,\n setConversationListOpen,\n } = useAssistantStore();\n\n const [editingId, setEditingId] = useState<string | null>(null);\n const [editTitle, setEditTitle] = useState('');\n\n const handleCreate = () => {\n createConversation();\n setConversationListOpen(false);\n };\n\n const handleSelect = (id: string) => {\n const selectedConversation = conversations.find((conversation) => conversation.id === id);\n setActiveConversation(id);\n if (selectedConversation) {\n setMode(selectedConversation.mode);\n }\n setConversationListOpen(false);\n };\n\n const handleStartRename = (id: string, currentTitle: string) => {\n setEditingId(id);\n setEditTitle(currentTitle);\n };\n\n const handleConfirmRename = () => {\n if (editingId && editTitle.trim()) {\n renameConversation(editingId, editTitle.trim());\n }\n setEditingId(null);\n };\n\n const handleDelete = (e: React.MouseEvent, id: string) => {\n e.stopPropagation();\n deleteConversation(id);\n };\n\n return (\n <div\n className=\"absolute inset-0 z-10 flex flex-col bg-bg-surface animate-in slide-in-from-left-2 fade-in duration-200\"\n data-testid=\"conversation-list\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated\">\n <span className=\"text-[13px] font-semibold text-text-primary\">\n {tr('healthybowl.assistant.conversations.title', 'History')}\n </span>\n <div className=\"flex items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors\"\n aria-label={tr('healthybowl.assistant.conversations.new', 'New conversation')}\n data-testid=\"new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={() => setConversationListOpen(false)}\n className=\"flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors\"\n aria-label={tr('healthybowl.assistant.conversations.collapse', 'Collapse history')}\n data-testid=\"collapse-conversation-list\"\n >\n <PanelLeftClose className=\"size-4\" />\n <span className=\"text-[11px] font-medium\">\n {tr('healthybowl.assistant.conversations.collapseLabel', 'Collapse')}\n </span>\n </button>\n </div>\n </div>\n\n {/* List */}\n <div className=\"flex-1 overflow-y-auto\">\n {conversations.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center h-full text-center px-4\">\n <MessageSquare className=\"size-6 text-text-muted mb-2\" />\n <p className=\"text-xs text-text-muted\">\n {tr('healthybowl.assistant.conversations.empty', 'No conversations yet')}\n </p>\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"mt-2 text-xs text-action-primary-bg hover:underline\"\n >\n {tr('healthybowl.assistant.conversations.startNew', 'Start a new conversation')}\n </button>\n </div>\n ) : (\n <div className=\"py-1\">\n {conversations.map((conv) => {\n const isActive = conv.id === activeConversationId;\n const isEditing = conv.id === editingId;\n const modeConfig = ASSISTANT_MODES.find((m) => m.id === conv.mode);\n const lastMessage = conv.messages[conv.messages.length - 1];\n const processing = processingByConversationId[conv.id];\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n (() => !isEditing && handleSelect(conv.id))();\n }\n }}\n key={conv.id}\n onClick={() => !isEditing && handleSelect(conv.id)}\n className={`group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${\n isActive ? 'bg-bg-elevated border-l-2 border-action-primary-bg' : ''\n }`}\n >\n {isEditing ? (\n <div className=\"flex items-center gap-1\">\n <input\n aria-label={tr('healthybowl.assistant.conversations.renameLabel', 'Conversation title')}\n value={editTitle}\n onChange={(e) => setEditTitle(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmRename();\n if (e.key === 'Escape') setEditingId(null);\n }}\n className=\"flex-1 text-xs bg-bg-sunken border border-border-default rounded px-2 py-1 text-text-primary focus:outline-none focus:border-action-primary-bg\"\n onClick={(e) => e.stopPropagation()}\n />\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleConfirmRename();\n }}\n className=\"p-1 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.saveTitle', 'Save title')}\n >\n <Check className=\"size-3 text-status-success-text\" />\n </button>\n </div>\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-medium text-text-primary truncate flex-1\">{conv.title}</span>\n <div className=\"hidden group-hover:flex group-focus-within:flex items-center gap-0.5 ml-1\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleStartRename(conv.id, conv.title);\n }}\n className=\"p-0.5 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.rename', 'Rename conversation')}\n >\n <Pencil className=\"size-3 text-text-muted\" />\n </button>\n <button\n type=\"button\"\n onClick={(e) => handleDelete(e, conv.id)}\n className=\"p-0.5 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.delete', 'Delete conversation')}\n data-testid=\"delete-conversation\"\n >\n <Trash2 className=\"size-3 text-status-error-text\" />\n </button>\n </div>\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5\">\n <span className=\"text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded\">\n {modeConfig?.label ?? conv.mode}\n </span>\n <span className=\"text-[10px] text-text-muted\">{conv.messages.length} msgs</span>\n {processing && processing.status !== 'idle' && (\n <span className=\"text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded\">\n {processing.status}\n </span>\n )}\n </div>\n {lastMessage && (\n <p className=\"text-[10px] text-text-muted truncate mt-0.5\">\n {lastMessage.content.slice(0, 60)}\n </p>\n )}\n </>\n )}\n </div>\n );\n })}\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAMA,IAAa,UAAsC;CACjD,IAAM,IAAK,EAAM,GACX,EACJ,kBACA,yBACA,+BACA,0BACA,YACA,uBACA,uBACA,uBACA,+BACE,EAAkB,GAEhB,CAAC,GAAW,KAAgB,EAAwB,IAAI,GACxD,CAAC,GAAW,KAAgB,EAAS,EAAE,GAEvC,UAAqB;EAEzB,AADA,EAAmB,GACnB,EAAwB,EAAK;CAC/B,GAEM,KAAgB,MAAe;EACnC,IAAM,IAAuB,EAAc,MAAM,MAAiB,EAAa,OAAO,CAAE;EAKxF,AAJA,EAAsB,CAAE,GACpB,KACF,EAAQ,EAAqB,IAAI,GAEnC,EAAwB,EAAK;CAC/B,GAEM,KAAqB,GAAY,MAAyB;EAE9D,AADA,EAAa,CAAE,GACf,EAAa,CAAY;CAC3B,GAEM,UAA4B;EAIhC,AAHI,KAAa,EAAU,KAAK,KAC9B,EAAmB,GAAW,EAAU,KAAK,CAAC,GAEhD,EAAa,IAAI;CACnB,GAEM,KAAgB,GAAqB,MAAe;EAExD,AADA,EAAE,gBAAgB,GAClB,EAAmB,CAAE;CACvB;CAEA,OACE,kBAAC,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K,WAAU;kBAAf;SACE,kBAAC,QAAD;UAAM,WAAU;oBACb,GAAY,SAAS,EAAK;SACvB,CAAA;SACN,kBAAC,QAAD;UAAM,WAAU;oBAAhB,CAA+C,EAAK,SAAS,QAAO,OAAW;;SAC9E,KAAc,EAAW,WAAW,UACnC,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAW;SACR,CAAA;QAEL;;OACJ,KACC,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAY,QAAQ,MAAM,GAAG,EAAE;OAC/B,CAAA;MAEL,EAAA,CAAA;KAED,GA5EE,EAAK,EA4EP;IAET,CAAC;GACE,CAAA;EAEJ,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"AssistantConversationList.js","names":[],"sources":["../../../src/components/assistant/AssistantConversationList.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { Plus, Trash2, MessageSquare, PanelLeftClose, Pencil, Check } from 'lucide-react';\nimport { useAssistantStore } from '@/store/assistantStore';\nimport { ASSISTANT_MODES } from '@/types/assistant';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { chatTurns } from '../../utils/voiceTurnVisibility';\n\nexport const AssistantConversationList: FC = () => {\n const tr = useTr();\n const {\n conversations,\n activeConversationId,\n processingByConversationId,\n setActiveConversation,\n setMode,\n createConversation,\n deleteConversation,\n renameConversation,\n setConversationListOpen,\n } = useAssistantStore();\n\n const [editingId, setEditingId] = useState<string | null>(null);\n const [editTitle, setEditTitle] = useState('');\n\n const handleCreate = () => {\n createConversation();\n setConversationListOpen(false);\n };\n\n const handleSelect = (id: string) => {\n const selectedConversation = conversations.find((conversation) => conversation.id === id);\n setActiveConversation(id);\n if (selectedConversation) {\n setMode(selectedConversation.mode);\n }\n setConversationListOpen(false);\n };\n\n const handleStartRename = (id: string, currentTitle: string) => {\n setEditingId(id);\n setEditTitle(currentTitle);\n };\n\n const handleConfirmRename = () => {\n if (editingId && editTitle.trim()) {\n renameConversation(editingId, editTitle.trim());\n }\n setEditingId(null);\n };\n\n const handleDelete = (e: React.MouseEvent, id: string) => {\n e.stopPropagation();\n deleteConversation(id);\n };\n\n return (\n <div\n className=\"absolute inset-0 z-10 flex flex-col bg-bg-surface animate-in slide-in-from-left-2 fade-in duration-200\"\n data-testid=\"conversation-list\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated\">\n <span className=\"text-[13px] font-semibold text-text-primary\">\n {tr('healthybowl.assistant.conversations.title', 'History')}\n </span>\n <div className=\"flex items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors\"\n aria-label={tr('healthybowl.assistant.conversations.new', 'New conversation')}\n data-testid=\"new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={() => setConversationListOpen(false)}\n className=\"flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors\"\n aria-label={tr('healthybowl.assistant.conversations.collapse', 'Collapse history')}\n data-testid=\"collapse-conversation-list\"\n >\n <PanelLeftClose className=\"size-4\" />\n <span className=\"text-[11px] font-medium\">\n {tr('healthybowl.assistant.conversations.collapseLabel', 'Collapse')}\n </span>\n </button>\n </div>\n </div>\n\n {/* List */}\n <div className=\"flex-1 overflow-y-auto\">\n {conversations.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center h-full text-center px-4\">\n <MessageSquare className=\"size-6 text-text-muted mb-2\" />\n <p className=\"text-xs text-text-muted\">\n {tr('healthybowl.assistant.conversations.empty', 'No conversations yet')}\n </p>\n <button\n type=\"button\"\n onClick={handleCreate}\n className=\"mt-2 text-xs text-action-primary-bg hover:underline\"\n >\n {tr('healthybowl.assistant.conversations.startNew', 'Start a new conversation')}\n </button>\n </div>\n ) : (\n <div className=\"py-1\">\n {conversations.map((conv) => {\n const isActive = conv.id === activeConversationId;\n const isEditing = conv.id === editingId;\n const modeConfig = ASSISTANT_MODES.find((m) => m.id === conv.mode);\n // ★ Preview the turns the thread will actually SHOW. Spoken turns\n // are deliberately kept out of the typed thread, so previewing the\n // raw array promised content the conversation then withheld: a\n // voice-only row displayed a title and a snippet, and opened onto\n // an empty screen. Filtering makes the row honest, and the badge\n // below says where the missing content went.\n const typedTurns = chatTurns(conv.messages);\n const lastMessage = typedTurns[typedTurns.length - 1];\n const spokenOnly = typedTurns.length === 0 && conv.messages.length > 0;\n const processing = processingByConversationId[conv.id];\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n (() => !isEditing && handleSelect(conv.id))();\n }\n }}\n key={conv.id}\n onClick={() => !isEditing && handleSelect(conv.id)}\n className={`group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${\n isActive ? 'bg-bg-elevated border-l-2 border-action-primary-bg' : ''\n }`}\n >\n {isEditing ? (\n <div className=\"flex items-center gap-1\">\n <input\n aria-label={tr('healthybowl.assistant.conversations.renameLabel', 'Conversation title')}\n value={editTitle}\n onChange={(e) => setEditTitle(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleConfirmRename();\n if (e.key === 'Escape') setEditingId(null);\n }}\n className=\"flex-1 text-xs bg-bg-sunken border border-border-default rounded px-2 py-1 text-text-primary focus:outline-none focus:border-action-primary-bg\"\n onClick={(e) => e.stopPropagation()}\n />\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleConfirmRename();\n }}\n className=\"p-1 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.saveTitle', 'Save title')}\n >\n <Check className=\"size-3 text-status-success-text\" />\n </button>\n </div>\n ) : (\n <>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-medium text-text-primary truncate flex-1\">{conv.title}</span>\n <div className=\"hidden group-hover:flex group-focus-within:flex items-center gap-0.5 ml-1\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleStartRename(conv.id, conv.title);\n }}\n className=\"p-0.5 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.rename', 'Rename conversation')}\n >\n <Pencil className=\"size-3 text-text-muted\" />\n </button>\n <button\n type=\"button\"\n onClick={(e) => handleDelete(e, conv.id)}\n className=\"p-0.5 hover:bg-bg-sunken rounded\"\n aria-label={tr('healthybowl.assistant.conversations.delete', 'Delete conversation')}\n data-testid=\"delete-conversation\"\n >\n <Trash2 className=\"size-3 text-status-error-text\" />\n </button>\n </div>\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5\">\n <span className=\"text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded\">\n {modeConfig?.label ?? conv.mode}\n </span>\n <span className=\"text-[10px] text-text-muted\">{typedTurns.length} msgs</span>\n {processing && processing.status !== 'idle' && (\n <span className=\"text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded\">\n {processing.status}\n </span>\n )}\n </div>\n {lastMessage && (\n <p className=\"text-[10px] text-text-muted truncate mt-0.5\">\n {lastMessage.content.slice(0, 60)}\n </p>\n )}\n {spokenOnly && (\n <p className=\"text-[10px] text-text-muted truncate mt-0.5\">\n {tr('healthybowl.assistant.conversationList.voiceOnly', 'Spoken conversation')}\n </p>\n )}\n </>\n )}\n </div>\n );\n })}\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAOA,IAAa,UAAsC;CACjD,IAAM,IAAK,EAAM,GACX,EACJ,kBACA,yBACA,+BACA,0BACA,YACA,uBACA,uBACA,uBACA,+BACE,EAAkB,GAEhB,CAAC,GAAW,KAAgB,EAAwB,IAAI,GACxD,CAAC,GAAW,KAAgB,EAAS,EAAE,GAEvC,UAAqB;EAEzB,AADA,EAAmB,GACnB,EAAwB,EAAK;CAC/B,GAEM,KAAgB,MAAe;EACnC,IAAM,IAAuB,EAAc,MAAM,MAAiB,EAAa,OAAO,CAAE;EAKxF,AAJA,EAA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AK;UACL,UAAU,MAAM;WAEd,AADA,EAAE,gBAAgB,GAClB,EAAkB,EAAK,IAAI,EAAK,KAAK;UACvC;UACA,WAAU;UACV,cAAY,EAAG,8CAA8C,qBAAqB;oBAElF,kBAAC,GAAD,EAAQ,WAAU,yBAA0B,CAAA;SACtC,CAAA,GACR,kBAAC,UAAD;UACE,MAAK;UACL,UAAU,MAAM,EAAa,GAAG,EAAK,EAAE;UACvC,WAAU;UACV,cAAY,EAAG,8CAA8C,qBAAqB;UAClF,eAAY;oBAEZ,kBAAC,GAAD,EAAQ,WAAU,gCAAiC,CAAA;SAC7C,CAAA,CACL;UACF;;OACL,kBAAC,OAAD;QAAK,WAAU;kBAAf;SACE,kBAAC,QAAD;UAAM,WAAU;oBACb,GAAY,SAAS,EAAK;SACvB,CAAA;SACN,kBAAC,QAAD;UAAM,WAAU;oBAAhB,CAA+C,EAAW,QAAO,OAAW;;SAC3E,KAAc,EAAW,WAAW,UACnC,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAW;SACR,CAAA;QAEL;;OACJ,KACC,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAY,QAAQ,MAAM,GAAG,EAAE;OAC/B,CAAA;OAEJ,KACC,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAG,oDAAoD,qBAAqB;OAC5E,CAAA;MAEL,EAAA,CAAA;KAED,GAjFE,EAAK,EAiFP;IAET,CAAC;GACE,CAAA;EAEJ,CAAA,CACF;;AAET"}
|
|
@@ -6,7 +6,7 @@ var t = ({ text: t, role: n, expanded: r, testId: i }) => {
|
|
|
6
6
|
className: "flex w-full justify-center",
|
|
7
7
|
children: /* @__PURE__ */ e("p", {
|
|
8
8
|
className: [
|
|
9
|
-
"w-full whitespace-pre-wrap text-left",
|
|
9
|
+
"w-full whitespace-pre-wrap break-words text-left",
|
|
10
10
|
r ? "max-w-[45rem]" : "max-w-md",
|
|
11
11
|
a ? "font-semibold text-text-primary" : "font-medium text-text-secondary",
|
|
12
12
|
r ? a ? "text-[clamp(1.625rem,2.5vw,2.25rem)] leading-[1.5]" : "text-[clamp(1.125rem,1.8vw,1.375rem)] leading-[1.5]" : a ? "text-lg leading-relaxed" : "text-base leading-relaxed"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceCaption.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceCaption.tsx"],"sourcesContent":["import type { FC } from 'react';\n\n/**\n * One live caption — either what the user is saying or what the assistant is.\n *\n * Replaces the message-bubble list the voice overlay used to render. That list\n * was the chat transcript squeezed into a modal: bubbles, the whole scrollback,\n * and raw `##`/`**` because it printed the model's markdown as plain text.\n *\n * Three things here are deliberate and were all wrong before:\n *\n * ★ **Left-aligned, not centred.** Centring is fine for one short line and\n * unreadable for four — every line starts in a different place, so the eye has\n * to hunt for each beginning. Tamil/English mixed text makes it worse, because\n * the line lengths vary wildly. The BLOCK is centred on the stage; the text\n * inside it is not.\n *\n * ★ **Responsive type, not one fixed size.** `clamp()` so the same component is\n * legible in a 380px docked panel and from arm's length on a maximised desktop\n * window, without a second component or a transform.\n *\n * ★ **Bounded width.** A caption spanning a 1440px window is one long line the\n * eye cannot track back from, so the measure is capped — 45rem / 720px on the\n * full-screen stage, the middle of the 680-760px the design calls for.\n *\n * ★ That measure is deliberately NOT the 60-75 characters typography usually\n * aims at: at 36px type 720px carries roughly 40. A voice caption is glanced at\n * from arm's length while someone is talking, not read as prose, and the size\n * is what makes it glanceable — so the two constraints are set independently\n * and the width follows the spec rather than the usual reading rule.\n */\n\ninterface Props {\n text: string;\n /** Who is speaking. The assistant's caption is the loud one. */\n role: 'user' | 'assistant';\n /** Full-screen rather than docked in the panel. */\n expanded: boolean;\n testId?: string;\n}\n\nexport const VoiceCaption: FC<Props> = ({ text, role, expanded, testId }) => {\n const assistant = role === 'assistant';\n return (\n <div className=\"flex w-full justify-center\">\n <p\n className={[\n // Left-aligned inside a centred block — see above.\n // ★ `toCaptionText` PRESERVES newlines; without pre-wrap they collapse\n // and a multi-paragraph answer renders as one wall of text.\n 'w-full whitespace-pre-wrap text-left',\n // 45rem = 720px, mid-band. Arbitrary value on purpose: Tailwind's\n // max-w-2xl is 672px and max-w-3xl 768px, so neither preset lands\n // inside 680-760.\n expanded ? 'max-w-[45rem]' : 'max-w-md',\n assistant ? 'font-semibold text-text-primary' : 'font-medium text-text-secondary',\n expanded\n ? assistant\n ? // 26-36px. ★ The floor is coupled to VoiceStage's empty-caption\n // reserve, which is 3x this value (two lines at 1.5 leading) so\n // the control does not jump when the first words arrive — move\n // one and the other has to move with it.\n 'text-[clamp(1.625rem,2.5vw,2.25rem)] leading-[1.5]'\n : // The USER caption is deliberately quieter and is not part of\n // the 26-36px band, which specifies the assistant's line.\n 'text-[clamp(1.125rem,1.8vw,1.375rem)] leading-[1.5]'\n : assistant\n ? 'text-lg leading-relaxed'\n : 'text-base leading-relaxed',\n ].join(' ')}\n // The stage's live region: the caption is what actually changes, so a\n // screen reader should hear it rather than only the status word.\n role=\"status\"\n aria-live=\"polite\"\n data-testid={testId}\n >\n {text}\n </p>\n </div>\n );\n};\n"],"mappings":";;AAyCA,IAAa,KAA2B,EAAE,SAAM,SAAM,aAAU,gBAAa;CAC3E,IAAM,IAAY,MAAS;CAC3B,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,KAAD;GACE,WAAW;
|
|
1
|
+
{"version":3,"file":"VoiceCaption.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceCaption.tsx"],"sourcesContent":["import type { FC } from 'react';\n\n/**\n * One live caption — either what the user is saying or what the assistant is.\n *\n * Replaces the message-bubble list the voice overlay used to render. That list\n * was the chat transcript squeezed into a modal: bubbles, the whole scrollback,\n * and raw `##`/`**` because it printed the model's markdown as plain text.\n *\n * Three things here are deliberate and were all wrong before:\n *\n * ★ **Left-aligned, not centred.** Centring is fine for one short line and\n * unreadable for four — every line starts in a different place, so the eye has\n * to hunt for each beginning. Tamil/English mixed text makes it worse, because\n * the line lengths vary wildly. The BLOCK is centred on the stage; the text\n * inside it is not.\n *\n * ★ **Responsive type, not one fixed size.** `clamp()` so the same component is\n * legible in a 380px docked panel and from arm's length on a maximised desktop\n * window, without a second component or a transform.\n *\n * ★ **Bounded width.** A caption spanning a 1440px window is one long line the\n * eye cannot track back from, so the measure is capped — 45rem / 720px on the\n * full-screen stage, the middle of the 680-760px the design calls for.\n *\n * ★ That measure is deliberately NOT the 60-75 characters typography usually\n * aims at: at 36px type 720px carries roughly 40. A voice caption is glanced at\n * from arm's length while someone is talking, not read as prose, and the size\n * is what makes it glanceable — so the two constraints are set independently\n * and the width follows the spec rather than the usual reading rule.\n */\n\ninterface Props {\n text: string;\n /** Who is speaking. The assistant's caption is the loud one. */\n role: 'user' | 'assistant';\n /** Full-screen rather than docked in the panel. */\n expanded: boolean;\n testId?: string;\n}\n\nexport const VoiceCaption: FC<Props> = ({ text, role, expanded, testId }) => {\n const assistant = role === 'assistant';\n return (\n <div className=\"flex w-full justify-center\">\n <p\n className={[\n // Left-aligned inside a centred block — see above.\n // ★ `toCaptionText` PRESERVES newlines; without pre-wrap they collapse\n // and a multi-paragraph answer renders as one wall of text.\n // ★ `break-words` because nothing else may break a long unbroken run\n // — a URL, or a Tamil compound — and `pre-wrap` alone will not. The\n // chat renderer already carries it; the caption did not.\n 'w-full whitespace-pre-wrap break-words text-left',\n // 45rem = 720px, mid-band. Arbitrary value on purpose: Tailwind's\n // max-w-2xl is 672px and max-w-3xl 768px, so neither preset lands\n // inside 680-760.\n expanded ? 'max-w-[45rem]' : 'max-w-md',\n assistant ? 'font-semibold text-text-primary' : 'font-medium text-text-secondary',\n expanded\n ? assistant\n ? // 26-36px. ★ The floor is coupled to VoiceStage's empty-caption\n // reserve, which is 3x this value (two lines at 1.5 leading) so\n // the control does not jump when the first words arrive — move\n // one and the other has to move with it.\n 'text-[clamp(1.625rem,2.5vw,2.25rem)] leading-[1.5]'\n : // The USER caption is deliberately quieter and is not part of\n // the 26-36px band, which specifies the assistant's line.\n 'text-[clamp(1.125rem,1.8vw,1.375rem)] leading-[1.5]'\n : assistant\n ? 'text-lg leading-relaxed'\n : 'text-base leading-relaxed',\n ].join(' ')}\n // The stage's live region: the caption is what actually changes, so a\n // screen reader should hear it rather than only the status word.\n role=\"status\"\n aria-live=\"polite\"\n data-testid={testId}\n >\n {text}\n </p>\n </div>\n );\n};\n"],"mappings":";;AAyCA,IAAa,KAA2B,EAAE,SAAM,SAAM,aAAU,gBAAa;CAC3E,IAAM,IAAY,MAAS;CAC3B,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,KAAD;GACE,WAAW;IAOT;IAIA,IAAW,kBAAkB;IAC7B,IAAY,oCAAoC;IAChD,IACI,IAKE,uDAGA,wDACF,IACE,4BACA;GACR,EAAE,KAAK,GAAG;GAGV,MAAK;GACL,aAAU;GACV,eAAa;aAEZ;EACA,CAAA;CACA,CAAA;AAET"}
|
|
@@ -38,7 +38,7 @@ var l = ({ state: l, userCaption: u, assistantCaption: d, expanded: f, statusTex
|
|
|
38
38
|
expanded: f
|
|
39
39
|
})
|
|
40
40
|
}), g ? /* @__PURE__ */ s("div", {
|
|
41
|
-
className: f ? "mb-12 max-h-[46vh] w-full overflow-y-auto" : "mb-6 w-full",
|
|
41
|
+
className: f ? "mb-12 max-h-[46vh] w-full overflow-y-auto" : "mb-6 max-h-[38vh] w-full overflow-y-auto",
|
|
42
42
|
children: /* @__PURE__ */ s(e, {
|
|
43
43
|
text: g,
|
|
44
44
|
role: n(l) ? "assistant" : "user",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceStage.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceStage.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { VoiceCaption } from './VoiceCaption';\nimport { VoiceWaveform } from './VoiceWaveform';\nimport {\n waveformIsActive,\n waveformIsSettled,\n showsAssistantCaption,\n showsUserCaption,\n type VoiceStageState,\n} from '../../../utils/voiceStageState';\n\n/**\n * The middle of the voice panel: exactly ONE state, rendered as itself.\n *\n * What this replaces is the whole problem the operator screenshotted. The old\n * overlay showed, simultaneously: \"Listening…\", a microphone warning, the last\n * six messages of the chat conversation as bubbles (markdown syntax and all),\n * the assistant's answer AGAIN as a caption, and the orb. Five things competing,\n * none of them readable.\n *\n * ★ A stage shows one thing because the session IS one thing at a time. The\n * state is derived in `voiceStageState`, which is pure and tested; this file is\n * presentational and cannot be tested in this repo (vitest runs in `node`, no\n * DOM), so it deliberately contains no logic worth testing.\n *\n * The microphone warning is NOT rendered here. Mixing a system message into the\n * conversation area is what made it read as part of the reply; it belongs to\n * the chrome around the stage.\n */\n\ninterface Props {\n state: VoiceStageState;\n /** What the user is saying (live) or last said. */\n userCaption: string | null;\n /** What the assistant is saying. */\n assistantCaption: string | null;\n expanded: boolean;\n /** Status words — already localised by the caller. */\n statusText: string;\n /** The microphone / interrupt control. */\n control: ReactNode;\n /** Shown in the mic-error state instead of a caption. */\n errorText?: string | null;\n}\n\nexport const VoiceStage: FC<Props> = ({\n state,\n userCaption,\n assistantCaption,\n expanded,\n statusText,\n control,\n errorText = null,\n}) => {\n const caption = showsAssistantCaption(state) ? assistantCaption : showsUserCaption(state) ? userCaption : null;\n\n return (\n <div\n className={[\n 'flex min-h-0 w-full flex-1 flex-col items-center',\n expanded ? 'px-8' : 'px-14',\n // ★ Expanded, the group is anchored just above the optical centre\n // rather than centred in the whole box. Measured at 1440x900 the\n // content was 314px of a 756px stage with 221px of dead air above AND\n // below — technically centred, visually adrift. Docked the box is\n // small enough that centring is right.\n expanded ? 'justify-start pt-[16vh]' : 'justify-center',\n ].join(' ')}\n data-testid=\"assistant-voice-stage\"\n data-state={state}\n >\n {/* Status first and small: it is the label for the state, not the content. */}\n <p\n className={[\n 'text-center text-text-muted',\n expanded ? 'text-base' : 'text-sm',\n // The status LABELS the waveform, so it sits close to it. A uniform\n // gap made status, waveform, caption and control read as four\n // items of equal weight, with no hierarchy at all.\n expanded ? 'mb-3' : 'mb-2',\n ].join(' ')}\n // The stage change IS the feedback; without this a screen-reader user\n // is told nothing when connecting becomes listening becomes thinking.\n aria-live=\"polite\"\n data-testid=\"assistant-voice-status\"\n >\n {statusText}\n </p>\n\n {state === 'mic-error' ? (\n // A failure gets the stage to itself — no caption, no waveform. It is\n // not part of the conversation and must not look like it.\n <p\n className={`max-w-md text-center text-status-warning ${expanded ? 'text-lg' : 'text-sm'}`}\n role=\"alert\"\n data-testid=\"assistant-voice-stage-error\"\n >\n {errorText}\n </p>\n ) : (\n <>\n <div className={expanded ? 'mb-10' : 'mb-5'}>\n <VoiceWaveform\n // ★ `endpoint-grace` keeps the waveform ALIVE. It is the two-second\n // window in which the user may still correct themselves, so it has\n // to look like a microphone that is still open — a frozen waveform\n // would read as \"it stopped listening\", which is the opposite of\n // what the window is for. `interrupting` stays still on purpose:\n // the assistant has just been cut off and capture has not resumed.\n active={waveformIsActive(state)}\n settled={waveformIsSettled(state)}\n tone={state === 'speaking' ? 'speaking' : 'listening'}\n expanded={expanded}\n />\n </div>\n\n {caption ? (\n <div\n className={\n expanded\n ? // ★ A long reply used to run off the bottom of the screen with\n // no way to reach it. The model is asked for one to four\n // sentences, but that is guidance, not a guarantee — so the\n // caption is bounded and scrolls rather than being lost.\n 'mb-12 max-h-[46vh] w-full overflow-y-auto'\n : 'mb-6 w-full'\n }\n >\n <VoiceCaption\n text={caption}\n role={showsAssistantCaption(state) ? 'assistant' : 'user'}\n expanded={expanded}\n testId=\"assistant-voice-caption\"\n />\n </div>\n ) : (\n // Reserve the caption's space so the control does not jump when the\n // first words arrive. Two lines' worth at each size, matching what\n // a typical utterance actually occupies.\n //\n // ★ 4.875rem is 3x the assistant caption's MINIMUM (1.625rem at 1.5\n // leading = two lines), tracking the type floor as the old 4.5rem\n // tracked 1.5rem. Honest about what that does and does not buy: it\n // removes the jump only while the clamp is at its floor, i.e. up to\n // ~1040px viewport, and the reserve is sized to the ASSISTANT\n // caption while the common transition out of it is to the smaller\n // USER caption. It is a compromise between two captions of\n // different sizes, not a guarantee.\n <div className={expanded ? 'mb-12 h-[4.875rem]' : 'mb-6 h-12'} aria-hidden=\"true\" />\n )}\n </>\n )}\n\n {control}\n </div>\n );\n};\n"],"mappings":";;;;;AA6CA,IAAa,KAAyB,EACpC,UACA,gBACA,qBACA,aACA,eACA,YACA,eAAY,WACR;CACJ,IAAM,IAAU,EAAsB,CAAK,IAAI,IAAmB,EAAiB,CAAK,IAAI,IAAc;CAE1G,OACE,kBAAC,OAAD;EACE,WAAW;GACT;GACA,IAAW,SAAS;GAMpB,IAAW,4BAA4B;EACzC,EAAE,KAAK,GAAG;EACV,eAAY;EACZ,cAAY;YAZd;GAeE,kBAAC,KAAD;IACE,WAAW;KACT;KACA,IAAW,cAAc;KAIzB,IAAW,SAAS;IACtB,EAAE,KAAK,GAAG;IAGV,aAAU;IACV,eAAY;cAEX;GACA,CAAA;GAEF,MAAU,cAGT,kBAAC,KAAD;IACE,WAAW,4CAA4C,IAAW,YAAY;IAC9E,MAAK;IACL,eAAY;cAEX;GACA,CAAA,IAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;IAAK,WAAW,IAAW,UAAU;cACnC,kBAAC,GAAD;KAOE,QAAQ,EAAiB,CAAK;KAC9B,SAAS,EAAkB,CAAK;KAChC,MAAM,MAAU,aAAa,aAAa;KAChC;IACX,CAAA;GACE,CAAA,GAEJ,IACC,kBAAC,OAAD;IACE,WACE,IAKI,
|
|
1
|
+
{"version":3,"file":"VoiceStage.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceStage.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { VoiceCaption } from './VoiceCaption';\nimport { VoiceWaveform } from './VoiceWaveform';\nimport {\n waveformIsActive,\n waveformIsSettled,\n showsAssistantCaption,\n showsUserCaption,\n type VoiceStageState,\n} from '../../../utils/voiceStageState';\n\n/**\n * The middle of the voice panel: exactly ONE state, rendered as itself.\n *\n * What this replaces is the whole problem the operator screenshotted. The old\n * overlay showed, simultaneously: \"Listening…\", a microphone warning, the last\n * six messages of the chat conversation as bubbles (markdown syntax and all),\n * the assistant's answer AGAIN as a caption, and the orb. Five things competing,\n * none of them readable.\n *\n * ★ A stage shows one thing because the session IS one thing at a time. The\n * state is derived in `voiceStageState`, which is pure and tested; this file is\n * presentational and cannot be tested in this repo (vitest runs in `node`, no\n * DOM), so it deliberately contains no logic worth testing.\n *\n * The microphone warning is NOT rendered here. Mixing a system message into the\n * conversation area is what made it read as part of the reply; it belongs to\n * the chrome around the stage.\n */\n\ninterface Props {\n state: VoiceStageState;\n /** What the user is saying (live) or last said. */\n userCaption: string | null;\n /** What the assistant is saying. */\n assistantCaption: string | null;\n expanded: boolean;\n /** Status words — already localised by the caller. */\n statusText: string;\n /** The microphone / interrupt control. */\n control: ReactNode;\n /** Shown in the mic-error state instead of a caption. */\n errorText?: string | null;\n}\n\nexport const VoiceStage: FC<Props> = ({\n state,\n userCaption,\n assistantCaption,\n expanded,\n statusText,\n control,\n errorText = null,\n}) => {\n const caption = showsAssistantCaption(state) ? assistantCaption : showsUserCaption(state) ? userCaption : null;\n\n return (\n <div\n className={[\n 'flex min-h-0 w-full flex-1 flex-col items-center',\n expanded ? 'px-8' : 'px-14',\n // ★ Expanded, the group is anchored just above the optical centre\n // rather than centred in the whole box. Measured at 1440x900 the\n // content was 314px of a 756px stage with 221px of dead air above AND\n // below — technically centred, visually adrift. Docked the box is\n // small enough that centring is right.\n expanded ? 'justify-start pt-[16vh]' : 'justify-center',\n ].join(' ')}\n data-testid=\"assistant-voice-stage\"\n data-state={state}\n >\n {/* Status first and small: it is the label for the state, not the content. */}\n <p\n className={[\n 'text-center text-text-muted',\n expanded ? 'text-base' : 'text-sm',\n // The status LABELS the waveform, so it sits close to it. A uniform\n // gap made status, waveform, caption and control read as four\n // items of equal weight, with no hierarchy at all.\n expanded ? 'mb-3' : 'mb-2',\n ].join(' ')}\n // The stage change IS the feedback; without this a screen-reader user\n // is told nothing when connecting becomes listening becomes thinking.\n aria-live=\"polite\"\n data-testid=\"assistant-voice-status\"\n >\n {statusText}\n </p>\n\n {state === 'mic-error' ? (\n // A failure gets the stage to itself — no caption, no waveform. It is\n // not part of the conversation and must not look like it.\n <p\n className={`max-w-md text-center text-status-warning ${expanded ? 'text-lg' : 'text-sm'}`}\n role=\"alert\"\n data-testid=\"assistant-voice-stage-error\"\n >\n {errorText}\n </p>\n ) : (\n <>\n <div className={expanded ? 'mb-10' : 'mb-5'}>\n <VoiceWaveform\n // ★ `endpoint-grace` keeps the waveform ALIVE. It is the two-second\n // window in which the user may still correct themselves, so it has\n // to look like a microphone that is still open — a frozen waveform\n // would read as \"it stopped listening\", which is the opposite of\n // what the window is for. `interrupting` stays still on purpose:\n // the assistant has just been cut off and capture has not resumed.\n active={waveformIsActive(state)}\n settled={waveformIsSettled(state)}\n tone={state === 'speaking' ? 'speaking' : 'listening'}\n expanded={expanded}\n />\n </div>\n\n {caption ? (\n <div\n className={\n expanded\n ? // ★ A long reply used to run off the bottom of the screen with\n // no way to reach it. The model is asked for one to four\n // sentences, but that is guidance, not a guarantee — so the\n // caption is bounded and scrolls rather than being lost.\n 'mb-12 max-h-[46vh] w-full overflow-y-auto'\n : // ★ The SAME bound, which the docked panel never got. It is the\n // shorter surface of the two, so an unbounded caption there\n // pushed the orb — the only in-flow control — out of view and\n // clipped the rest of the answer with no way to scroll to it.\n 'mb-6 max-h-[38vh] w-full overflow-y-auto'\n }\n >\n <VoiceCaption\n text={caption}\n role={showsAssistantCaption(state) ? 'assistant' : 'user'}\n expanded={expanded}\n testId=\"assistant-voice-caption\"\n />\n </div>\n ) : (\n // Reserve the caption's space so the control does not jump when the\n // first words arrive. Two lines' worth at each size, matching what\n // a typical utterance actually occupies.\n //\n // ★ 4.875rem is 3x the assistant caption's MINIMUM (1.625rem at 1.5\n // leading = two lines), tracking the type floor as the old 4.5rem\n // tracked 1.5rem. Honest about what that does and does not buy: it\n // removes the jump only while the clamp is at its floor, i.e. up to\n // ~1040px viewport, and the reserve is sized to the ASSISTANT\n // caption while the common transition out of it is to the smaller\n // USER caption. It is a compromise between two captions of\n // different sizes, not a guarantee.\n <div className={expanded ? 'mb-12 h-[4.875rem]' : 'mb-6 h-12'} aria-hidden=\"true\" />\n )}\n </>\n )}\n\n {control}\n </div>\n );\n};\n"],"mappings":";;;;;AA6CA,IAAa,KAAyB,EACpC,UACA,gBACA,qBACA,aACA,eACA,YACA,eAAY,WACR;CACJ,IAAM,IAAU,EAAsB,CAAK,IAAI,IAAmB,EAAiB,CAAK,IAAI,IAAc;CAE1G,OACE,kBAAC,OAAD;EACE,WAAW;GACT;GACA,IAAW,SAAS;GAMpB,IAAW,4BAA4B;EACzC,EAAE,KAAK,GAAG;EACV,eAAY;EACZ,cAAY;YAZd;GAeE,kBAAC,KAAD;IACE,WAAW;KACT;KACA,IAAW,cAAc;KAIzB,IAAW,SAAS;IACtB,EAAE,KAAK,GAAG;IAGV,aAAU;IACV,eAAY;cAEX;GACA,CAAA;GAEF,MAAU,cAGT,kBAAC,KAAD;IACE,WAAW,4CAA4C,IAAW,YAAY;IAC9E,MAAK;IACL,eAAY;cAEX;GACA,CAAA,IAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;IAAK,WAAW,IAAW,UAAU;cACnC,kBAAC,GAAD;KAOE,QAAQ,EAAiB,CAAK;KAC9B,SAAS,EAAkB,CAAK;KAChC,MAAM,MAAU,aAAa,aAAa;KAChC;IACX,CAAA;GACE,CAAA,GAEJ,IACC,kBAAC,OAAD;IACE,WACE,IAKI,8CAKA;cAGN,kBAAC,GAAD;KACE,MAAM;KACN,MAAM,EAAsB,CAAK,IAAI,cAAc;KACzC;KACV,QAAO;IACR,CAAA;GACE,CAAA,IAcL,kBAAC,OAAD;IAAK,WAAW,IAAW,uBAAuB;IAAa,eAAY;GAAQ,CAAA,CAErF,EAAA,CAAA;GAGH;EACE;;AAET"}
|
|
@@ -8,7 +8,7 @@ var a = ({ turns: a, onClose: o }) => {
|
|
|
8
8
|
return /* @__PURE__ */ i("div", {
|
|
9
9
|
className: "absolute inset-0 z-30 flex flex-col bg-bg-sunken/95 backdrop-blur-sm",
|
|
10
10
|
role: "dialog",
|
|
11
|
-
"aria-label": s("healthybowl.assistant.voiceSession.
|
|
11
|
+
"aria-label": s("healthybowl.assistant.voiceSession.transcriptTitle", "Voice transcript"),
|
|
12
12
|
"data-testid": "assistant-voice-transcript",
|
|
13
13
|
children: [/* @__PURE__ */ i("div", {
|
|
14
14
|
className: "flex items-center justify-between border-b border-border-subtle px-4 py-3",
|
|
@@ -19,7 +19,7 @@ var a = ({ turns: a, onClose: o }) => {
|
|
|
19
19
|
children: s("healthybowl.assistant.voiceSession.transcript", "Voice conversation")
|
|
20
20
|
}), /* @__PURE__ */ r("p", {
|
|
21
21
|
className: "truncate text-xs text-text-muted",
|
|
22
|
-
children: s("healthybowl.assistant.voiceSession.transcriptHint", "
|
|
22
|
+
children: s("healthybowl.assistant.voiceSession.transcriptHint", "Spoken turns in this conversation — kept out of your typed chat.")
|
|
23
23
|
})]
|
|
24
24
|
}), /* @__PURE__ */ r("button", {
|
|
25
25
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptDrawer.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceTranscriptDrawer.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { X } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { VoiceConversationView } from './VoiceConversationView';\n\n/**\n * This session's spoken turns, on demand.\n *\n * The stage shows only what is happening NOW, which is right for a live\n * conversation and would otherwise mean the history is simply gone. This is\n * where it goes: secondary, behind a button, and explicitly a VOICE transcript\n * rather than the chat thread.\n *\n * ★ `z-30` is not decoration: the session container is `z-20` docked and\n * `z-[60]` expanded, and a child at `z-10` painted BEHIND its own parent — the\n * drawer opened and was invisible. Stacking contexts are per-parent, so this\n * only has to beat its siblings, not the overlay itself.\n *\n * ★ Session-scoped and ephemeral by design. It renders the turns it is handed —\n * which are already filtered to this voice session — so it can never resurrect\n * the typed conversation the old overlay used to paint.\n */\n\ninterface Props {\n turns: ReadonlyArray<{ id: string; role: 'user' | 'assistant'; text: string }>;\n onClose: () => void;\n}\n\nexport const VoiceTranscriptDrawer: FC<Props> = ({ turns, onClose }) => {\n const tr = useTr();\n return (\n <div\n className=\"absolute inset-0 z-30 flex flex-col bg-bg-sunken/95 backdrop-blur-sm\"\n role=\"dialog\"\n aria-label={tr('healthybowl.assistant.voiceSession.
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptDrawer.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceTranscriptDrawer.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { X } from 'lucide-react';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { VoiceConversationView } from './VoiceConversationView';\n\n/**\n * This session's spoken turns, on demand.\n *\n * The stage shows only what is happening NOW, which is right for a live\n * conversation and would otherwise mean the history is simply gone. This is\n * where it goes: secondary, behind a button, and explicitly a VOICE transcript\n * rather than the chat thread.\n *\n * ★ `z-30` is not decoration: the session container is `z-20` docked and\n * `z-[60]` expanded, and a child at `z-10` painted BEHIND its own parent — the\n * drawer opened and was invisible. Stacking contexts are per-parent, so this\n * only has to beat its siblings, not the overlay itself.\n *\n * ★ Session-scoped and ephemeral by design. It renders the turns it is handed —\n * which are already filtered to this voice session — so it can never resurrect\n * the typed conversation the old overlay used to paint.\n */\n\ninterface Props {\n turns: ReadonlyArray<{ id: string; role: 'user' | 'assistant'; text: string }>;\n onClose: () => void;\n}\n\nexport const VoiceTranscriptDrawer: FC<Props> = ({ turns, onClose }) => {\n const tr = useTr();\n return (\n <div\n className=\"absolute inset-0 z-30 flex flex-col bg-bg-sunken/95 backdrop-blur-sm\"\n role=\"dialog\"\n // ★ Its OWN key. This shared `…voiceSession.transcript` with the heading\n // below while giving it a different English default, so once the key is\n // seeded one of the two silently changes to the other's wording.\n aria-label={tr('healthybowl.assistant.voiceSession.transcriptTitle', 'Voice transcript')}\n data-testid=\"assistant-voice-transcript\"\n >\n <div className=\"flex items-center justify-between border-b border-border-subtle px-4 py-3\">\n <div className=\"min-w-0\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n {tr('healthybowl.assistant.voiceSession.transcript', 'Voice conversation')}\n </h2>\n {/* Say plainly that this is NOT the typed thread, so nobody wonders\n why it is not in their chat history.\n\n ★ It used to say \"This session only\", which was not true:\n `voiceTurnsOnly` filters on a per-message marker, so it returns every\n spoken turn in the CONVERSATION, and a second voice session showed the\n first one's turns under a promise that it would not. Showing the whole\n conversation's spoken history is the more useful behaviour of the two,\n so the wording changed rather than the filter. */}\n <p className=\"truncate text-xs text-text-muted\">\n {tr(\n 'healthybowl.assistant.voiceSession.transcriptHint',\n 'Spoken turns in this conversation — kept out of your typed chat.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"flex size-8 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong\"\n aria-label={tr('healthybowl.assistant.voiceSession.transcriptClose', 'Close the transcript')}\n data-testid=\"assistant-voice-transcript-close\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n <VoiceConversationView turns={turns} />\n </div>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAa,KAAoC,EAAE,UAAO,iBAAc;CACtE,IAAM,IAAK,EAAM;CACjB,OACE,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;EAIL,cAAY,EAAG,sDAAsD,kBAAkB;EACvF,eAAY;YAPd,CASE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,iDAAiD,oBAAoB;IACvE,CAAA,GAUJ,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,qDACA,kEACF;IACC,CAAA,CACA;OACL,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,WAAU;IACV,cAAY,EAAG,sDAAsD,sBAAsB;IAC3F,eAAY;cAEZ,kBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;GACjB,CAAA,CACL;MAEL,kBAAC,GAAD,EAA8B,SAAQ,CAAA,CACnC;;AAET"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
//#region src/config/speechLabels.ts
|
|
2
2
|
var e = {
|
|
3
|
+
en: {
|
|
4
|
+
codeBlock: "Code block",
|
|
5
|
+
image: "image",
|
|
6
|
+
link: "link",
|
|
7
|
+
largeTable: "Table with {{rows}} rows and {{columns}} columns",
|
|
8
|
+
truncated: "The rest of this message is not read aloud",
|
|
9
|
+
nestedItem: "Sub-item {{ordinal}}",
|
|
10
|
+
emailAt: "at",
|
|
11
|
+
emailDot: "dot"
|
|
12
|
+
},
|
|
3
13
|
ta: {
|
|
4
14
|
codeBlock: "நிரல் தொகுதி",
|
|
5
15
|
image: "படம்",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechLabels.js","names":[],"sources":["../../src/config/speechLabels.ts"],"sourcesContent":["import type { SpeakableLabels } from '../utils/speakableText';\n\n/**\n * The spoken stand-ins, in the language of the REPLY (BOFF-7120).\n *\n * When a reply contains something that cannot be read aloud — an image, a link,\n * a fenced code block, a wide table — the reader substitutes a word. Those words\n * used to come from `tr()`, which resolves against the INTERFACE language. So an\n * English interface reading a Tamil answer said \"Code block\" and \"image\" in\n * English, dropped into the middle of a Tamil sentence. Exactly the complaint\n * that produced the translatable `at`/`dot` for email addresses; that fix was\n * applied there and nowhere else.\n *\n * ★ Why a static table rather than `tr()` with a locale argument: the i18n\n * provider only ever FETCHES the active locale. `I18nContextValue.translations`\n * holds that one dictionary, so there is nothing to ask for Tamil while the\n * interface is English — the strings simply are not in the client. These eight\n * are short, stable, and needed synchronously mid-utterance, so they are carried\n * here instead.\n *\n * Anything not listed falls back to the interface-language label, which is what\n * happens today — so this can only improve on the current behaviour, never\n * regress it.\n */\ntype PartialLabels = Partial<SpeakableLabels>;\n\n/** Keyed by primary language subtag, since the reply locale may carry a region. */\nconst LABELS_BY_LANGUAGE: Record<string, PartialLabels> = {\n ta: {\n codeBlock: 'நிரல் தொகுதி',\n image: 'படம்',\n link: 'இணைப்பு',\n largeTable: '{{rows}} வரிசைகள் மற்றும் {{columns}} நெடுவரிசைகள் கொண்ட அட்டவணை',\n truncated: 'இந்தச் செய்தியின் மீதமுள்ள பகுதி வாசிக்கப்படவில்லை',\n nestedItem: 'துணை உருப்படி {{ordinal}}',\n emailAt: 'அட்',\n emailDot: 'புள்ளி',\n },\n hi: {\n codeBlock: 'कोड ब्लॉक',\n image: 'छवि',\n link: 'लिंक',\n largeTable: '{{rows}} पंक्तियों और {{columns}} स्तंभों वाली तालिका',\n truncated: 'इस संदेश का शेष भाग नहीं पढ़ा जाता',\n nestedItem: 'उप-आइटम {{ordinal}}',\n emailAt: 'ऐट',\n emailDot: 'डॉट',\n },\n ar: {\n codeBlock: 'كتلة برمجية',\n image: 'صورة',\n link: 'رابط',\n largeTable: 'جدول من {{rows}} صفوف و {{columns}} أعمدة',\n truncated: 'لا تتم قراءة بقية هذه الرسالة بصوت عالٍ',\n nestedItem: 'عنصر فرعي {{ordinal}}',\n emailAt: 'أت',\n emailDot: 'نقطة',\n },\n es: {\n codeBlock: 'Bloque de código',\n image: 'imagen',\n link: 'enlace',\n largeTable: 'Tabla con {{rows}} filas y {{columns}} columnas',\n truncated: 'El resto de este mensaje no se lee en voz alta',\n nestedItem: 'Subelemento {{ordinal}}',\n emailAt: 'arroba',\n emailDot: 'punto',\n },\n zh: {\n codeBlock: '代码块',\n image: '图片',\n link: '链接',\n largeTable: '包含 {{rows}} 行 {{columns}} 列的表格',\n truncated: '此消息的其余部分不会朗读',\n nestedItem: '子项 {{ordinal}}',\n emailAt: 'at',\n emailDot: '点',\n },\n};\n\n/**\n * Labels to read a reply in `locale` with.\n *\n * `uiLabels` is the interface-language set, used both as the base and as the\n * fallback for any language not carried here — so English replies, and any\n * language we have no table for, behave exactly as before.\n */\nexport function speechLabelsFor(locale: string, uiLabels: SpeakableLabels): SpeakableLabels {\n const primary = locale.trim().toLowerCase().split(/[-_]/)[0];\n if (!primary) return uiLabels;\n const overrides = LABELS_BY_LANGUAGE[primary];\n return overrides ? { ...uiLabels, ...overrides } : uiLabels;\n}\n\n/** Exposed for tests: which languages have their own spoken labels. */\nexport const SPOKEN_LABEL_LANGUAGES = Object.keys(LABELS_BY_LANGUAGE);\n"],"mappings":";AA2BA,IAAM,IAAoD;
|
|
1
|
+
{"version":3,"file":"speechLabels.js","names":[],"sources":["../../src/config/speechLabels.ts"],"sourcesContent":["import type { SpeakableLabels } from '../utils/speakableText';\n\n/**\n * The spoken stand-ins, in the language of the REPLY (BOFF-7120).\n *\n * When a reply contains something that cannot be read aloud — an image, a link,\n * a fenced code block, a wide table — the reader substitutes a word. Those words\n * used to come from `tr()`, which resolves against the INTERFACE language. So an\n * English interface reading a Tamil answer said \"Code block\" and \"image\" in\n * English, dropped into the middle of a Tamil sentence. Exactly the complaint\n * that produced the translatable `at`/`dot` for email addresses; that fix was\n * applied there and nowhere else.\n *\n * ★ Why a static table rather than `tr()` with a locale argument: the i18n\n * provider only ever FETCHES the active locale. `I18nContextValue.translations`\n * holds that one dictionary, so there is nothing to ask for Tamil while the\n * interface is English — the strings simply are not in the client. These eight\n * are short, stable, and needed synchronously mid-utterance, so they are carried\n * here instead.\n *\n * Anything not listed falls back to the interface-language label, which is what\n * happens today — so this can only improve on the current behaviour, never\n * regress it.\n */\ntype PartialLabels = Partial<SpeakableLabels>;\n\n/** Keyed by primary language subtag, since the reply locale may carry a region. */\nconst LABELS_BY_LANGUAGE: Record<string, PartialLabels> = {\n /**\n * ★ English is carried explicitly, and it is not redundant.\n *\n * The fallback below is the INTERFACE language, so a language with no table of\n * its own inherits whatever the menu is set to. That is right for an unlisted\n * language, and exactly wrong for English: with a Tamil interface and an\n * English reply, `tr()` returned the Tamil words and spliced \"நிரல் தொகுதி\"\n * into an English sentence — the very defect this table exists to prevent,\n * running the other way. Naming English pins it regardless of the menu.\n *\n * These are the same strings as the English defaults in `speakableText.ts`;\n * unlike the others they need no translator, which is why this one entry is\n * here while the remaining locales are not.\n */\n en: {\n codeBlock: 'Code block',\n image: 'image',\n link: 'link',\n largeTable: 'Table with {{rows}} rows and {{columns}} columns',\n truncated: 'The rest of this message is not read aloud',\n nestedItem: 'Sub-item {{ordinal}}',\n emailAt: 'at',\n emailDot: 'dot',\n },\n ta: {\n codeBlock: 'நிரல் தொகுதி',\n image: 'படம்',\n link: 'இணைப்பு',\n largeTable: '{{rows}} வரிசைகள் மற்றும் {{columns}} நெடுவரிசைகள் கொண்ட அட்டவணை',\n truncated: 'இந்தச் செய்தியின் மீதமுள்ள பகுதி வாசிக்கப்படவில்லை',\n nestedItem: 'துணை உருப்படி {{ordinal}}',\n emailAt: 'அட்',\n emailDot: 'புள்ளி',\n },\n hi: {\n codeBlock: 'कोड ब्लॉक',\n image: 'छवि',\n link: 'लिंक',\n largeTable: '{{rows}} पंक्तियों और {{columns}} स्तंभों वाली तालिका',\n truncated: 'इस संदेश का शेष भाग नहीं पढ़ा जाता',\n nestedItem: 'उप-आइटम {{ordinal}}',\n emailAt: 'ऐट',\n emailDot: 'डॉट',\n },\n ar: {\n codeBlock: 'كتلة برمجية',\n image: 'صورة',\n link: 'رابط',\n largeTable: 'جدول من {{rows}} صفوف و {{columns}} أعمدة',\n truncated: 'لا تتم قراءة بقية هذه الرسالة بصوت عالٍ',\n nestedItem: 'عنصر فرعي {{ordinal}}',\n emailAt: 'أت',\n emailDot: 'نقطة',\n },\n es: {\n codeBlock: 'Bloque de código',\n image: 'imagen',\n link: 'enlace',\n largeTable: 'Tabla con {{rows}} filas y {{columns}} columnas',\n truncated: 'El resto de este mensaje no se lee en voz alta',\n nestedItem: 'Subelemento {{ordinal}}',\n emailAt: 'arroba',\n emailDot: 'punto',\n },\n zh: {\n codeBlock: '代码块',\n image: '图片',\n link: '链接',\n largeTable: '包含 {{rows}} 行 {{columns}} 列的表格',\n truncated: '此消息的其余部分不会朗读',\n nestedItem: '子项 {{ordinal}}',\n emailAt: 'at',\n emailDot: '点',\n },\n};\n\n/**\n * Labels to read a reply in `locale` with.\n *\n * `uiLabels` is the interface-language set, used both as the base and as the\n * fallback for any language not carried here — so English replies, and any\n * language we have no table for, behave exactly as before.\n */\nexport function speechLabelsFor(locale: string, uiLabels: SpeakableLabels): SpeakableLabels {\n const primary = locale.trim().toLowerCase().split(/[-_]/)[0];\n if (!primary) return uiLabels;\n const overrides = LABELS_BY_LANGUAGE[primary];\n return overrides ? { ...uiLabels, ...overrides } : uiLabels;\n}\n\n/** Exposed for tests: which languages have their own spoken labels. */\nexport const SPOKEN_LABEL_LANGUAGES = Object.keys(LABELS_BY_LANGUAGE);\n"],"mappings":";AA2BA,IAAM,IAAoD;CAexD,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;CACA,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;CACA,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;CACA,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;CACA,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;CACA,IAAI;EACF,WAAW;EACX,OAAO;EACP,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,SAAS;EACT,UAAU;CACZ;AACF;AASA,SAAgB,EAAgB,GAAgB,GAA4C;CAC1F,IAAM,IAAU,EAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,EAAE;CAC1D,IAAI,CAAC,GAAS,OAAO;CACrB,IAAM,IAAY,EAAmB;CACrC,OAAO,IAAY;EAAE,GAAG;EAAU,GAAG;CAAU,IAAI;AACrD"}
|
|
@@ -57,6 +57,8 @@ function c({ onFinalize: c, language: l }) {
|
|
|
57
57
|
t !== "no-speech" && g(t);
|
|
58
58
|
}, t.onend = () => {
|
|
59
59
|
n === v.current && (_.current = null, f(!1), m(""));
|
|
60
|
+
}, t.onstart = () => {
|
|
61
|
+
n === v.current && f(!0);
|
|
60
62
|
};
|
|
61
63
|
try {
|
|
62
64
|
t.start();
|
|
@@ -64,7 +66,7 @@ function c({ onFinalize: c, language: l }) {
|
|
|
64
66
|
_.current = null, f(!1);
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
67
|
-
_.current = t, g(null), m("")
|
|
69
|
+
_.current = t, g(null), m("");
|
|
68
70
|
}, [x]), C = e(() => {
|
|
69
71
|
let e = _.current;
|
|
70
72
|
_.current = null, v.current += 1, e?.stop(), f(!1), m("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceInput.js","names":[],"sources":["../../src/hooks/useVoiceInput.ts"],"sourcesContent":["/**\n * Speech-to-text for the assistant composer (Workstream 2 of the AI Assistant\n * V2 multimodal effort).\n *\n * Input-only, browser-native (Web Speech API). It degrades gracefully:\n * `isSupported` is false on engines without SpeechRecognition (notably Firefox),\n * and the composer hides the mic entirely in that case rather than showing a\n * dead control.\n *\n * ⚠️ This does NOT mean the audio stays on the device. Chrome's\n * `webkitSpeechRecognition` is a NETWORK service — the audio is streamed to the\n * browser vendor for recognition, and the supported language list is theirs, not\n * ours. We neither receive nor store it, which is all an earlier version of this\n * comment (\"no audio ever leaves the device through us\") actually claimed; read\n * literally it implied something stronger and untrue. Whether recording farmers'\n * speech this way needs disclosure or consent is a product/legal call, not a\n * code one.\n *\n * Output (reading replies aloud) is a separate concern and lives in\n * `AssistantSpeechProvider`; an earlier version of this note said the assistant\n * does not speak, which stopped being true when BOFF-6290 shipped.\n *\n * Differences from the fe-libs `assistantWidget/useVoiceInput` this is modelled\n * on, all of which the composer needs:\n * - **interim results are exposed**, so the user sees words appear while\n * speaking instead of staring at a silent button until a phrase finalises;\n * - **errors are surfaced** (`error`) so a denied mic permission can be\n * explained rather than looking like a no-op;\n * - **the recogniser language follows the app locale** (a Tamil or Hindi\n * farmer dictating into an `en-US` recogniser gets garbage);\n * - **`stop()` resolves the final transcript** through `onFinalize`, so the\n * composer can commit exactly once when the user stops.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport type { Locale } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface SpeechRecognitionEventLike extends Event {\n results: SpeechRecognitionResultList;\n resultIndex: number;\n}\n\ninterface SpeechRecognitionErrorEventLike extends Event {\n error: string;\n message: string;\n}\n\ninterface SpeechRecognitionInstance extends EventTarget {\n continuous: boolean;\n interimResults: boolean;\n lang: string;\n start(): void;\n stop(): void;\n abort(): void;\n onresult: ((event: SpeechRecognitionEventLike) => void) | null;\n onerror: ((event: SpeechRecognitionErrorEventLike) => void) | null;\n onend: (() => void) | null;\n}\n\ntype SpeechRecognitionConstructor = new () => SpeechRecognitionInstance;\n\n/**\n * BCP-47 tag for the recogniser, per app locale. Regional choices follow where\n * HealthyBowl actually operates (India for ta/hi) rather than a generic tag,\n * because the recogniser's acoustic model is region-specific.\n */\nconst RECOGNITION_LANG: Record<Locale, string> = {\n en: 'en-US',\n es: 'es-ES',\n fr: 'fr-FR',\n de: 'de-DE',\n ja: 'ja-JP',\n zh: 'zh-CN',\n ta: 'ta-IN',\n hi: 'hi-IN',\n ar: 'ar-SA',\n};\n\nfunction getSpeechRecognitionConstructor(): SpeechRecognitionConstructor | null {\n if (typeof window === 'undefined') return null;\n const win = window as unknown as Record<string, unknown>;\n return (\n (win.SpeechRecognition as SpeechRecognitionConstructor | undefined) ??\n (win.webkitSpeechRecognition as SpeechRecognitionConstructor | undefined) ??\n null\n );\n}\n\nexport type VoiceInputError =\n 'not-allowed' | 'no-speech' | 'audio-capture' | 'network' | 'language-not-supported' | 'unknown';\n\n/**\n * Map the spec's `SpeechRecognitionErrorEvent.error` codes onto the cases the UI\n * actually distinguishes. Anything else is 'unknown' (generic copy).\n *\n * `language-not-supported` is called out separately because it is the single\n * most likely failure for the users this feature exists for: the recogniser's\n * language list belongs to the browser vendor, not to us, so a Tamil or Hindi\n * speaker can hit it on a browser that simply does not offer their language.\n * Folding it into 'unknown' produced \"Dictation stopped unexpectedly\", which\n * tells them nothing and reads like a bug in HealthyBowl.\n */\nfunction toVoiceInputError(code: string): VoiceInputError {\n switch (code) {\n case 'not-allowed':\n case 'service-not-allowed':\n return 'not-allowed';\n case 'no-speech':\n return 'no-speech';\n case 'audio-capture':\n return 'audio-capture';\n case 'network':\n return 'network';\n case 'language-not-supported':\n return 'language-not-supported';\n default:\n return 'unknown';\n }\n}\n\nexport interface UseVoiceInputOptions {\n /**\n * Called with each newly finalised phrase. The composer appends it to the\n * draft; keeping the committed text in the caller (rather than accumulating\n * here) means the user can freely edit while dictation continues.\n */\n onFinalize: (text: string) => void;\n /**\n * BCP-47 tag to listen for. Omit to follow the app locale, which is what this\n * hook did unconditionally before (BOFF-7108).\n *\n * The two are genuinely independent: a farmer whose interface is English may\n * well speak Tamil, and deriving the recogniser language from the UI meant the\n * only way to dictate Tamil was to translate the entire app.\n */\n language?: string;\n}\n\nexport interface UseVoiceInputResult {\n isSupported: boolean;\n isListening: boolean;\n /** Words recognised but not yet finalised — render as a live hint. */\n interim: string;\n error: VoiceInputError | null;\n /**\n * BCP-47 tag the recogniser was asked for. Exposed so error copy can name the\n * language that failed (\"Tamil dictation is not supported…\") rather than\n * leaving the user to guess which language the browser rejected.\n */\n language: string;\n start: () => void;\n stop: () => void;\n /** Start if idle, stop if listening — what the mic button binds to. */\n toggle: () => void;\n clearError: () => void;\n}\n\nexport function useVoiceInput({ onFinalize, language: requested }: UseVoiceInputOptions): UseVoiceInputResult {\n const { locale } = useI18n();\n const [isListening, setIsListening] = useState(false);\n const [interim, setInterim] = useState('');\n const [error, setError] = useState<VoiceInputError | null>(null);\n const recognitionRef = useRef<SpeechRecognitionInstance | null>(null);\n // Incremented on every stop. Handlers capture the session they were created\n // under and ignore events that arrive after it ends.\n const sessionRef = useRef(0);\n\n // Keep the newest callback reachable from the recogniser's long-lived event\n // handlers without re-creating the recogniser on every parent render.\n const onFinalizeRef = useRef(onFinalize);\n useEffect(() => {\n onFinalizeRef.current = onFinalize;\n }, [onFinalize]);\n\n const isSupported = getSpeechRecognitionConstructor() !== null;\n const language = requested ?? RECOGNITION_LANG[locale] ?? 'en-US';\n\n // Abort (not stop) on unmount: the panel is closing, so a trailing final\n // result would be committed into a draft nobody can see.\n useEffect(() => {\n return () => {\n recognitionRef.current?.abort();\n recognitionRef.current = null;\n };\n }, []);\n\n const start = useCallback(() => {\n const Ctor = getSpeechRecognitionConstructor();\n if (!Ctor || recognitionRef.current) return;\n\n const recognition = new Ctor();\n recognition.continuous = true;\n recognition.interimResults = true;\n recognition.lang = language;\n\n const session = sessionRef.current;\n\n recognition.onresult = (event) => {\n if (session !== sessionRef.current) return;\n let finalText = '';\n let interimText = '';\n for (let index = event.resultIndex; index < event.results.length; index += 1) {\n const result = event.results[index];\n const alternative = result[0]?.transcript ?? '';\n if (result.isFinal) {\n finalText += alternative;\n } else {\n interimText += alternative;\n }\n }\n if (finalText.trim()) onFinalizeRef.current(finalText.trim());\n setInterim(interimText.trim());\n };\n\n recognition.onerror = (event) => {\n if (session !== sessionRef.current) return;\n const mapped = toVoiceInputError(event.error);\n // 'no-speech' fires routinely during a natural pause and the recogniser\n // keeps running — surfacing it would flash a scary message mid-sentence.\n if (mapped !== 'no-speech') setError(mapped);\n };\n\n recognition.onend = () => {\n if (session !== sessionRef.current) return;\n recognitionRef.current = null;\n setIsListening(false);\n setInterim('');\n };\n\n try {\n recognition.start();\n } catch {\n // start() throws if a recogniser is somehow already running — treat the\n // session as not started rather than leaving the button stuck \"live\".\n recognitionRef.current = null;\n setIsListening(false);\n return;\n }\n\n recognitionRef.current = recognition;\n setError(null);\n setInterim('');\n setIsListening(true);\n }, [language]);\n\n const stop = useCallback(() => {\n // Detach BEFORE stopping. `onend` is what used to clear this ref, but it\n // arrives asynchronously — so a user who tapped stop and immediately tapped\n // the mic again hit `start()`'s `if (recognitionRef.current) return` guard\n // and got a silent no-op. Bumping the session also makes any trailing final\n // phrase the engine flushes on stop land on a dead session, instead of\n // reappearing in a draft the composer has already sent and cleared.\n const recognition = recognitionRef.current;\n recognitionRef.current = null;\n sessionRef.current += 1;\n recognition?.stop();\n setIsListening(false);\n setInterim('');\n }, []);\n\n // Changing language must END the session it no longer describes.\n //\n // A running recogniser keeps the `lang` it was constructed with, so after a\n // switch the in-flight session is still listening in the OLD language while\n // this hook already reports the new one. A late `language-not-supported` from\n // that session would then be rendered as though the browser had rejected the\n // language the user just picked. Clearing the error is not enough — the\n // session producing it has to go too.\n const languageRef = useRef(language);\n useEffect(() => {\n if (languageRef.current === language) return;\n languageRef.current = language;\n stop();\n setError(null);\n }, [language, stop]);\n\n const toggle = useCallback(() => {\n if (isListening) stop();\n else start();\n }, [isListening, start, stop]);\n\n const clearError = useCallback(() => setError(null), []);\n\n return { isSupported, isListening, interim, error, language, start, stop, toggle, clearError };\n}\n"],"mappings":";;;AAmEA,IAAM,IAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAS,IAAuE;CAC9E,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAM,IAAM;CACZ,OACG,EAAI,qBACJ,EAAI,2BACL;AAEJ;AAgBA,SAAS,EAAkB,GAA+B;CACxD,QAAQ,GAAR;EACE,KAAK;EACL,K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IAAI,MAAY,EAAW,SAAS;GACpC,IAAM,IAAS,EAAkB,EAAM,KAAK;GAG5C,AAAI,MAAW,eAAa,EAAS,CAAM;EAC7C,GAEA,EAAY,cAAc;GACpB,MAAY,EAAW,YAC3B,EAAe,UAAU,MACzB,EAAe,EAAK,GACpB,EAAW,EAAE;EACf;EAEA,IAAI;GACF,EAAY,MAAM;EACpB,QAAQ;GAIN,AADA,EAAe,UAAU,MACzB,EAAe,EAAK;GACpB;EACF;EAKA,AAHA,EAAe,UAAU,GACzB,EAAS,IAAI,GACb,EAAW,EAAE,GACb,EAAe,EAAI;CACrB,GAAG,CAAC,CAAQ,CAAC,GAEP,IAAO,QAAkB;EAO7B,IAAM,IAAc,EAAe;EAKnC,AAJA,EAAe,UAAU,MACzB,EAAW,WAAW,GACtB,GAAa,KAAK,GAClB,EAAe,EAAK,GACpB,EAAW,EAAE;CACf,GAAG,CAAC,CAAC,GAUC,IAAc,EAAO,CAAQ;CAenC,OAdA,QAAgB;EACV,EAAY,YAAY,MAC5B,EAAY,UAAU,GACtB,EAAK,GACL,EAAS,IAAI;CACf,GAAG,CAAC,GAAU,CAAI,CAAC,GASZ;EAAE;EAAa;EAAa;EAAS;EAAO;EAAU;EAAO;EAAM,QAP3D,QAAkB;GAC/B,AAAI,IAAa,EAAK,IACjB,EAAM;EACb,GAAG;GAAC;GAAa;GAAO;EAAI,CAI8C;EAAQ,YAF/D,QAAkB,EAAS,IAAI,GAAG,CAAC,CAE4B;CAAW;AAC/F"}
|
|
1
|
+
{"version":3,"file":"useVoiceInput.js","names":[],"sources":["../../src/hooks/useVoiceInput.ts"],"sourcesContent":["/**\n * Speech-to-text for the assistant composer (Workstream 2 of the AI Assistant\n * V2 multimodal effort).\n *\n * Input-only, browser-native (Web Speech API). It degrades gracefully:\n * `isSupported` is false on engines without SpeechRecognition (notably Firefox),\n * and the composer hides the mic entirely in that case rather than showing a\n * dead control.\n *\n * ⚠️ This does NOT mean the audio stays on the device. Chrome's\n * `webkitSpeechRecognition` is a NETWORK service — the audio is streamed to the\n * browser vendor for recognition, and the supported language list is theirs, not\n * ours. We neither receive nor store it, which is all an earlier version of this\n * comment (\"no audio ever leaves the device through us\") actually claimed; read\n * literally it implied something stronger and untrue. Whether recording farmers'\n * speech this way needs disclosure or consent is a product/legal call, not a\n * code one.\n *\n * Output (reading replies aloud) is a separate concern and lives in\n * `AssistantSpeechProvider`; an earlier version of this note said the assistant\n * does not speak, which stopped being true when BOFF-6290 shipped.\n *\n * Differences from the fe-libs `assistantWidget/useVoiceInput` this is modelled\n * on, all of which the composer needs:\n * - **interim results are exposed**, so the user sees words appear while\n * speaking instead of staring at a silent button until a phrase finalises;\n * - **errors are surfaced** (`error`) so a denied mic permission can be\n * explained rather than looking like a no-op;\n * - **the recogniser language follows the app locale** (a Tamil or Hindi\n * farmer dictating into an `en-US` recogniser gets garbage);\n * - **`stop()` resolves the final transcript** through `onFinalize`, so the\n * composer can commit exactly once when the user stops.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport type { Locale } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface SpeechRecognitionEventLike extends Event {\n results: SpeechRecognitionResultList;\n resultIndex: number;\n}\n\ninterface SpeechRecognitionErrorEventLike extends Event {\n error: string;\n message: string;\n}\n\ninterface SpeechRecognitionInstance extends EventTarget {\n continuous: boolean;\n interimResults: boolean;\n lang: string;\n start(): void;\n stop(): void;\n abort(): void;\n onresult: ((event: SpeechRecognitionEventLike) => void) | null;\n onerror: ((event: SpeechRecognitionErrorEventLike) => void) | null;\n onend: (() => void) | null;\n /**\n * Fires when the service has actually begun listening — the only honest\n * \"capture has started\" signal. Absent from this declaration until now, which\n * is part of why capture was inferred from `start()` returning instead.\n */\n onstart: (() => void) | null;\n}\n\ntype SpeechRecognitionConstructor = new () => SpeechRecognitionInstance;\n\n/**\n * BCP-47 tag for the recogniser, per app locale. Regional choices follow where\n * HealthyBowl actually operates (India for ta/hi) rather than a generic tag,\n * because the recogniser's acoustic model is region-specific.\n */\nconst RECOGNITION_LANG: Record<Locale, string> = {\n en: 'en-US',\n es: 'es-ES',\n fr: 'fr-FR',\n de: 'de-DE',\n ja: 'ja-JP',\n zh: 'zh-CN',\n ta: 'ta-IN',\n hi: 'hi-IN',\n ar: 'ar-SA',\n};\n\nfunction getSpeechRecognitionConstructor(): SpeechRecognitionConstructor | null {\n if (typeof window === 'undefined') return null;\n const win = window as unknown as Record<string, unknown>;\n return (\n (win.SpeechRecognition as SpeechRecognitionConstructor | undefined) ??\n (win.webkitSpeechRecognition as SpeechRecognitionConstructor | undefined) ??\n null\n );\n}\n\nexport type VoiceInputError =\n 'not-allowed' | 'no-speech' | 'audio-capture' | 'network' | 'language-not-supported' | 'unknown';\n\n/**\n * Map the spec's `SpeechRecognitionErrorEvent.error` codes onto the cases the UI\n * actually distinguishes. Anything else is 'unknown' (generic copy).\n *\n * `language-not-supported` is called out separately because it is the single\n * most likely failure for the users this feature exists for: the recogniser's\n * language list belongs to the browser vendor, not to us, so a Tamil or Hindi\n * speaker can hit it on a browser that simply does not offer their language.\n * Folding it into 'unknown' produced \"Dictation stopped unexpectedly\", which\n * tells them nothing and reads like a bug in HealthyBowl.\n */\nfunction toVoiceInputError(code: string): VoiceInputError {\n switch (code) {\n case 'not-allowed':\n case 'service-not-allowed':\n return 'not-allowed';\n case 'no-speech':\n return 'no-speech';\n case 'audio-capture':\n return 'audio-capture';\n case 'network':\n return 'network';\n case 'language-not-supported':\n return 'language-not-supported';\n default:\n return 'unknown';\n }\n}\n\nexport interface UseVoiceInputOptions {\n /**\n * Called with each newly finalised phrase. The composer appends it to the\n * draft; keeping the committed text in the caller (rather than accumulating\n * here) means the user can freely edit while dictation continues.\n */\n onFinalize: (text: string) => void;\n /**\n * BCP-47 tag to listen for. Omit to follow the app locale, which is what this\n * hook did unconditionally before (BOFF-7108).\n *\n * The two are genuinely independent: a farmer whose interface is English may\n * well speak Tamil, and deriving the recogniser language from the UI meant the\n * only way to dictate Tamil was to translate the entire app.\n */\n language?: string;\n}\n\nexport interface UseVoiceInputResult {\n isSupported: boolean;\n isListening: boolean;\n /** Words recognised but not yet finalised — render as a live hint. */\n interim: string;\n error: VoiceInputError | null;\n /**\n * BCP-47 tag the recogniser was asked for. Exposed so error copy can name the\n * language that failed (\"Tamil dictation is not supported…\") rather than\n * leaving the user to guess which language the browser rejected.\n */\n language: string;\n start: () => void;\n stop: () => void;\n /** Start if idle, stop if listening — what the mic button binds to. */\n toggle: () => void;\n clearError: () => void;\n}\n\nexport function useVoiceInput({ onFinalize, language: requested }: UseVoiceInputOptions): UseVoiceInputResult {\n const { locale } = useI18n();\n const [isListening, setIsListening] = useState(false);\n const [interim, setInterim] = useState('');\n const [error, setError] = useState<VoiceInputError | null>(null);\n const recognitionRef = useRef<SpeechRecognitionInstance | null>(null);\n // Incremented on every stop. Handlers capture the session they were created\n // under and ignore events that arrive after it ends.\n const sessionRef = useRef(0);\n\n // Keep the newest callback reachable from the recogniser's long-lived event\n // handlers without re-creating the recogniser on every parent render.\n const onFinalizeRef = useRef(onFinalize);\n useEffect(() => {\n onFinalizeRef.current = onFinalize;\n }, [onFinalize]);\n\n const isSupported = getSpeechRecognitionConstructor() !== null;\n const language = requested ?? RECOGNITION_LANG[locale] ?? 'en-US';\n\n // Abort (not stop) on unmount: the panel is closing, so a trailing final\n // result would be committed into a draft nobody can see.\n useEffect(() => {\n return () => {\n recognitionRef.current?.abort();\n recognitionRef.current = null;\n };\n }, []);\n\n const start = useCallback(() => {\n const Ctor = getSpeechRecognitionConstructor();\n if (!Ctor || recognitionRef.current) return;\n\n const recognition = new Ctor();\n recognition.continuous = true;\n recognition.interimResults = true;\n recognition.lang = language;\n\n const session = sessionRef.current;\n\n recognition.onresult = (event) => {\n if (session !== sessionRef.current) return;\n let finalText = '';\n let interimText = '';\n for (let index = event.resultIndex; index < event.results.length; index += 1) {\n const result = event.results[index];\n const alternative = result[0]?.transcript ?? '';\n if (result.isFinal) {\n finalText += alternative;\n } else {\n interimText += alternative;\n }\n }\n if (finalText.trim()) onFinalizeRef.current(finalText.trim());\n setInterim(interimText.trim());\n };\n\n recognition.onerror = (event) => {\n if (session !== sessionRef.current) return;\n const mapped = toVoiceInputError(event.error);\n // 'no-speech' fires routinely during a natural pause and the recogniser\n // keeps running — surfacing it would flash a scary message mid-sentence.\n if (mapped !== 'no-speech') setError(mapped);\n };\n\n recognition.onend = () => {\n if (session !== sessionRef.current) return;\n recognitionRef.current = null;\n setIsListening(false);\n setInterim('');\n };\n\n /**\n * ★ The TRUE capture signal.\n *\n * This was set optimistically on the line after `start()` returned — which\n * is synchronous, and says only that the request was accepted, not that the\n * microphone is open. Everything downstream then believed capture had begun\n * while the permission prompt was still up: the stage showed \"Listening…\"\n * over a microphone that could not yet hear, so a user who started talking\n * immediately lost the first word or two; the `connecting` stage lasted a\n * single commit; and the 5s \"we aren't hearing your microphone\" notice\n * could never fire, because `capturing` was already true.\n */\n recognition.onstart = () => {\n if (session !== sessionRef.current) return;\n setIsListening(true);\n };\n\n try {\n recognition.start();\n } catch {\n // start() throws if a recogniser is somehow already running — treat the\n // session as not started rather than leaving the button stuck \"live\".\n recognitionRef.current = null;\n setIsListening(false);\n return;\n }\n\n recognitionRef.current = recognition;\n setError(null);\n setInterim('');\n }, [language]);\n\n const stop = useCallback(() => {\n // Detach BEFORE stopping. `onend` is what used to clear this ref, but it\n // arrives asynchronously — so a user who tapped stop and immediately tapped\n // the mic again hit `start()`'s `if (recognitionRef.current) return` guard\n // and got a silent no-op. Bumping the session also makes any trailing final\n // phrase the engine flushes on stop land on a dead session, instead of\n // reappearing in a draft the composer has already sent and cleared.\n const recognition = recognitionRef.current;\n recognitionRef.current = null;\n sessionRef.current += 1;\n recognition?.stop();\n setIsListening(false);\n setInterim('');\n }, []);\n\n // Changing language must END the session it no longer describes.\n //\n // A running recogniser keeps the `lang` it was constructed with, so after a\n // switch the in-flight session is still listening in the OLD language while\n // this hook already reports the new one. A late `language-not-supported` from\n // that session would then be rendered as though the browser had rejected the\n // language the user just picked. Clearing the error is not enough — the\n // session producing it has to go too.\n const languageRef = useRef(language);\n useEffect(() => {\n if (languageRef.current === language) return;\n languageRef.current = language;\n stop();\n setError(null);\n }, [language, stop]);\n\n const toggle = useCallback(() => {\n if (isListening) stop();\n else start();\n }, [isListening, start, stop]);\n\n const clearError = useCallback(() => setError(null), []);\n\n return { isSupported, isListening, interim, error, language, start, stop, toggle, clearError };\n}\n"],"mappings":";;;AAyEA,IAAM,IAA2C;CAC/C,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,SAAS,IAAuE;CAC9E,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAM,IAAM;CACZ,OACG,EAAI,qBACJ,EAAI,2BACL;AAEJ;AAgBA,SAAS,EAAkB,GAA+B;CACxD,QAAQ,GAAR;EACE,KAAK;EACL,KAAK,uBACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,iBACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,KAAK,0BACH,OAAO;EACT,SACE,OAAO;CACX;AACF;AAuCA,SAAgB,EAAc,EAAE,eAAY,UAAU,KAAwD;CAC5G,IAAM,EAAE,cAAW,EAAQ,GACrB,CAAC,GAAa,KAAkB,EAAS,EAAK,GAC9C,CAAC,GAAS,KAAc,EAAS,EAAE,GACnC,CAAC,GAAO,KAAY,EAAiC,IAAI,GACzD,IAAiB,EAAyC,IAAI,GAG9D,IAAa,EAAO,CAAC,GAIrB,IAAgB,EAAO,CAAU;CACvC,QAAgB;EACd,EAAc,UAAU;CAC1B,GAAG,CAAC,CAAU,CAAC;CAEf,IAAM,IAAc,EAAgC,MAAM,MACpD,IAAW,KAAa,EAAiB,MAAW;CAI1D,cACe;EAEX,AADA,EAAe,SAAS,MAAM,GAC9B,EAAe,UA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