@burdenoff/fe-libs 2026.1113.10 → 2026.1113.11

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.
@@ -10,26 +10,27 @@ import { historyRowAcceptsControls as d, selectAssistantHistoryList as ne } from
10
10
  import { selectHistorySearchList as re } from "../history/historySearch.js";
11
11
  import { useAssistantHistorySearch as ie } from "../history/useAssistantHistorySearch.js";
12
12
  import { useAssistantHistoryStatus as f } from "../history/historyStatus.js";
13
- import { useAssistantHistoryStore as p } from "../history/historyStore.js";
14
- import { AssistantHistoryPinLimitBanner as ae, AssistantHistoryUnsavedDeleteNotice as oe } from "./AssistantHistoryNotices.js";
15
- import { AssistantConversationFilters as se } from "./AssistantConversationFilters.js";
16
- import { AssistantHistorySearchBox as ce } from "./AssistantHistorySearchBox.js";
17
- import { useEffect as le, useId as ue, useLayoutEffect as de, useMemo as m, useRef as h, useState as g } from "react";
18
- import { Archive as fe, ArchiveRestore as pe, ArrowLeft as me, Check as he, MessageSquare as ge, PanelLeftClose as _e, Pencil as ve, Pin as ye, PinOff as be, Plus as xe, Trash2 as Se } from "lucide-react";
19
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { useAssistantHistoryStore as ae } from "../history/historyStore.js";
14
+ import { AssistantHistoryPinLimitBanner as oe, AssistantHistoryUnsavedDeleteNotice as se } from "./AssistantHistoryNotices.js";
15
+ import { AssistantConversationFilters as ce } from "./AssistantConversationFilters.js";
16
+ import { AssistantHistorySearchBox as le } from "./AssistantHistorySearchBox.js";
17
+ import { PAGE_VIEW_GUTTER as ue, useAssistantPageLayout as de } from "./assistantPageLayout.js";
18
+ import { useEffect as fe, useId as pe, useLayoutEffect as me, useMemo as p, useRef as m, useState as h } from "react";
19
+ import { Archive as he, ArchiveRestore as ge, ArrowLeft as _e, Check as ve, MessageSquare as ye, PanelLeftClose as be, Pencil as xe, Pin as Se, PinOff as Ce, Plus as we, Trash2 as Te } from "lucide-react";
20
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
20
21
  // src/shared/assistant/ui/AssistantConversationList.tsx
