@burdenoff/fe-libs 2026.1001.2 → 2026.1001.4
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/shared/assistant/conversationDeleteCommand.d.ts +31 -0
- package/dist/shared/assistant/conversationDeleteCommand.d.ts.map +1 -0
- package/dist/shared/assistant/conversationDeleteCommand.js +14 -0
- package/dist/shared/assistant/history/historyControls.d.ts +9 -0
- package/dist/shared/assistant/history/historyControls.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyControls.js +7 -1
- package/dist/shared/assistant/history/historyList.d.ts +10 -0
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyList.js +33 -28
- package/dist/shared/assistant/history/useHistoryRowControls.d.ts +13 -0
- package/dist/shared/assistant/history/useHistoryRowControls.d.ts.map +1 -0
- package/dist/shared/assistant/history/useHistoryRowControls.js +24 -0
- package/dist/shared/assistant/i18nManifest.d.ts +36 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +36 -0
- package/dist/shared/assistant/index.d.ts +6 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.d.ts +8 -0
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.js +20 -19
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +67 -66
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +978 -891
- package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts +12 -0
- package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantConversationFilters.js +92 -0
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts +9 -0
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +314 -214
- package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.d.ts +59 -0
- package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.js +84 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +18 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantHistoryNotices.js +76 -29
- package/dist/shared/assistant/ui/conversationDelete.d.ts +18 -0
- package/dist/shared/assistant/ui/conversationDelete.d.ts.map +1 -0
- package/dist/shared/assistant/ui/conversationDelete.js +16 -0
- package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts +32 -0
- package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/conversationDeleteDialog.js +54 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +5 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +129 -121
- package/dist/shared/assistant/voice/turnVisibility.d.ts +9 -0
- package/dist/shared/assistant/voice/turnVisibility.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceReopen.d.ts +134 -11
- package/dist/shared/assistant/voice/voiceReopen.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceReopen.js +83 -25
- package/dist/shared/assistant/voice/voiceSession.d.ts +10 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +6 -0
- package/dist/shared-assistant.js +170 -164
- package/package.json +1 -1
|
@@ -1,344 +1,444 @@
|
|
|
1
1
|
import { useAssistantProduct as e } from "../product.js";
|
|
2
2
|
import { useAssistantTr as t } from "../i18n.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
3
|
+
import { DEFAULT_HISTORY_LIST_FILTER as n, clampToCodePoints as r, codePointLength as i, historyFilterEmptyKind as a, historyFilterKey as o } from "../history/historyControls.js";
|
|
4
|
+
import { useAssistantStore as s } from "../store.js";
|
|
5
|
+
import { chatTurns as c, voiceTurnsOnly as l } from "../voice/turnVisibility.js";
|
|
6
|
+
import { getAssistantDisplayContent as u } from "../displayContent.js";
|
|
7
|
+
import { useOverlayFocus as d } from "./useOverlayFocus.js";
|
|
8
|
+
import { AssistantHistoryPinLimitBanner as f, AssistantHistoryUnsavedDeleteNotice as p } from "./AssistantHistoryNotices.js";
|
|
9
|
+
import { historyRowAcceptsControls as ee, selectAssistantHistoryList as te } from "../history/historyList.js";
|
|
10
|
+
import { useAssistantHistoryStatus as m } from "../history/historyStatus.js";
|
|
11
|
+
import { useAssistantHistoryStore as h } from "../history/historyStore.js";
|
|
12
|
+
import { assistantHistory as g } from "../history/historyEngine.js";
|
|
13
|
+
import { AssistantConversationFilters as ne } from "./AssistantConversationFilters.js";
|
|
14
|
+
import { useEffect as re, useId as ie, useLayoutEffect as ae, useMemo as oe, useRef as _, useState as v } from "react";
|
|
15
|
+
import { Archive as y, ArchiveRestore as se, Check as ce, MessageSquare as le, PanelLeftClose as ue, Pencil as de, Pin as fe, PinOff as pe, Plus as me, Trash2 as he } from "lucide-react";
|
|
16
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
15
17
|
//#region src/shared/assistant/ui/AssistantConversationList.tsx
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
var ge = {
|
|
19
|
+
channel: "ANY",
|
|
20
|
+
pinned: null,
|
|
21
|
+
archived: "INCLUDE"
|
|
22
|
+
}, _e = (e) => `group relative px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${e ? "bg-bg-elevated border-l-2 border-action-primary-bg" : ""}`, ve = ({ active: e, title: t, onOpen: n, details: r, actions: i, openRef: a, actionRef: o, testId: s }) => {
|
|
23
|
+
let c = ie(), l = `${c}-title`, u = `${c}-details`;
|
|
24
|
+
return /* @__PURE__ */ S("div", {
|
|
25
|
+
className: _e(e),
|
|
26
|
+
"data-testid": s,
|
|
27
|
+
children: [/* @__PURE__ */ S("div", {
|
|
22
28
|
className: "flex items-center justify-between",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ x("button", {
|
|
24
30
|
ref: a,
|
|
25
31
|
type: "button",
|
|
26
32
|
onClick: n,
|
|
27
33
|
"aria-current": e ? "true" : void 0,
|
|
28
|
-
"aria-describedby":
|
|
34
|
+
"aria-describedby": u,
|
|
29
35
|
className: "flex-1 min-w-0 text-left cursor-pointer focus:outline-none after:absolute after:inset-0 focus-visible:after:outline-2 focus-visible:after:outline-solid focus-visible:after:-outline-offset-2 focus-visible:after:outline-[var(--color-focus-ring)]",
|
|
30
36
|
"data-testid": "open-conversation",
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
id:
|
|
37
|
+
children: /* @__PURE__ */ x("span", {
|
|
38
|
+
id: l,
|
|
33
39
|
className: "block text-xs font-medium text-text-primary truncate",
|
|
34
40
|
children: t
|
|
35
41
|
})
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
-
className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only",
|
|
38
|
-
children: /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ x("div", {
|
|
43
|
+
className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only [@media(pointer:coarse)]:not-sr-only",
|
|
44
|
+
children: /* @__PURE__ */ x("div", {
|
|
39
45
|
className: "relative z-10 flex items-center gap-0.5 ml-1",
|
|
40
|
-
children: i.map((e) => /* @__PURE__ */
|
|
46
|
+
children: i.map((e) => /* @__PURE__ */ x("button", {
|
|
47
|
+
ref: o(e.id),
|
|
41
48
|
type: "button",
|
|
42
49
|
onClick: e.onActivate,
|
|
43
|
-
className: "p-0.5 hover:bg-bg-sunken rounded",
|
|
50
|
+
className: "p-0.5 [@media(pointer:coarse)]:p-1.5 hover:bg-bg-sunken rounded",
|
|
44
51
|
"aria-label": e.label,
|
|
45
|
-
"aria-describedby":
|
|
52
|
+
"aria-describedby": l,
|
|
46
53
|
"data-testid": e.testId,
|
|
47
54
|
children: e.icon
|
|
48
|
-
}, e.
|
|
55
|
+
}, e.id))
|
|
49
56
|
})
|
|
50
57
|
})]
|
|
51
|
-
}), /* @__PURE__ */
|
|
52
|
-
id:
|
|
58
|
+
}), /* @__PURE__ */ x("div", {
|
|
59
|
+
id: u,
|
|
53
60
|
children: r
|
|
54
61
|
})]
|
|
55
62
|
});
|
|
56
|
-
},
|
|
63
|
+
}, ye = (e, t) => {
|
|
57
64
|
let n = [];
|
|
58
65
|
for (let r = 1; r < e.length; r += 1) {
|
|
59
66
|
let i = e[t + r], a = t - r >= 0 ? e[t - r] : void 0;
|
|
60
67
|
i !== void 0 && n.push(i), a !== void 0 && n.push(a);
|
|
61
68
|
}
|
|
62
69
|
return n;
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
P,
|
|
70
|
+
}, C = () => {
|
|
71
|
+
let C = t(), { modes: be } = e(), { conversations: w, activeConversationId: T, processingByConversationId: xe, setActiveConversation: Se, setMode: Ce, createConversation: we, deleteConversation: Te, renameConversation: Ee, setConversationListOpen: E } = s(), [D, O] = v(null), [k, A] = v(""), [j, M] = v(!1), De = ie(), N = m((e) => e.product !== null), P = m((e) => e.scopeKey), F = m((e) => e.loadingIds), I = m((e) => e.olderHeaders), Oe = m((e) => e.unsavedDelete !== void 0), ke = m((e) => e.controlsAvailable), L = N && ke, Ae = m((e) => e.pinLimit), R = h((e) => P === null ? void 0 : e.scopes[P]), je = h((e) => e.tombstones), z = h((e) => e.outbox), [B, Me] = v(n), [Ne, Pe] = v(!1), Fe = L ? B : ge, Ie = (e) => {
|
|
72
|
+
Me(e), Pe(!0);
|
|
73
|
+
}, V = oe(() => N ? te({
|
|
74
|
+
conversations: w,
|
|
75
|
+
scopeKey: P,
|
|
76
|
+
headers: R?.headers ?? {},
|
|
77
|
+
olderHeaders: I && I.scopeKey === P ? I.headers : void 0,
|
|
78
|
+
tombstones: je,
|
|
79
|
+
loadingIds: F,
|
|
80
|
+
outbox: z
|
|
81
|
+
}, Fe) : null, [
|
|
76
82
|
N,
|
|
83
|
+
w,
|
|
84
|
+
P,
|
|
85
|
+
R,
|
|
86
|
+
I,
|
|
87
|
+
je,
|
|
77
88
|
F,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
z,
|
|
90
|
+
Fe
|
|
91
|
+
]), Le = L ? B : void 0, Re = o(Le), H = I && I.scopeKey === P ? I : void 0, U = H ? H.filterKey === Re ? H.hasMore : !0 : R?.hasOlderHeaders === !0, W = oe(() => V ? [...V.workspace.map((e) => e.key), ...V.device.map((e) => e.id)] : w.map((e) => e.id), [V, w]);
|
|
92
|
+
re(() => {
|
|
93
|
+
N && g.notePanelOpened();
|
|
94
|
+
}, [N]);
|
|
95
|
+
let ze = () => {
|
|
96
|
+
we(), E(!1);
|
|
97
|
+
}, Be = (e) => {
|
|
98
|
+
if (N) {
|
|
99
|
+
g.openConversation(e, { modes: be }), E(!1);
|
|
88
100
|
return;
|
|
89
101
|
}
|
|
90
|
-
let t =
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
t ?
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
let t = w.find((t) => t.id === e);
|
|
103
|
+
Se(e), t && Ce(t.mode), E(!1);
|
|
104
|
+
}, G = _(/* @__PURE__ */ new Map()), Ve = (e) => (t) => {
|
|
105
|
+
t ? G.current.set(e, t) : G.current.delete(e);
|
|
106
|
+
}, K = _(/* @__PURE__ */ new Map()), He = (e) => (t) => (n) => {
|
|
107
|
+
let r = `${e}\u0000${t}`;
|
|
108
|
+
n ? K.current.set(r, n) : K.current.delete(r);
|
|
109
|
+
}, q = _(null), J = _(null), Ue = _(null), We = _(null), Ge = (e, t) => {
|
|
110
|
+
O(e), A(r(t, 80)), M(!1);
|
|
111
|
+
}, Ke = (e) => {
|
|
112
|
+
A(r(e, 80)), M(i(e) > 80);
|
|
113
|
+
}, qe = () => {
|
|
114
|
+
D && k.trim() && Ee(D, k), D && (q.current = {
|
|
98
115
|
kind: "renamed",
|
|
99
|
-
key:
|
|
100
|
-
}),
|
|
101
|
-
},
|
|
102
|
-
|
|
116
|
+
key: D
|
|
117
|
+
}), O(null), M(!1);
|
|
118
|
+
}, Je = (e) => {
|
|
119
|
+
q.current = {
|
|
103
120
|
kind: "deleted",
|
|
104
121
|
key: e,
|
|
105
|
-
before:
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
before: W
|
|
123
|
+
}, N ? g.deleteConversation(e) : Te(e);
|
|
124
|
+
}, Ye = (e, t, n) => {
|
|
125
|
+
q.current = {
|
|
126
|
+
kind: "control",
|
|
127
|
+
key: e,
|
|
128
|
+
control: t,
|
|
129
|
+
before: W
|
|
130
|
+
}, g.updateConversation(e, n) || (q.current = null);
|
|
131
|
+
}, Y = C("history.untitled", "Untitled conversation"), X = "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded", Xe = (e) => e === 1 ? C("conversationList.messageCountOne", "1 message") : C("conversationList.messageCount", "{{count}} messages", { count: e }), Ze = (e) => e === 1 ? C("conversationList.spokenCountOne", "1 spoken") : C("conversationList.spokenCount", "{{count}} spoken", { count: e }), Qe = (e, t) => /* @__PURE__ */ S("div", {
|
|
132
|
+
className: _e(t),
|
|
133
|
+
children: [/* @__PURE__ */ S("div", {
|
|
134
|
+
className: "flex items-center gap-1",
|
|
135
|
+
children: [/* @__PURE__ */ x("input", {
|
|
136
|
+
ref: J,
|
|
137
|
+
"aria-label": C("conversations.renameLabel", "Conversation title"),
|
|
138
|
+
"aria-describedby": j ? De : void 0,
|
|
139
|
+
value: k,
|
|
140
|
+
onChange: (e) => Ke(e.target.value),
|
|
141
|
+
onKeyDown: (t) => {
|
|
142
|
+
t.key === "Enter" && (t.preventDefault(), qe()), t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), O(null), M(!1), q.current = {
|
|
143
|
+
kind: "renamed",
|
|
144
|
+
key: e
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
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"
|
|
148
|
+
}), /* @__PURE__ */ x("button", {
|
|
149
|
+
type: "button",
|
|
150
|
+
onClick: qe,
|
|
151
|
+
className: "p-1 hover:bg-bg-sunken rounded",
|
|
152
|
+
"aria-label": C("conversations.saveTitle", "Save title"),
|
|
153
|
+
children: /* @__PURE__ */ x(ce, { className: "size-3 text-status-success-text" })
|
|
154
|
+
})]
|
|
155
|
+
}), /* @__PURE__ */ x("p", {
|
|
156
|
+
id: De,
|
|
157
|
+
role: "status",
|
|
158
|
+
className: "text-[10px] text-text-muted",
|
|
159
|
+
children: j ? C("conversations.titleLimit", "Titles are up to {{limit}} characters", { limit: 80 }) : ""
|
|
160
|
+
})]
|
|
161
|
+
}, e), $e = (e) => {
|
|
162
|
+
let t = L && ee(e, z, P), n = e.pinnedAt !== null, r = e.archivedAt !== null, i = [];
|
|
163
|
+
return t && !r && i.push({
|
|
164
|
+
id: "pin",
|
|
165
|
+
label: n ? C("conversations.unpin", "Unpin conversation") : C("conversations.pin", "Pin conversation"),
|
|
166
|
+
icon: x(n ? pe : fe, { className: "size-3 text-text-muted" }),
|
|
167
|
+
onActivate: () => Ye(e.key, "pin", { pinned: !n }),
|
|
168
|
+
testId: "pin-conversation"
|
|
169
|
+
}), (e.conversation || t) && i.push({
|
|
170
|
+
id: "rename",
|
|
171
|
+
label: C("conversations.rename", "Rename conversation"),
|
|
172
|
+
icon: /* @__PURE__ */ x(de, { className: "size-3 text-text-muted" }),
|
|
173
|
+
onActivate: () => Ge(e.key, e.title),
|
|
174
|
+
testId: "rename-conversation"
|
|
175
|
+
}), t && i.push({
|
|
176
|
+
id: "archive",
|
|
177
|
+
label: r ? C("conversations.unarchive", "Unarchive conversation") : C("conversations.archive", "Archive conversation"),
|
|
178
|
+
icon: x(r ? se : y, { className: "size-3 text-text-muted" }),
|
|
179
|
+
onActivate: () => Ye(e.key, "archive", { archived: !r }),
|
|
180
|
+
testId: "archive-conversation"
|
|
181
|
+
}), i.push({
|
|
182
|
+
id: "delete",
|
|
183
|
+
label: C("conversations.delete", "Delete conversation"),
|
|
184
|
+
icon: /* @__PURE__ */ x(he, { className: "size-3 text-status-error-text" }),
|
|
185
|
+
onActivate: () => Je(e.key),
|
|
186
|
+
testId: "delete-conversation"
|
|
187
|
+
}), i;
|
|
188
|
+
}, et = (e) => [{
|
|
189
|
+
id: "rename",
|
|
190
|
+
label: C("conversations.rename", "Rename conversation"),
|
|
191
|
+
icon: /* @__PURE__ */ x(de, { className: "size-3 text-text-muted" }),
|
|
192
|
+
onActivate: () => Ge(e.id, e.title),
|
|
193
|
+
testId: "rename-conversation"
|
|
194
|
+
}, {
|
|
195
|
+
id: "delete",
|
|
196
|
+
label: C("conversations.delete", "Delete conversation"),
|
|
197
|
+
icon: /* @__PURE__ */ x(he, { className: "size-3 text-status-error-text" }),
|
|
198
|
+
onActivate: () => Je(e.id),
|
|
199
|
+
testId: "delete-conversation"
|
|
200
|
+
}], Z = (e, t) => {
|
|
201
|
+
let n = e.id === T, r = e.id === D, i = be.find((t) => t.id === e.mode), a = c(e.messages), o = l(e.messages), s = a[a.length - 1], d = a.length === 0 && e.messages.length > 0, f = xe[e.id], p = s ? u(s, f, C).text.slice(0, 60) : "";
|
|
202
|
+
return r ? Qe(e.id, n) : /* @__PURE__ */ x(ve, {
|
|
134
203
|
active: n,
|
|
135
204
|
title: (t ? t.title : e.title) || Y,
|
|
136
|
-
onOpen: () =>
|
|
137
|
-
openRef:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
label: f("conversations.delete", "Delete conversation"),
|
|
144
|
-
icon: /* @__PURE__ */ y(_, { className: "size-3 text-status-error-text" }),
|
|
145
|
-
onActivate: () => J(e.id),
|
|
146
|
-
testId: "delete-conversation"
|
|
147
|
-
}],
|
|
148
|
-
details: /* @__PURE__ */ b(v, { children: [
|
|
149
|
-
/* @__PURE__ */ b("div", {
|
|
150
|
-
className: "flex items-center gap-1.5 mt-0.5",
|
|
205
|
+
onOpen: () => Be(e.id),
|
|
206
|
+
openRef: Ve(e.id),
|
|
207
|
+
actionRef: He(e.id),
|
|
208
|
+
actions: t ? t.actions : et(e),
|
|
209
|
+
details: /* @__PURE__ */ S(b, { children: [
|
|
210
|
+
/* @__PURE__ */ S("div", {
|
|
211
|
+
className: "flex flex-wrap items-center gap-1.5 mt-0.5",
|
|
151
212
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
className:
|
|
154
|
-
children:
|
|
213
|
+
/* @__PURE__ */ x("span", {
|
|
214
|
+
className: X,
|
|
215
|
+
children: i?.label ?? e.mode
|
|
155
216
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ x("span", {
|
|
157
218
|
className: "text-[10px] text-text-muted",
|
|
158
|
-
children:
|
|
219
|
+
children: Xe(a.length)
|
|
159
220
|
}),
|
|
160
|
-
|
|
221
|
+
o.length > 0 ? /* @__PURE__ */ x("span", {
|
|
222
|
+
className: "text-[10px] text-text-muted",
|
|
223
|
+
"data-testid": "history-spoken-count",
|
|
224
|
+
children: Ze(o.length)
|
|
225
|
+
}) : null,
|
|
226
|
+
f && f.status !== "idle" && /* @__PURE__ */ x("span", {
|
|
161
227
|
className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
|
|
162
|
-
children:
|
|
228
|
+
children: f.status
|
|
163
229
|
}),
|
|
164
230
|
t?.badges
|
|
165
231
|
]
|
|
166
232
|
}),
|
|
167
233
|
t?.note,
|
|
168
|
-
|
|
234
|
+
p && /* @__PURE__ */ x("p", {
|
|
169
235
|
className: "text-[10px] text-text-muted truncate mt-0.5",
|
|
170
|
-
children:
|
|
236
|
+
children: p
|
|
171
237
|
}),
|
|
172
|
-
|
|
238
|
+
d && /* @__PURE__ */ x("p", {
|
|
173
239
|
className: "text-[10px] text-text-muted truncate mt-0.5",
|
|
174
|
-
children:
|
|
240
|
+
children: C("conversationList.voiceOnly", "Spoken conversation")
|
|
175
241
|
})
|
|
176
242
|
] })
|
|
177
243
|
}, e.id);
|
|
178
|
-
},
|
|
179
|
-
let t =
|
|
180
|
-
return /* @__PURE__ */ b
|
|
181
|
-
e.
|
|
182
|
-
className:
|
|
244
|
+
}, tt = (e) => e.blocked === "quota" ? C("history.notSavedQuota", "Not saved yet: this workspace has reached its conversation limit. It will be saved when there is room.") : e.blocked === "invalid" ? C("history.notSavedInvalid", "Part of this conversation couldn't be saved. It stays on this device.") : e.blocked === "scope" ? C("history.notSavedScope", "Some turns were sent from another workspace. They stay on this device.") : null, nt = (e) => {
|
|
245
|
+
let t = tt(e);
|
|
246
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
247
|
+
e.channel === "VOICE" ? /* @__PURE__ */ x("span", {
|
|
248
|
+
className: X,
|
|
249
|
+
"data-testid": "history-badge-voice",
|
|
250
|
+
children: C("conversationList.badgeVoice", "Voice")
|
|
251
|
+
}) : e.channel === "MIXED" ? /* @__PURE__ */ x("span", {
|
|
252
|
+
className: X,
|
|
253
|
+
"data-testid": "history-badge-mixed",
|
|
254
|
+
children: C("conversationList.badgeMixed", "Chat + voice")
|
|
255
|
+
}) : null,
|
|
256
|
+
e.pinnedAt === null ? null : /* @__PURE__ */ S("span", {
|
|
257
|
+
className: `${X} inline-flex items-center gap-0.5`,
|
|
258
|
+
"data-testid": "history-badge-pinned",
|
|
259
|
+
children: [/* @__PURE__ */ x(fe, {
|
|
260
|
+
className: "size-2.5",
|
|
261
|
+
"aria-hidden": "true"
|
|
262
|
+
}), C("conversationList.badgePinned", "Pinned")]
|
|
263
|
+
}),
|
|
264
|
+
e.archivedAt === null ? null : /* @__PURE__ */ S("span", {
|
|
265
|
+
className: `${X} inline-flex items-center gap-0.5`,
|
|
266
|
+
"data-testid": "history-badge-archived",
|
|
267
|
+
children: [/* @__PURE__ */ x(y, {
|
|
268
|
+
className: "size-2.5",
|
|
269
|
+
"aria-hidden": "true"
|
|
270
|
+
}), C("conversationList.badgeArchived", "Archived")]
|
|
271
|
+
}),
|
|
272
|
+
e.legacy ? /* @__PURE__ */ x("span", {
|
|
273
|
+
className: X,
|
|
183
274
|
"data-testid": "history-badge-read-only",
|
|
184
|
-
children:
|
|
275
|
+
children: C("history.badgeReadOnly", "Read-only")
|
|
185
276
|
}) : null,
|
|
186
|
-
|
|
187
|
-
className:
|
|
277
|
+
t === null ? null : /* @__PURE__ */ x("span", {
|
|
278
|
+
className: X,
|
|
188
279
|
"data-testid": "history-badge-not-saved",
|
|
189
|
-
children:
|
|
280
|
+
children: C("history.badgeNotSaved", "Not saved")
|
|
190
281
|
}),
|
|
191
|
-
e.loading ? /* @__PURE__ */
|
|
192
|
-
className:
|
|
282
|
+
e.loading ? /* @__PURE__ */ x("span", {
|
|
283
|
+
className: X,
|
|
193
284
|
"data-testid": "history-badge-loading",
|
|
194
|
-
children:
|
|
285
|
+
children: C("history.badgeLoading", "Loading…")
|
|
195
286
|
}) : null
|
|
196
287
|
] });
|
|
197
|
-
},
|
|
198
|
-
let t =
|
|
199
|
-
return t === null ? null : /* @__PURE__ */
|
|
288
|
+
}, rt = (e) => {
|
|
289
|
+
let t = tt(e);
|
|
290
|
+
return t === null ? null : /* @__PURE__ */ x("p", {
|
|
200
291
|
className: "text-[10px] text-text-muted break-words mt-0.5",
|
|
201
292
|
"data-testid": "history-not-saved-reason",
|
|
202
293
|
children: t
|
|
203
294
|
});
|
|
204
|
-
},
|
|
205
|
-
active: e.key ===
|
|
295
|
+
}, it = (e) => e.key === D ? Qe(e.key, e.key === T) : /* @__PURE__ */ x(ve, {
|
|
296
|
+
active: e.key === T,
|
|
206
297
|
title: e.title || Y,
|
|
207
|
-
onOpen: () =>
|
|
208
|
-
openRef:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}],
|
|
215
|
-
details: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
|
|
216
|
-
className: "flex items-center gap-1.5 mt-0.5",
|
|
217
|
-
children: he(e)
|
|
218
|
-
}), ge(e)] }),
|
|
298
|
+
onOpen: () => Be(e.key),
|
|
299
|
+
openRef: Ve(e.key),
|
|
300
|
+
actionRef: He(e.key),
|
|
301
|
+
actions: $e(e),
|
|
302
|
+
details: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
|
|
303
|
+
className: "flex flex-wrap items-center gap-1.5 mt-0.5",
|
|
304
|
+
children: nt(e)
|
|
305
|
+
}), rt(e)] }),
|
|
219
306
|
testId: "history-server-row"
|
|
220
|
-
}, e.key),
|
|
307
|
+
}, e.key), at = (e) => /* @__PURE__ */ x("h3", {
|
|
221
308
|
className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",
|
|
222
309
|
children: e
|
|
223
|
-
}),
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
}, [
|
|
227
|
-
let e =
|
|
228
|
-
if (!e || (e.kind === "deleted" ?
|
|
229
|
-
|
|
310
|
+
}), ot = V ? V.workspace.length + V.device.length : w.length, st = V ? ot === 0 && !U : w.length === 0, Q = L ? a(B) : null, ct = Q === "archived" ? C("conversationList.emptyArchived", "No archived conversations") : Q === "pinned" ? C("conversationList.emptyPinned", "No pinned conversations") : Q === "voice" ? C("conversationList.emptyVoice", "No voice conversations") : Q === "chat" ? C("conversationList.emptyChat", "No chat conversations") : C("conversations.empty", "No conversations yet"), $ = d("assistant-open-history");
|
|
311
|
+
return ae(() => {
|
|
312
|
+
D !== null && J.current?.focus({ preventScroll: !0 });
|
|
313
|
+
}, [D]), ae(() => {
|
|
314
|
+
let e = q.current;
|
|
315
|
+
if (!e || (e.kind === "deleted" ? W.includes(e.key) : e.kind === "renamed" ? D === e.key : e.kind !== "control" && U)) return;
|
|
316
|
+
q.current = null;
|
|
230
317
|
let t = document.activeElement;
|
|
231
318
|
if (t && t !== document.body) return;
|
|
232
|
-
let n;
|
|
319
|
+
let n, r = e.kind === "control" && W.includes(e.key) ? K.current.get(`${e.key}\u0000${e.control}`) : void 0;
|
|
233
320
|
if (e.kind === "renamed") n = [e.key];
|
|
234
|
-
else if (e.kind === "
|
|
321
|
+
else if (e.kind === "control") n = W.includes(e.key) ? [e.key] : [...ye(e.before, e.before.indexOf(e.key)), ...W];
|
|
322
|
+
else if (e.kind === "deleted") n = [...ye(e.before, e.before.indexOf(e.key)), ...W];
|
|
235
323
|
else {
|
|
236
|
-
let t =
|
|
324
|
+
let t = I && I.scopeKey === P ? I.headers : {}, r = new Set(e.before), i = V?.workspace ?? [];
|
|
237
325
|
n = [
|
|
238
|
-
...
|
|
326
|
+
...W.filter((e) => !r.has(e) && e in t),
|
|
239
327
|
i[i.length - 1]?.key,
|
|
240
|
-
...
|
|
328
|
+
...W
|
|
241
329
|
];
|
|
242
330
|
}
|
|
243
|
-
(n.map((e) => e === void 0 ? void 0 : e ===
|
|
331
|
+
(r ?? n.map((e) => e === void 0 ? void 0 : e === D ? J.current ?? void 0 : G.current.get(e)).find((e) => e !== void 0) ?? Ue.current ?? We.current ?? $.current)?.focus({ preventScroll: !0 });
|
|
244
332
|
}, [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
N,
|
|
249
|
-
j,
|
|
333
|
+
W,
|
|
334
|
+
D,
|
|
335
|
+
U,
|
|
250
336
|
I,
|
|
337
|
+
P,
|
|
338
|
+
V,
|
|
251
339
|
$
|
|
252
|
-
]), /* @__PURE__ */
|
|
340
|
+
]), /* @__PURE__ */ S("div", {
|
|
253
341
|
ref: $,
|
|
254
342
|
tabIndex: -1,
|
|
255
343
|
role: "region",
|
|
256
|
-
"aria-label":
|
|
344
|
+
"aria-label": C("conversations.title", "History"),
|
|
257
345
|
className: "absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-left-2 fade-in duration-200",
|
|
258
346
|
"data-testid": "conversation-list",
|
|
259
347
|
children: [
|
|
260
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ S("div", {
|
|
261
349
|
className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ x("span", {
|
|
263
351
|
className: "text-[13px] font-semibold text-text-primary",
|
|
264
|
-
children:
|
|
265
|
-
}), /* @__PURE__ */
|
|
352
|
+
children: C("conversations.title", "History")
|
|
353
|
+
}), /* @__PURE__ */ S("div", {
|
|
266
354
|
className: "flex items-center gap-0.5",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ x("button", {
|
|
268
356
|
type: "button",
|
|
269
|
-
onClick:
|
|
357
|
+
onClick: ze,
|
|
270
358
|
className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
|
|
271
|
-
"aria-label":
|
|
359
|
+
"aria-label": C("conversations.new", "New conversation"),
|
|
272
360
|
"data-testid": "new-conversation",
|
|
273
|
-
children: /* @__PURE__ */
|
|
274
|
-
}), /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ x(me, { className: "size-4" })
|
|
362
|
+
}), /* @__PURE__ */ S("button", {
|
|
275
363
|
type: "button",
|
|
276
|
-
onClick: () =>
|
|
364
|
+
onClick: () => E(!1),
|
|
277
365
|
className: "flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
|
|
278
|
-
"aria-label":
|
|
366
|
+
"aria-label": C("conversations.collapse", "Collapse history"),
|
|
279
367
|
"data-testid": "collapse-conversation-list",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ x(ue, { className: "size-4" }), /* @__PURE__ */ x("span", {
|
|
281
369
|
className: "text-[11px] font-medium",
|
|
282
|
-
children:
|
|
370
|
+
children: C("conversations.collapseLabel", "Collapse")
|
|
283
371
|
})]
|
|
284
372
|
})]
|
|
285
373
|
})]
|
|
286
374
|
}),
|
|
287
|
-
|
|
288
|
-
/* @__PURE__ */
|
|
375
|
+
N && Oe ? /* @__PURE__ */ x(p, {}) : null,
|
|
376
|
+
N && Ae ? /* @__PURE__ */ x(f, {
|
|
377
|
+
limit: Ae.limit,
|
|
378
|
+
onDismiss: () => m.getState().notePinLimit(void 0)
|
|
379
|
+
}) : null,
|
|
380
|
+
L ? /* @__PURE__ */ x(ne, {
|
|
381
|
+
filter: B,
|
|
382
|
+
onChange: Ie,
|
|
383
|
+
count: ot,
|
|
384
|
+
announce: Ne
|
|
385
|
+
}) : null,
|
|
386
|
+
/* @__PURE__ */ x("div", {
|
|
289
387
|
className: "scrollbar-slim flex-1 overflow-y-auto",
|
|
290
|
-
children:
|
|
388
|
+
children: st ? /* @__PURE__ */ S("div", {
|
|
291
389
|
className: "flex flex-col items-center justify-center h-full text-center px-4",
|
|
390
|
+
"data-testid": "history-empty",
|
|
292
391
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ x(le, { className: "size-6 text-text-muted mb-2" }),
|
|
393
|
+
/* @__PURE__ */ x("p", {
|
|
295
394
|
className: "text-xs text-text-muted",
|
|
296
|
-
children:
|
|
395
|
+
children: ct
|
|
297
396
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
ref:
|
|
397
|
+
Q === null ? /* @__PURE__ */ x("button", {
|
|
398
|
+
ref: We,
|
|
300
399
|
type: "button",
|
|
301
|
-
onClick:
|
|
400
|
+
onClick: ze,
|
|
302
401
|
className: "mt-2 text-xs text-action-primary-bg hover:underline",
|
|
303
|
-
children:
|
|
304
|
-
})
|
|
402
|
+
children: C("conversations.startNew", "Start a new conversation")
|
|
403
|
+
}) : null
|
|
305
404
|
]
|
|
306
|
-
}) :
|
|
405
|
+
}) : V ? /* @__PURE__ */ S("div", {
|
|
307
406
|
className: "py-1",
|
|
308
|
-
children: [
|
|
407
|
+
children: [V.workspace.length > 0 || U ? /* @__PURE__ */ S("section", {
|
|
309
408
|
"data-testid": "history-group-workspace",
|
|
310
409
|
children: [
|
|
311
|
-
|
|
312
|
-
|
|
410
|
+
at(C("history.groupWorkspace", "This workspace")),
|
|
411
|
+
V.workspace.map((e) => e.conversation ? Z(e.conversation, {
|
|
313
412
|
title: e.title || Y,
|
|
314
|
-
badges:
|
|
315
|
-
note:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
413
|
+
badges: nt(e),
|
|
414
|
+
note: rt(e),
|
|
415
|
+
actions: $e(e)
|
|
416
|
+
}) : it(e)),
|
|
417
|
+
U ? /* @__PURE__ */ x("button", {
|
|
418
|
+
ref: Ue,
|
|
319
419
|
type: "button",
|
|
320
420
|
onClick: () => {
|
|
321
|
-
|
|
421
|
+
q.current = {
|
|
322
422
|
kind: "older",
|
|
323
|
-
before:
|
|
324
|
-
},
|
|
423
|
+
before: W
|
|
424
|
+
}, g.loadOlderHeaders(Le);
|
|
325
425
|
},
|
|
326
426
|
className: "mx-3 my-1 text-xs text-action-primary-bg hover:underline",
|
|
327
427
|
"data-testid": "history-show-older",
|
|
328
|
-
children:
|
|
428
|
+
children: C("history.showOlder", "Show older conversations")
|
|
329
429
|
}) : null
|
|
330
430
|
]
|
|
331
|
-
}) : null,
|
|
431
|
+
}) : null, V.device.length > 0 ? /* @__PURE__ */ S("section", {
|
|
332
432
|
"data-testid": "history-group-device",
|
|
333
|
-
children: [
|
|
433
|
+
children: [at(C("history.groupDevice", "On this device")), V.device.map((e) => Z(e))]
|
|
334
434
|
}) : null]
|
|
335
|
-
}) : /* @__PURE__ */
|
|
435
|
+
}) : /* @__PURE__ */ x("div", {
|
|
336
436
|
className: "py-1",
|
|
337
|
-
children:
|
|
437
|
+
children: w.map((e) => Z(e))
|
|
338
438
|
})
|
|
339
439
|
})
|
|
340
440
|
]
|
|
341
441
|
});
|
|
342
442
|
};
|
|
343
443
|
//#endregion
|
|
344
|
-
export {
|
|
444
|
+
export { C as AssistantConversationList };
|