21
- var Ce = {
22
+ var Ee = {
22
23
  channel: "ANY",
23
24
  pinned: null,
24
25
  archived: "INCLUDE"
25
- }, we = (e) => `group relative px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${e ? "bg-bg-elevated border-s-2 border-action-primary-bg" : ""}`, Te = ({ active: e, title: t, onOpen: n, details: r, actions: i, openRef: a, actionRef: ee, testId: o }) => {
26
- let s = ue(), c = `${s}-title`, l = `${s}-details`;
27
- return /* @__PURE__ */ y("div", {
28
- className: we(e),
26
+ }, De = (e) => `group relative px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${e ? "bg-bg-elevated border-s-2 border-action-primary-bg" : ""}`, Oe = ({ active: e, title: t, onOpen: n, details: r, actions: i, openRef: a, actionRef: ee, testId: o }) => {
27
+ let s = pe(), c = `${s}-title`, l = `${s}-details`;
28
+ return /* @__PURE__ */ v("div", {
29
+ className: De(e),
29
30
  "data-testid": o,
30
- children: [/* @__PURE__ */ y("div", {
31
+ children: [/* @__PURE__ */ v("div", {
31
32
  className: "flex items-center justify-between",
32
- children: [/* @__PURE__ */ v("button", {
33
+ children: [/* @__PURE__ */ _("button", {
33
34
  ref: a,
34
35
  type: "button",
35
36
  onClick: n,
@@ -37,16 +38,16 @@ var Ce = {
37
38
  "aria-describedby": l,
38
39
  className: "flex-1 min-w-0 text-start 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)]",
39
40
  "data-testid": "open-conversation",
40
- children: /* @__PURE__ */ v("span", {
41
+ children: /* @__PURE__ */ _("span", {
41
42
  id: c,
42
43
  className: "block text-xs font-medium text-text-primary truncate",
43
44
  children: t
44
45
  })
45
- }), /* @__PURE__ */ v("div", {
46
+ }), /* @__PURE__ */ _("div", {
46
47
  className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only [@media(pointer:coarse)]:not-sr-only",
47
- children: /* @__PURE__ */ v("div", {
48
+ children: /* @__PURE__ */ _("div", {
48
49
  className: "relative z-10 flex items-center gap-0.5 ms-1",
49
- children: i.map((e) => /* @__PURE__ */ v("button", {
50
+ children: i.map((e) => /* @__PURE__ */ _("button", {
50
51
  ref: ee(e.id),
51
52
  type: "button",
52
53
  onClick: e.onActivate,
@@ -58,200 +59,200 @@ var Ce = {
58
59
  }, e.id))
59
60
  })
60
61
  })]
61
- }), /* @__PURE__ */ v("div", {
62
+ }), /* @__PURE__ */ _("div", {
62
63
  id: l,
63
64
  children: r
64
65
  })]
65
66
  });
66
- }, Ee = (e, t) => {
67
+ }, ke = (e, t) => {
67
68
  let n = [];
68
69
  for (let r = 1; r < e.length; r += 1) {
69
70
  let i = e[t + r], a = t - r >= 0 ? e[t - r] : void 0;
70
71
  i !== void 0 && n.push(i), a !== void 0 && n.push(a);
71
72
  }
72
73
  return n;
73
- }, De = ({ presentation: De, onBack: Oe, onDone: ke }) => {
74
- let b = r(), Ae = De === "compact", { modes: je } = n(), { conversations: x, activeConversationId: S, processingByConversationId: Me, setActiveConversation: Ne, setMode: Pe, createConversation: Fe, deleteConversation: Ie, renameConversation: Le, setConversationListOpen: C } = t(), [w, T] = g(null), [E, Re] = g(""), [ze, D] = g(!1), Be = ue(), O = f((e) => e.product !== null), k = f((e) => e.scopeKey), Ve = f((e) => e.loadingIds), A = f((e) => e.olderHeaders), He = f((e) => e.unsavedDelete !== void 0), Ue = f((e) => e.controlsAvailable), j = O && Ue, We = f((e) => e.pinLimit), M = p((e) => k === null ? void 0 : e.scopes[k]), Ge = p((e) => e.tombstones), Ke = p((e) => e.outbox), [N, qe] = g(s), [Je, Ye] = g(!1), Xe = j ? N : Ce, Ze = (e) => {
75
- qe(e), Ye(!0);
76
- }, [Qe, $e] = g(""), et = f((e) => e.epoch), P = ie({
77
- text: Qe,
78
- filter: N,
79
- enabled: j,
80
- scopeKey: k,
81
- epoch: et
82
- }), F = j && P.query !== "", I = P.server;
83
- F && !Je && Ye(!0);
84
- let L = m(() => ({
74
+ }, Ae = ({ presentation: Ae, onBack: je, onDone: y }) => {
75
+ let b = r(), Me = de(), Ne = Ae === "compact", { modes: Pe } = n(), { conversations: x, activeConversationId: S, processingByConversationId: Fe, setActiveConversation: Ie, setMode: Le, createConversation: Re, deleteConversation: ze, renameConversation: Be, setConversationListOpen: C } = t(), [w, Ve] = h(null), [He, Ue] = h(""), [We, T] = h(!1), Ge = pe(), E = f((e) => e.product !== null), D = f((e) => e.scopeKey), Ke = f((e) => e.loadingIds), O = f((e) => e.olderHeaders), qe = f((e) => e.unsavedDelete !== void 0), Je = f((e) => e.controlsAvailable), k = E && Je, Ye = f((e) => e.pinLimit), A = ae((e) => D === null ? void 0 : e.scopes[D]), Xe = ae((e) => e.tombstones), j = ae((e) => e.outbox), [M, Ze] = h(s), [Qe, $e] = h(!1), et = k ? M : Ee, tt = (e) => {
76
+ Ze(e), $e(!0);
77
+ }, [nt, rt] = h(""), it = f((e) => e.epoch), N = ie({
78
+ text: nt,
79
+ filter: M,
80
+ enabled: k,
81
+ scopeKey: D,
82
+ epoch: it
83
+ }), P = k && N.query !== "", F = N.server;
84
+ P && !Qe && $e(!0);
85
+ let I = p(() => ({
85
86
  conversations: x,
86
- scopeKey: k,
87
- headers: M?.headers ?? {},
88
- olderHeaders: A && A.scopeKey === k ? A.headers : void 0,
89
- tombstones: Ge,
90
- loadingIds: Ve,
91
- outbox: Ke
87
+ scopeKey: D,
88
+ headers: A?.headers ?? {},
89
+ olderHeaders: O && O.scopeKey === D ? O.headers : void 0,
90
+ tombstones: Xe,
91
+ loadingIds: Ke,
92
+ outbox: j
92
93
  }), [
93
94
  x,
94
- k,
95
- M,
95
+ D,
96
96
  A,
97
- Ge,
98
- Ve,
99
- Ke
100
- ]), R = m(() => O ? ne(L, Xe) : null, [
101
- O,
102
- L,
103
- Xe
104
- ]), z = m(() => O && F ? re(L, N, P.query, I.status === "results" ? I.hits : null) : null, [
105
97
  O,
106
- F,
107
- L,
108
- N,
109
- P.query,
110
- I
111
- ]), B = I.status === "results" && I.hasMore, V = I.status === "results" && I.loadingMore, tt = j ? N : void 0, nt = u(tt), H = A && A.scopeKey === k ? A : void 0, U = H ? H.filterKey !== nt || H.hasMore : M?.hasOlderHeaders === !0, W = m(() => z ? [
112
- ...z.server.map((e) => e.key),
113
- ...z.local.map((e) => e.key),
114
- ...z.device.map((e) => e.id)
115
- ] : R ? [...R.workspace.map((e) => e.key), ...R.device.map((e) => e.id)] : x.map((e) => e.id), [
116
- z,
98
+ Xe,
99
+ Ke,
100
+ j
101
+ ]), L = p(() => E ? ne(I, et) : null, [
102
+ E,
103
+ I,
104
+ et
105
+ ]), R = p(() => E && P ? re(I, M, N.query, F.status === "results" ? F.hits : null) : null, [
106
+ E,
107
+ P,
108
+ I,
109
+ M,
110
+ N.query,
111
+ F
112
+ ]), z = F.status === "results" && F.hasMore, B = F.status === "results" && F.loadingMore, at = k ? M : void 0, ot = u(at), V = O && O.scopeKey === D ? O : void 0, H = V ? V.filterKey !== ot || V.hasMore : A?.hasOlderHeaders === !0, U = p(() => R ? [
113
+ ...R.server.map((e) => e.key),
114
+ ...R.local.map((e) => e.key),
115
+ ...R.device.map((e) => e.id)
116
+ ] : L ? [...L.workspace.map((e) => e.key), ...L.device.map((e) => e.id)] : x.map((e) => e.id), [
117
117
  R,
118
+ L,
118
119
  x
119
120
  ]);
120
- le(() => {
121
- O && o.notePanelOpened();
122
- }, [O]);
123
- let G = () => {
124
- Fe(), C(!1), ke?.();
125
- }, rt = (e) => {
126
- if (O) {
127
- o.openConversation(e, { modes: je }), C(!1), ke?.();
121
+ fe(() => {
122
+ E && o.notePanelOpened();
123
+ }, [E]);
124
+ let W = () => {
125
+ Re(), C(!1), y?.();
126
+ }, st = (e) => {
127
+ if (E) {
128
+ o.openConversation(e, { modes: Pe }), C(!1), y?.();
128
129
  return;
129
130
  }
130
131
  let t = x.find((t) => t.id === e);
131
- Ne(e), t && Pe(t.mode), C(!1), ke?.();
132
- }, K = h(/* @__PURE__ */ new Map()), it = (e) => (t) => {
133
- t ? K.current.set(e, t) : K.current.delete(e);
134
- }, q = h(/* @__PURE__ */ new Map()), at = (e) => (t) => (n) => {
132
+ Ie(e), t && Le(t.mode), C(!1), y?.();
133
+ }, G = m(/* @__PURE__ */ new Map()), ct = (e) => (t) => {
134
+ t ? G.current.set(e, t) : G.current.delete(e);
135
+ }, K = m(/* @__PURE__ */ new Map()), lt = (e) => (t) => (n) => {
135
136
  let r = `${e}\u0000${t}`;
136
- n ? q.current.set(r, n) : q.current.delete(r);
137
- }, J = h(null), ot = h(null), st = h(null), ct = h(null), lt = h(null), ut = (e, t) => {
138
- T(e), Re(c(t, 80)), D(!1);
139
- }, dt = (e) => {
140
- Re(c(e, 80)), D(l(e) > 80);
141
- }, ft = () => {
142
- w && E.trim() && Le(w, E), w && (J.current = {
137
+ n ? K.current.set(r, n) : K.current.delete(r);
138
+ }, q = m(null), J = m(null), ut = m(null), dt = m(null), ft = m(null), pt = (e, t) => {
139
+ Ve(e), Ue(c(t, 80)), T(!1);
140
+ }, mt = (e) => {
141
+ Ue(c(e, 80)), T(l(e) > 80);
142
+ }, ht = () => {
143
+ w && He.trim() && Be(w, He), w && (q.current = {
143
144
  kind: "renamed",
144
145
  key: w
145
- }), T(null), D(!1);
146
- }, pt = (e) => {
147
- J.current = {
146
+ }), Ve(null), T(!1);
147
+ }, gt = (e) => {
148
+ q.current = {
148
149
  kind: "deleted",
149
150
  key: e,
150
- before: W
151
- }, O ? o.deleteConversation(e) : Ie(e);
152
- }, mt = (e, t, n) => {
153
- J.current = {
151
+ before: U
152
+ }, E ? o.deleteConversation(e) : ze(e);
153
+ }, _t = (e, t, n) => {
154
+ q.current = {
154
155
  kind: "control",
155
156
  key: e,
156
157
  control: t,
157
- before: W
158
- }, o.updateConversation(e, n) || (J.current = null);
159
- }, ht = b("history.untitled", "Untitled conversation"), Y = "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded", gt = (e) => e === 1 ? b("conversationList.messageCountOne", "1 message") : b("conversationList.messageCount", "{{count}} messages", { count: e }), _t = (e) => e === 1 ? b("conversationList.spokenCountOne", "1 spoken") : b("conversationList.spokenCount", "{{count}} spoken", { count: e }), vt = (e, t) => /* @__PURE__ */ y("div", {
160
- className: we(t),
161
- children: [/* @__PURE__ */ y("div", {
158
+ before: U
159
+ }, o.updateConversation(e, n) || (q.current = null);
160
+ }, vt = b("history.untitled", "Untitled conversation"), Y = "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded", yt = (e) => e === 1 ? b("conversationList.messageCountOne", "1 message") : b("conversationList.messageCount", "{{count}} messages", { count: e }), bt = (e) => e === 1 ? b("conversationList.spokenCountOne", "1 spoken") : b("conversationList.spokenCount", "{{count}} spoken", { count: e }), xt = (e, t) => /* @__PURE__ */ v("div", {
161
+ className: De(t),
162
+ children: [/* @__PURE__ */ v("div", {
162
163
  className: "flex items-center gap-1",
163
- children: [/* @__PURE__ */ v("input", {
164
- ref: ot,
164
+ children: [/* @__PURE__ */ _("input", {
165
+ ref: J,
165
166
  "aria-label": b("conversations.renameLabel", "Conversation title"),
166
- "aria-describedby": ze ? Be : void 0,
167
- value: E,
168
- onChange: (e) => dt(e.target.value),
167
+ "aria-describedby": We ? Ge : void 0,
168
+ value: He,
169
+ onChange: (e) => mt(e.target.value),
169
170
  onKeyDown: (t) => {
170
- t.key === "Enter" && (t.preventDefault(), ft()), t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), T(null), D(!1), J.current = {
171
+ t.key === "Enter" && (t.preventDefault(), ht()), t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), Ve(null), T(!1), q.current = {
171
172
  kind: "renamed",
172
173
  key: e
173
174
  });
174
175
  },
175
176
  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"
176
- }), /* @__PURE__ */ v("button", {
177
+ }), /* @__PURE__ */ _("button", {
177
178
  type: "button",
178
- onClick: ft,
179
+ onClick: ht,
179
180
  className: "p-1 hover:bg-bg-sunken rounded",
180
181
  "aria-label": b("conversations.saveTitle", "Save title"),
181
- children: /* @__PURE__ */ v(he, { className: "size-3 text-status-success-text" })
182
+ children: /* @__PURE__ */ _(ve, { className: "size-3 text-status-success-text" })
182
183
  })]
183
- }), /* @__PURE__ */ v("p", {
184
- id: Be,
184
+ }), /* @__PURE__ */ _("p", {
185
+ id: Ge,
185
186
  role: "status",
186
187
  className: "text-[10px] text-text-muted",
187
- children: ze ? b("conversations.titleLimit", "Titles are up to {{limit}} characters", { limit: 80 }) : ""
188
+ children: We ? b("conversations.titleLimit", "Titles are up to {{limit}} characters", { limit: 80 }) : ""
188
189
  })]
189
- }, e), yt = (e) => {
190
- let t = j && d(e, Ke, k), n = e.pinnedAt !== null, r = e.archivedAt !== null, i = [];
190
+ }, e), St = (e) => {
191
+ let t = k && d(e, j, D), n = e.pinnedAt !== null, r = e.archivedAt !== null, i = [];
191
192
  return t && !r && i.push({
192
193
  id: "pin",
193
194
  label: n ? b("conversations.unpin", "Unpin conversation") : b("conversations.pin", "Pin conversation"),
194
- icon: v(n ? be : ye, { className: "size-3 text-text-muted" }),
195
- onActivate: () => mt(e.key, "pin", { pinned: !n }),
195
+ icon: _(n ? Ce : Se, { className: "size-3 text-text-muted" }),
196
+ onActivate: () => _t(e.key, "pin", { pinned: !n }),
196
197
  testId: "pin-conversation"
197
198
  }), (e.conversation || t) && i.push({
198
199
  id: "rename",
199
200
  label: b("conversations.rename", "Rename conversation"),
200
- icon: /* @__PURE__ */ v(ve, { className: "size-3 text-text-muted" }),
201
- onActivate: () => ut(e.key, e.title),
201
+ icon: /* @__PURE__ */ _(xe, { className: "size-3 text-text-muted" }),
202
+ onActivate: () => pt(e.key, e.title),
202
203
  testId: "rename-conversation"
203
204
  }), t && i.push({
204
205
  id: "archive",
205
206
  label: r ? b("conversations.unarchive", "Unarchive conversation") : b("conversations.archive", "Archive conversation"),
206
- icon: v(r ? pe : fe, { className: "size-3 text-text-muted" }),
207
- onActivate: () => mt(e.key, "archive", { archived: !r }),
207
+ icon: _(r ? ge : he, { className: "size-3 text-text-muted" }),
208
+ onActivate: () => _t(e.key, "archive", { archived: !r }),
208
209
  testId: "archive-conversation"
209
210
  }), i.push({
210
211
  id: "delete",
211
212
  label: b("conversations.delete", "Delete conversation"),
212
- icon: /* @__PURE__ */ v(Se, { className: "size-3 text-status-error-text" }),
213
- onActivate: () => pt(e.key),
213
+ icon: /* @__PURE__ */ _(Te, { className: "size-3 text-status-error-text" }),
214
+ onActivate: () => gt(e.key),
214
215
  testId: "delete-conversation"
215
216
  }), i;
216
- }, bt = (e) => [{
217
+ }, Ct = (e) => [{
217
218
  id: "rename",
218
219
  label: b("conversations.rename", "Rename conversation"),
219
- icon: /* @__PURE__ */ v(ve, { className: "size-3 text-text-muted" }),
220
- onActivate: () => ut(e.id, e.title),
220
+ icon: /* @__PURE__ */ _(xe, { className: "size-3 text-text-muted" }),
221
+ onActivate: () => pt(e.id, e.title),
221
222
  testId: "rename-conversation"
222
223
  }, {
223
224
  id: "delete",
224
225
  label: b("conversations.delete", "Delete conversation"),
225
- icon: /* @__PURE__ */ v(Se, { className: "size-3 text-status-error-text" }),
226
- onActivate: () => pt(e.id),
226
+ icon: /* @__PURE__ */ _(Te, { className: "size-3 text-status-error-text" }),
227
+ onActivate: () => gt(e.id),
227
228
  testId: "delete-conversation"
228
229
  }], X = (e, t) => {
229
- let n = e.id === S, r = e.id === w, o = je.find((t) => t.id === e.mode), s = i(e.messages), c = a(e.messages), l = s[s.length - 1], te = s.length === 0 && e.messages.length > 0, u = Me[e.id], d = l ? ee(l, u, b).text.slice(0, 60) : "";
230
- return r ? vt(e.id, n) : /* @__PURE__ */ v(Te, {
230
+ let n = e.id === S, r = e.id === w, o = Pe.find((t) => t.id === e.mode), s = i(e.messages), c = a(e.messages), l = s[s.length - 1], te = s.length === 0 && e.messages.length > 0, u = Fe[e.id], d = l ? ee(l, u, b).text.slice(0, 60) : "";
231
+ return r ? xt(e.id, n) : /* @__PURE__ */ _(Oe, {
231
232
  active: n,
232
- title: (t ? t.title : e.title) || ht,
233
- onOpen: () => rt(e.id),
234
- openRef: it(e.id),
235
- actionRef: at(e.id),
236
- actions: t ? t.actions : bt(e),
237
- details: /* @__PURE__ */ y(_, { children: [
238
- /* @__PURE__ */ y("div", {
233
+ title: (t ? t.title : e.title) || vt,
234
+ onOpen: () => st(e.id),
235
+ openRef: ct(e.id),
236
+ actionRef: lt(e.id),
237
+ actions: t ? t.actions : Ct(e),
238
+ details: /* @__PURE__ */ v(g, { children: [
239
+ /* @__PURE__ */ v("div", {
239
240
  className: "flex flex-wrap items-center gap-1.5 mt-0.5",
240
241
  children: [
241
- /* @__PURE__ */ v("span", {
242
+ /* @__PURE__ */ _("span", {
242
243
  className: Y,
243
244
  children: o?.label ?? e.mode
244
245
  }),
245
- /* @__PURE__ */ v("span", {
246
+ /* @__PURE__ */ _("span", {
246
247
  className: "text-[10px] text-text-muted",
247
- children: gt(s.length)
248
+ children: yt(s.length)
248
249
  }),
249
- c.length > 0 ? /* @__PURE__ */ v("span", {
250
+ c.length > 0 ? /* @__PURE__ */ _("span", {
250
251
  className: "text-[10px] text-text-muted",
251
252
  "data-testid": "history-spoken-count",
252
- children: _t(c.length)
253
+ children: bt(c.length)
253
254
  }) : null,
254
- u && u.status !== "idle" && /* @__PURE__ */ v("span", {
255
+ u && u.status !== "idle" && /* @__PURE__ */ _("span", {
255
256
  className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
256
257
  children: u.status
257
258
  }),
@@ -259,284 +260,284 @@ var Ce = {
259
260
  ]
260
261
  }),
261
262
  t?.note,
262
- d && /* @__PURE__ */ v("p", {
263
+ d && /* @__PURE__ */ _("p", {
263
264
  className: "text-[10px] text-text-muted truncate mt-0.5",
264
265
  children: d
265
266
  }),
266
- te && /* @__PURE__ */ v("p", {
267
+ te && /* @__PURE__ */ _("p", {
267
268
  className: "text-[10px] text-text-muted truncate mt-0.5",
268
269
  children: b("conversationList.voiceOnly", "Spoken conversation")
269
270
  })
270
271
  ] })
271
272
  }, e.id);
272
- }, xt = (e) => e.blocked === "quota" ? b("history.notSavedQuota", "Not saved yet: this workspace has reached its conversation limit. It will be saved when there is room.") : e.blocked === "invalid" ? b("history.notSavedInvalid", "Part of this conversation couldn't be saved. It stays on this device.") : e.blocked === "scope" ? b("history.notSavedScope", "Some turns were sent from another workspace. They stay on this device.") : null, St = (e) => {
273
- let t = xt(e);
274
- return /* @__PURE__ */ y(_, { children: [
275
- e.channel === "VOICE" ? /* @__PURE__ */ v("span", {
273
+ }, wt = (e) => e.blocked === "quota" ? b("history.notSavedQuota", "Not saved yet: this workspace has reached its conversation limit. It will be saved when there is room.") : e.blocked === "invalid" ? b("history.notSavedInvalid", "Part of this conversation couldn't be saved. It stays on this device.") : e.blocked === "scope" ? b("history.notSavedScope", "Some turns were sent from another workspace. They stay on this device.") : null, Tt = (e) => {
274
+ let t = wt(e);
275
+ return /* @__PURE__ */ v(g, { children: [
276
+ e.channel === "VOICE" ? /* @__PURE__ */ _("span", {
276
277
  className: Y,
277
278
  "data-testid": "history-badge-voice",
278
279
  children: b("conversationList.badgeVoice", "Voice")
279
- }) : e.channel === "MIXED" ? /* @__PURE__ */ v("span", {
280
+ }) : e.channel === "MIXED" ? /* @__PURE__ */ _("span", {
280
281
  className: Y,
281
282
  "data-testid": "history-badge-mixed",
282
283
  children: b("conversationList.badgeMixed", "Chat + voice")
283
284
  }) : null,
284
- e.pinnedAt === null ? null : /* @__PURE__ */ y("span", {
285
+ e.pinnedAt === null ? null : /* @__PURE__ */ v("span", {
285
286
  className: `${Y} inline-flex items-center gap-0.5`,
286
287
  "data-testid": "history-badge-pinned",
287
- children: [/* @__PURE__ */ v(ye, {
288
+ children: [/* @__PURE__ */ _(Se, {
288
289
  className: "size-2.5",
289
290
  "aria-hidden": "true"
290
291
  }), b("conversationList.badgePinned", "Pinned")]
291
292
  }),
292
- e.archivedAt === null ? null : /* @__PURE__ */ y("span", {
293
+ e.archivedAt === null ? null : /* @__PURE__ */ v("span", {
293
294
  className: `${Y} inline-flex items-center gap-0.5`,
294
295
  "data-testid": "history-badge-archived",
295
- children: [/* @__PURE__ */ v(fe, {
296
+ children: [/* @__PURE__ */ _(he, {
296
297
  className: "size-2.5",
297
298
  "aria-hidden": "true"
298
299
  }), b("conversationList.badgeArchived", "Archived")]
299
300
  }),
300
- e.legacy ? /* @__PURE__ */ v("span", {
301
+ e.legacy ? /* @__PURE__ */ _("span", {
301
302
  className: Y,
302
303
  "data-testid": "history-badge-read-only",
303
304
  children: b("history.badgeReadOnly", "Read-only")
304
305
  }) : null,
305
- t === null ? null : /* @__PURE__ */ v("span", {
306
+ t === null ? null : /* @__PURE__ */ _("span", {
306
307
  className: Y,
307
308
  "data-testid": "history-badge-not-saved",
308
309
  children: b("history.badgeNotSaved", "Not saved")
309
310
  }),
310
- e.loading ? /* @__PURE__ */ v("span", {
311
+ e.loading ? /* @__PURE__ */ _("span", {
311
312
  className: Y,
312
313
  "data-testid": "history-badge-loading",
313
314
  children: b("history.badgeLoading", "Loading…")
314
315
  }) : null
315
316
  ] });
316
- }, Ct = (e) => {
317
- let t = xt(e);
318
- return t === null ? null : /* @__PURE__ */ v("p", {
317
+ }, Et = (e) => {
318
+ let t = wt(e);
319
+ return t === null ? null : /* @__PURE__ */ _("p", {
319
320
  className: "text-[10px] text-text-muted break-words mt-0.5",
320
321
  "data-testid": "history-not-saved-reason",
321
322
  children: t
322
323
  });
323
- }, wt = (e) => e.key === w ? vt(e.key, e.key === S) : /* @__PURE__ */ v(Te, {
324
+ }, Dt = (e) => e.key === w ? xt(e.key, e.key === S) : /* @__PURE__ */ _(Oe, {
324
325
  active: e.key === S,
325
- title: e.title || ht,
326
- onOpen: () => rt(e.key),
327
- openRef: it(e.key),
328
- actionRef: at(e.key),
329
- actions: yt(e),
330
- details: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
326
+ title: e.title || vt,
327
+ onOpen: () => st(e.key),
328
+ openRef: ct(e.key),
329
+ actionRef: lt(e.key),
330
+ actions: St(e),
331
+ details: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
331
332
  className: "flex flex-wrap items-center gap-1.5 mt-0.5",
332
- children: St(e)
333
- }), Ct(e)] }),
333
+ children: Tt(e)
334
+ }), Et(e)] }),
334
335
  testId: "history-server-row"
335
- }, e.key), Tt = (e) => e.conversation ? X(e.conversation, {
336
- title: e.title || ht,
337
- badges: St(e),
338
- note: Ct(e),
339
- actions: yt(e)
340
- }) : wt(e), Z = (e) => /* @__PURE__ */ v("h3", {
336
+ }, e.key), Ot = (e) => e.conversation ? X(e.conversation, {
337
+ title: e.title || vt,
338
+ badges: Tt(e),
339
+ note: Et(e),
340
+ actions: St(e)
341
+ }) : Dt(e), Z = (e) => /* @__PURE__ */ _("h3", {
341
342
  className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",
342
343
  children: e
343
- }), Q = z ? z.server.length + z.local.length + z.device.length : R ? R.workspace.length + R.device.length : x.length, Et = z ? Q === 0 && I.status !== "searching" && !B : R ? Q === 0 && !U : x.length === 0, Dt = (e) => e === 0 ? b("conversationFilters.none", "No conversations match") : e === 1 ? b("conversationFilters.countOne", "1 conversation") : b("conversationFilters.count", "{{count}} conversations", { count: e }), Ot = F ? P.tooShort ? b("historySearch.tooShort", "Type 2 or more characters to search this workspace") : I.status === "searching" ? b("historySearch.searching", "Searching…") : Dt(Q) : void 0, kt = F ? I.status === "fallback" ? I.reason === "busy" ? b("historySearch.busy", "Search is busy right now. Showing matches on this device.") : b("historySearch.failed", "Couldn't search this workspace. Showing matches on this device.") : I.status === "results" && I.moreFailed ? b("historySearch.moreFailed", "Couldn't load more results. Try again.") : "" : "", $ = j && !F ? te(N) : null, At = F ? Dt(0) : $ === "archived" ? b("conversationList.emptyArchived", "No archived conversations") : $ === "pinned" ? b("conversationList.emptyPinned", "No pinned conversations") : $ === "voice" ? b("conversationList.emptyVoice", "No voice conversations") : $ === "chat" ? b("conversationList.emptyChat", "No chat conversations") : b("conversations.empty", "No conversations yet"), jt = e("assistant-open-history");
344
- return de(() => {
345
- w !== null && ot.current?.focus({ preventScroll: !0 });
346
- }, [w]), de(() => {
347
- let e = J.current;
348
- if (!e || (e.kind === "deleted" ? W.includes(e.key) : e.kind === "renamed" ? w === e.key : e.kind !== "control" && (e.kind === "more" ? V : U))) return;
349
- J.current = null;
344
+ }), Q = R ? R.server.length + R.local.length + R.device.length : L ? L.workspace.length + L.device.length : x.length, kt = R ? Q === 0 && F.status !== "searching" && !z : L ? Q === 0 && !H : x.length === 0, At = (e) => e === 0 ? b("conversationFilters.none", "No conversations match") : e === 1 ? b("conversationFilters.countOne", "1 conversation") : b("conversationFilters.count", "{{count}} conversations", { count: e }), jt = P ? N.tooShort ? b("historySearch.tooShort", "Type 2 or more characters to search this workspace") : F.status === "searching" ? b("historySearch.searching", "Searching…") : At(Q) : void 0, Mt = P ? F.status === "fallback" ? F.reason === "busy" ? b("historySearch.busy", "Search is busy right now. Showing matches on this device.") : b("historySearch.failed", "Couldn't search this workspace. Showing matches on this device.") : F.status === "results" && F.moreFailed ? b("historySearch.moreFailed", "Couldn't load more results. Try again.") : "" : "", $ = k && !P ? te(M) : null, Nt = P ? At(0) : $ === "archived" ? b("conversationList.emptyArchived", "No archived conversations") : $ === "pinned" ? b("conversationList.emptyPinned", "No pinned conversations") : $ === "voice" ? b("conversationList.emptyVoice", "No voice conversations") : $ === "chat" ? b("conversationList.emptyChat", "No chat conversations") : b("conversations.empty", "No conversations yet"), Pt = e("assistant-open-history");
345
+ return me(() => {
346
+ w !== null && J.current?.focus({ preventScroll: !0 });
347
+ }, [w]), me(() => {
348
+ let e = q.current;
349
+ if (!e || (e.kind === "deleted" ? U.includes(e.key) : e.kind === "renamed" ? w === e.key : e.kind !== "control" && (e.kind === "more" ? B : H))) return;
350
+ q.current = null;
350
351
  let t = document.activeElement;
351
352
  if (t && t !== document.body) return;
352
- let n, r = e.kind === "control" && W.includes(e.key) ? q.current.get(`${e.key}\u0000${e.control}`) : void 0;
353
+ let n, r = e.kind === "control" && U.includes(e.key) ? K.current.get(`${e.key}\u0000${e.control}`) : void 0;
353
354
  if (e.kind === "renamed") n = [e.key];
354
- else if (e.kind === "control") n = W.includes(e.key) ? [e.key] : [...Ee(e.before, e.before.indexOf(e.key)), ...W];
355
- else if (e.kind === "deleted") n = [...Ee(e.before, e.before.indexOf(e.key)), ...W];
355
+ else if (e.kind === "control") n = U.includes(e.key) ? [e.key] : [...ke(e.before, e.before.indexOf(e.key)), ...U];
356
+ else if (e.kind === "deleted") n = [...ke(e.before, e.before.indexOf(e.key)), ...U];
356
357
  else if (e.kind === "more") {
357
- let t = new Set(e.before), r = z?.server ?? [];
358
+ let t = new Set(e.before), r = R?.server ?? [];
358
359
  n = [
359
- ...W.filter((e) => !t.has(e)),
360
+ ...U.filter((e) => !t.has(e)),
360
361
  r[r.length - 1]?.key,
361
- ...W
362
+ ...U
362
363
  ];
363
364
  } else {
364
- let t = A && A.scopeKey === k ? A.headers : {}, r = new Set(e.before), i = R?.workspace ?? [];
365
+ let t = O && O.scopeKey === D ? O.headers : {}, r = new Set(e.before), i = L?.workspace ?? [];
365
366
  n = [
366
- ...W.filter((e) => !r.has(e) && e in t),
367
+ ...U.filter((e) => !r.has(e) && e in t),
367
368
  i[i.length - 1]?.key,
368
- ...W
369
+ ...U
369
370
  ];
370
371
  }
371
- (r ?? n.map((e) => e === void 0 ? void 0 : e === w ? ot.current ?? void 0 : K.current.get(e)).find((e) => e !== void 0) ?? st.current ?? ct.current ?? lt.current ?? jt.current)?.focus({ preventScroll: !0 });
372
+ (r ?? n.map((e) => e === void 0 ? void 0 : e === w ? J.current ?? void 0 : G.current.get(e)).find((e) => e !== void 0) ?? ut.current ?? dt.current ?? ft.current ?? Pt.current)?.focus({ preventScroll: !0 });
372
373
  }, [
373
- W,
374
- w,
375
374
  U,
376
- A,
377
- k,
378
- R,
379
- jt,
380
- V,
381
- z
382
- ]), /* @__PURE__ */ y("div", {
383
- ref: jt,
375
+ w,
376
+ H,
377
+ O,
378
+ D,
379
+ L,
380
+ Pt,
381
+ B,
382
+ R
383
+ ]), /* @__PURE__ */ v("div", {
384
+ ref: Pt,
384
385
  tabIndex: -1,
385
386
  role: "region",
386
387
  "aria-label": b("conversations.title", "History"),
387
- 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",
388
+ 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${Me ? ` ${ue}` : ""}`,
388
389
  "data-testid": "conversation-list",
389
390
  children: [
390
- Ae ? /* @__PURE__ */ y("div", {
391
+ Ne ? /* @__PURE__ */ v("div", {
391
392
  className: "flex items-center gap-1 border-b border-border-default bg-bg-elevated px-2 py-2",
392
393
  children: [
393
- /* @__PURE__ */ v("button", {
394
+ /* @__PURE__ */ _("button", {
394
395
  type: "button",
395
- onClick: () => Oe ? Oe() : C(!1),
396
+ onClick: () => je ? je() : C(!1),
396
397
  className: "flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
397
398
  "aria-label": b("menuView.back", "Back"),
398
399
  "data-testid": "collapse-conversation-list",
399
- children: /* @__PURE__ */ v(me, {
400
+ children: /* @__PURE__ */ _(_e, {
400
401
  className: "size-5",
401
402
  "aria-hidden": "true"
402
403
  })
403
404
  }),
404
- /* @__PURE__ */ v("h2", {
405
+ /* @__PURE__ */ _("h2", {
405
406
  className: "min-w-0 flex-1 truncate text-base font-semibold text-text-primary",
406
407
  children: b("conversations.title", "History")
407
408
  }),
408
- /* @__PURE__ */ v("button", {
409
+ /* @__PURE__ */ _("button", {
409
410
  type: "button",
410
- onClick: G,
411
+ onClick: W,
411
412
  className: "flex size-10 shrink-0 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
412
413
  "aria-label": b("conversations.new", "New conversation"),
413
414
  "data-testid": "new-conversation",
414
- children: /* @__PURE__ */ v(xe, {
415
+ children: /* @__PURE__ */ _(we, {
415
416
  className: "size-5",
416
417
  "aria-hidden": "true"
417
418
  })
418
419
  })
419
420
  ]
420
- }) : /* @__PURE__ */ y("div", {
421
+ }) : /* @__PURE__ */ v("div", {
421
422
  className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
422
- children: [/* @__PURE__ */ v("span", {
423
+ children: [/* @__PURE__ */ _("span", {
423
424
  className: "text-[13px] font-semibold text-text-primary",
424
425
  children: b("conversations.title", "History")
425
- }), /* @__PURE__ */ y("div", {
426
+ }), /* @__PURE__ */ v("div", {
426
427
  className: "flex items-center gap-0.5",
427
- children: [/* @__PURE__ */ v("button", {
428
+ children: [/* @__PURE__ */ _("button", {
428
429
  type: "button",
429
- onClick: G,
430
+ onClick: W,
430
431
  className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
431
432
  "aria-label": b("conversations.new", "New conversation"),
432
433
  "data-testid": "new-conversation",
433
- children: /* @__PURE__ */ v(xe, { className: "size-4" })
434
- }), /* @__PURE__ */ y("button", {
434
+ children: /* @__PURE__ */ _(we, { className: "size-4" })
435
+ }), /* @__PURE__ */ v("button", {
435
436
  type: "button",
436
437
  onClick: () => C(!1),
437
438
  className: "flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
438
439
  "aria-label": b("conversations.collapse", "Collapse history"),
439
440
  "data-testid": "collapse-conversation-list",
440
- children: [/* @__PURE__ */ v(_e, { className: "size-4" }), /* @__PURE__ */ v("span", {
441
+ children: [/* @__PURE__ */ _(be, { className: "size-4" }), /* @__PURE__ */ _("span", {
441
442
  className: "text-[11px] font-medium",
442
443
  children: b("conversations.collapseLabel", "Collapse")
443
444
  })]
444
445
  })]
445
446
  })]
446
447
  }),
447
- O && He ? /* @__PURE__ */ v(oe, {}) : null,
448
- O && We ? /* @__PURE__ */ v(ae, {
449
- limit: We.limit,
448
+ E && qe ? /* @__PURE__ */ _(se, {}) : null,
449
+ E && Ye ? /* @__PURE__ */ _(oe, {
450
+ limit: Ye.limit,
450
451
  onDismiss: () => f.getState().notePinLimit(void 0)
451
452
  }) : null,
452
- j ? /* @__PURE__ */ v(se, {
453
- filter: N,
454
- onChange: Ze,
453
+ k ? /* @__PURE__ */ _(ce, {
454
+ filter: M,
455
+ onChange: tt,
455
456
  count: Q,
456
- announce: Je,
457
- search: /* @__PURE__ */ v(ce, {
458
- value: Qe,
459
- onChange: $e,
460
- onSubmit: P.flush,
461
- notice: kt
457
+ announce: Qe,
458
+ search: /* @__PURE__ */ _(le, {
459
+ value: nt,
460
+ onChange: rt,
461
+ onSubmit: N.flush,
462
+ notice: Mt
462
463
  }),
463
- statusText: Ot
464
+ statusText: jt
464
465
  }) : null,
465
- /* @__PURE__ */ v("div", {
466
+ /* @__PURE__ */ _("div", {
466
467
  className: "scrollbar-slim flex-1 overflow-y-auto",
467
- children: Et ? /* @__PURE__ */ y("div", {
468
+ children: kt ? /* @__PURE__ */ v("div", {
468
469
  className: "flex flex-col items-center justify-center h-full text-center px-4",
469
470
  "data-testid": "history-empty",
470
471
  children: [
471
- /* @__PURE__ */ v(ge, { className: "size-6 text-text-muted mb-2" }),
472
- /* @__PURE__ */ v("p", {
472
+ /* @__PURE__ */ _(ye, { className: "size-6 text-text-muted mb-2" }),
473
+ /* @__PURE__ */ _("p", {
473
474
  className: "text-xs text-text-muted",
474
- children: At
475
+ children: Nt
475
476
  }),
476
- $ === null && !F ? /* @__PURE__ */ v("button", {
477
- ref: lt,
477
+ $ === null && !P ? /* @__PURE__ */ _("button", {
478
+ ref: ft,
478
479
  type: "button",
479
- onClick: G,
480
+ onClick: W,
480
481
  className: "mt-2 text-xs text-action-primary-bg hover:underline",
481
482
  children: b("conversations.startNew", "Start a new conversation")
482
483
  }) : null
483
484
  ]
484
- }) : z ? /* @__PURE__ */ y("div", {
485
+ }) : R ? /* @__PURE__ */ v("div", {
485
486
  className: "py-1",
486
487
  "data-testid": "history-search-results",
487
- children: [z.server.length > 0 || B ? /* @__PURE__ */ y("section", {
488
+ children: [R.server.length > 0 || z ? /* @__PURE__ */ v("section", {
488
489
  "data-testid": "history-search-group-workspace",
489
490
  children: [
490
491
  Z(b("history.groupWorkspace", "This workspace")),
491
- z.server.map(Tt),
492
- B ? /* @__PURE__ */ v("button", {
493
- ref: ct,
492
+ R.server.map(Ot),
493
+ z ? /* @__PURE__ */ _("button", {
494
+ ref: dt,
494
495
  type: "button",
495
496
  onClick: () => {
496
- V || (J.current = {
497
+ B || (q.current = {
497
498
  kind: "more",
498
- before: W
499
- }), P.loadMore();
499
+ before: U
500
+ }), N.loadMore();
500
501
  },
501
502
  className: "mx-3 my-1 text-xs text-action-primary-bg hover:underline",
502
503
  "data-testid": "history-search-show-more",
503
504
  children: b("historySearch.showMore", "Show more results")
504
505
  }) : null
505
506
  ]
506
- }) : null, z.local.length > 0 || z.device.length > 0 ? /* @__PURE__ */ y("section", {
507
+ }) : null, R.local.length > 0 || R.device.length > 0 ? /* @__PURE__ */ v("section", {
507
508
  "data-testid": "history-search-group-device",
508
509
  children: [
509
510
  Z(b("history.groupDevice", "On this device")),
510
- z.local.map(Tt),
511
- z.device.map((e) => X(e))
511
+ R.local.map(Ot),
512
+ R.device.map((e) => X(e))
512
513
  ]
513
514
  }) : null]
514
- }) : R ? /* @__PURE__ */ y("div", {
515
+ }) : L ? /* @__PURE__ */ v("div", {
515
516
  className: "py-1",
516
- children: [R.workspace.length > 0 || U ? /* @__PURE__ */ y("section", {
517
+ children: [L.workspace.length > 0 || H ? /* @__PURE__ */ v("section", {
517
518
  "data-testid": "history-group-workspace",
518
519
  children: [
519
520
  Z(b("history.groupWorkspace", "This workspace")),
520
- R.workspace.map(Tt),
521
- U ? /* @__PURE__ */ v("button", {
522
- ref: st,
521
+ L.workspace.map(Ot),
522
+ H ? /* @__PURE__ */ _("button", {
523
+ ref: ut,
523
524
  type: "button",
524
525
  onClick: () => {
525
- J.current = {
526
+ q.current = {
526
527
  kind: "older",
527
- before: W
528
- }, o.loadOlderHeaders(tt);
528
+ before: U
529
+ }, o.loadOlderHeaders(at);
529
530
  },
530
531
  className: "mx-3 my-1 text-xs text-action-primary-bg hover:underline",
531
532
  "data-testid": "history-show-older",
532
533
  children: b("history.showOlder", "Show older conversations")
533
534
  }) : null
534
535
  ]
535
- }) : null, R.device.length > 0 ? /* @__PURE__ */ y("section", {
536
+ }) : null, L.device.length > 0 ? /* @__PURE__ */ v("section", {
536
537
  "data-testid": "history-group-device",
537
- children: [Z(b("history.groupDevice", "On this device")), R.device.map((e) => X(e))]
538
+ children: [Z(b("history.groupDevice", "On this device")), L.device.map((e) => X(e))]
538
539
  }) : null]
539
- }) : /* @__PURE__ */ v("div", {
540
+ }) : /* @__PURE__ */ _("div", {
540
541
  className: "py-1",
541
542
  children: x.map((e) => X(e))
542
543
  })
@@ -544,4 +545,4 @@ var Ce = {
544
545
  ]
545
546
  });
546
547
  };
547
- export { De as AssistantConversationList };
548
+ export { Ae as AssistantConversationList };