@burdenoff/fe-libs 2026.1114.15 → 2026.1115.2

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.
@@ -1,51 +1,38 @@
1
1
  import { EscapeLayer as e } from "../../../components/EscapeLayer.js";
2
2
  import { useAssistantTr as t } from "../../i18n.js";
3
3
  import { useAssistantStore as n } from "../../store.js";
4
- import { ASSISTANT_LANGUAGES as r, findAssistantLanguage as i } from "../../voice/languages.js";
5
- import { useDropdownEscape as a } from "../useDropdownEscape.js";
4
+ import { ASSISTANT_LANGUAGES as r } from "../../voice/languages.js";
5
+ import { useDropdownEscape as i } from "../useDropdownEscape.js";
6
+ import { roomAbove as a } from "./menuRoom.js";
6
7
  import { listMicrophones as o, microphoneChoiceOffered as s } from "./microphones.js";
7
8
  import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
8
9
  import { Check as f, ChevronDown as p, Mic as m, MicOff as h } from "lucide-react";
9
10
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
10
11
  // src/shared/assistant/ui/composer/AssistantMicMenu.tsx
11
- function y() {
12
- let e = t(), r = n((e) => e.micDeviceId), a = n((e) => e.assistantLanguage), [s, c] = d(null);
13
- l(() => {
14
- if (!r) return;
15
- let t = !0;
16
- return o((t) => e("dictation.unnamedMicrophone", "Microphone {{n}}", { n: t })).then((e) => {
17
- t && c(e.find((e) => e.deviceId === r)?.label ?? null);
18
- }), () => {
19
- t = !1;
20
- };
21
- }, [r, e]);
22
- let u = r && s ? s : e("dictation.systemDefault", "System default"), f = i(a);
23
- return `${u} · ${f ? f.label : e("voice.languageFollowApp", "Same as interface")}`;
24
- }
25
- var b = "flex min-h-11 w-full items-center justify-between gap-3 px-3 py-2 text-start text-sm sm:min-h-0 text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:bg-bg-sunken", x = ({ checked: e, label: t, onChoose: n, testId: r, lang: i }) => /* @__PURE__ */ v("button", {
12
+ var y = 10, b = 12, x = 340, S = 160, C = "flex min-h-11 w-full items-center justify-between gap-3 px-3 py-2 text-start text-sm sm:min-h-0 text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:bg-bg-sunken", w = ({ checked: e, label: t, onChoose: n, testId: r, lang: i }) => /* @__PURE__ */ v("button", {
26
13
  type: "button",
27
14
  role: "menuitemradio",
28
15
  "aria-checked": e,
29
16
  lang: i,
30
17
  onClick: n,
31
- className: b,
18
+ className: `${C} rounded-lg${e ? " bg-action-primary-bg/10" : ""}`,
32
19
  "data-testid": r,
33
20
  children: [/* @__PURE__ */ _("span", {
34
21
  className: "truncate",
35
22
  children: t
36
23
  }), e ? /* @__PURE__ */ _(f, {
37
- className: "size-4 shrink-0 text-status-warning-text",
24
+ className: "size-4 shrink-0 text-action-primary-bg",
38
25
  "aria-hidden": "true"
39
26
  }) : null]
40
- }), S = ({ title: e, children: t }) => /* @__PURE__ */ v("div", {
27
+ }), T = ({ title: e, children: t }) => /* @__PURE__ */ v("div", {
41
28
  role: "group",
42
29
  "aria-label": e,
43
30
  children: [/* @__PURE__ */ _("p", {
44
- className: "px-3 pb-1 pt-2 text-xs font-medium text-text-secondary",
31
+ className: "px-3 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wider text-text-muted",
45
32
  children: e
46
33
  }), t]
47
34
  });
48
- function C(e, n) {
35
+ function E(e, n) {
49
36
  let r = t(), [i, a] = d([]);
50
37
  return l(() => {
51
38
  if (!e || !n) return;
@@ -61,20 +48,20 @@ function C(e, n) {
61
48
  r
62
49
  ]), i;
63
50
  }
64
- var w = ({ open: e, onChosen: i }) => {
65
- let a = t(), o = n((e) => e.micDeviceId), c = n((e) => e.setMicDeviceId), l = n((e) => e.assistantLanguage), u = n((e) => e.setAssistantLanguage), d = s(), f = C(e, d), p = (e) => () => {
51
+ var D = ({ open: e, onChosen: i }) => {
52
+ let a = t(), o = n((e) => e.micDeviceId), c = n((e) => e.setMicDeviceId), l = n((e) => e.assistantLanguage), u = n((e) => e.setAssistantLanguage), d = s(), f = E(e, d), p = (e) => () => {
66
53
  e(), i();
67
54
  };
68
- return /* @__PURE__ */ v(g, { children: [d ? /* @__PURE__ */ v(S, {
55
+ return /* @__PURE__ */ v(g, { children: [d ? /* @__PURE__ */ v(T, {
69
56
  title: a("dictation.microphone", "Microphone"),
70
57
  children: [
71
- /* @__PURE__ */ _(x, {
58
+ /* @__PURE__ */ _(w, {
72
59
  checked: o === null,
73
60
  label: a("dictation.systemDefault", "System default"),
74
61
  onChoose: p(() => c(null)),
75
62
  testId: "assistant-mic-device-default"
76
63
  }),
77
- f.map((e) => /* @__PURE__ */ _(x, {
64
+ f.map((e) => /* @__PURE__ */ _(w, {
78
65
  checked: o === e.deviceId,
79
66
  label: e.label,
80
67
  onChoose: p(() => c(e.deviceId)),
@@ -85,14 +72,14 @@ var w = ({ open: e, onChosen: i }) => {
85
72
  "aria-hidden": "true"
86
73
  })
87
74
  ]
88
- }) : null, /* @__PURE__ */ v(S, {
75
+ }) : null, /* @__PURE__ */ v(T, {
89
76
  title: a("dictation.language", "Language"),
90
- children: [/* @__PURE__ */ _(x, {
77
+ children: [/* @__PURE__ */ _(w, {
91
78
  checked: l === null,
92
79
  label: a("voice.languageFollowApp", "Same as interface"),
93
80
  onChoose: p(() => u(null)),
94
81
  testId: "assistant-mic-language-default"
95
- }), r.map((e) => /* @__PURE__ */ _(x, {
82
+ }), r.map((e) => /* @__PURE__ */ _(w, {
96
83
  checked: l === e.code,
97
84
  label: e.label,
98
85
  lang: e.code,
@@ -100,7 +87,7 @@ var w = ({ open: e, onChosen: i }) => {
100
87
  testId: "assistant-mic-language"
101
88
  }, e.code))]
102
89
  })] });
103
- }, T = ({ onDictate: e, blocked: n, disabled: r }) => {
90
+ }, O = ({ onDictate: e, blocked: n, disabled: r }) => {
104
91
  let i = t(), a = n ? i("dictation.blockedButton", "Dictate, microphone blocked") : i("composer.voiceStart", "Dictate a message");
105
92
  return /* @__PURE__ */ _("button", {
106
93
  type: "button",
@@ -116,61 +103,67 @@ var w = ({ open: e, onChosen: i }) => {
116
103
  "aria-hidden": "true"
117
104
  })
118
105
  });
119
- }, E = ({ disabled: n }) => {
120
- let r = t(), [i, o] = d(!1), s = u(null), f = u(null), m = c(() => o(!1), []), h = a(s, m), y = c(() => {
121
- o(!1), s.current?.focus();
106
+ }, k = ({ disabled: n }) => {
107
+ let r = t(), [o, s] = d(!1), f = u(null), m = u(null), h = c((e) => {
108
+ m.current = e;
109
+ let t = f.current;
110
+ if (!e || !t) return;
111
+ let n = a(t, y, b);
112
+ e.style.maxHeight = `${Math.max(S, Math.min(x, n))}px`;
113
+ }, []), C = c(() => s(!1), []), w = i(f, C), T = c(() => {
114
+ s(!1), f.current?.focus();
122
115
  }, []);
123
116
  l(() => {
124
- if (!i) return;
117
+ if (!o) return;
125
118
  let e = (e) => {
126
119
  let t = e.target;
127
- f.current?.contains(t) || s.current?.contains(t) || o(!1);
120
+ m.current?.contains(t) || f.current?.contains(t) || s(!1);
128
121
  };
129
122
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
130
- }, [i]);
131
- let b = r("dictation.options", "Microphone and language options");
123
+ }, [o]);
124
+ let E = r("dictation.options", "Microphone and language options");
132
125
  return /* @__PURE__ */ v(g, { children: [
133
126
  /* @__PURE__ */ _("span", {
134
127
  "aria-hidden": "true",
135
128
  className: "h-5 w-px bg-border-default"
136
129
  }),
137
130
  /* @__PURE__ */ _("button", {
138
- ref: s,
131
+ ref: f,
139
132
  type: "button",
140
- onClick: () => o((e) => !e),
133
+ onClick: () => s((e) => !e),
141
134
  disabled: n,
142
135
  className: "flex h-11 w-11 items-center justify-center rounded-e-full 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)] disabled:cursor-not-allowed disabled:opacity-50 sm:h-10 sm:w-9",
143
- "aria-label": b,
144
- title: b,
136
+ "aria-label": E,
137
+ title: E,
145
138
  "aria-haspopup": "menu",
146
- "aria-expanded": i,
139
+ "aria-expanded": o,
147
140
  "data-testid": "assistant-mic-options",
148
141
  children: /* @__PURE__ */ _(p, {
149
142
  className: "size-4",
150
143
  "aria-hidden": "true"
151
144
  })
152
145
  }),
153
- i ? /* @__PURE__ */ _(e, {
154
- ...h,
146
+ o ? /* @__PURE__ */ _(e, {
147
+ ...w,
155
148
  children: /* @__PURE__ */ _("div", {
156
- ref: f,
149
+ ref: h,
157
150
  role: "menu",
158
- "aria-label": b,
159
- className: "absolute bottom-full end-0 z-30 mb-2 max-h-[min(24rem,60vh)] min-w-60 overflow-y-auto rounded-xl border border-border-default bg-bg-elevated py-1 shadow-lg",
151
+ "aria-label": E,
152
+ className: "scrollbar-slim scrollbar-box absolute bottom-full end-0 z-30 mb-2.5 w-72 max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain rounded-xl border border-border-default bg-bg-elevated p-1.5 shadow-lg",
160
153
  "data-testid": "assistant-mic-menu",
161
- children: /* @__PURE__ */ _(w, {
162
- open: i,
163
- onChosen: y
154
+ children: /* @__PURE__ */ _(D, {
155
+ open: o,
156
+ onChosen: T
164
157
  })
165
158
  })
166
159
  }) : null
167
160
  ] });
168
- }, D = ({ onDictate: e, blocked: t, disabled: n }) => /* @__PURE__ */ v("div", {
161
+ }, A = ({ onDictate: e, blocked: t, disabled: n }) => /* @__PURE__ */ v("div", {
169
162
  className: "relative flex shrink-0 items-center rounded-full border border-border-default",
170
- children: [/* @__PURE__ */ _(T, {
163
+ children: [/* @__PURE__ */ _(O, {
171
164
  onDictate: e,
172
165
  blocked: t,
173
166
  disabled: n
174
- }), t ? null : /* @__PURE__ */ _(E, { disabled: n })]
167
+ }), t ? null : /* @__PURE__ */ _(k, { disabled: n })]
175
168
  });
176
- export { D as AssistantMicMenu, y as useMicSummary };
169
+ export { A as AssistantMicMenu };
@@ -1,27 +1,28 @@
1
1
  import { DropdownMenu as e, DropdownMenuContent as t, DropdownMenuRadioGroup as n, DropdownMenuRadioItem as r, DropdownMenuTrigger as i } from "../../../../ui/dropdown-menu.js";
2
- import { focusWasDropped as a } from "../../../hooks/useReturnFocus.js";
3
- import { AUTO_WRITE_MODE as o } from "../../autoRouting.js";
4
- import { useAssistantTr as s } from "../../i18n.js";
5
- import { assistantModeShortDescriptionKey as ee, translateProductCopy as te } from "../../productCopy.js";
2
+ import { focusWasDropped as ee } from "../../../hooks/useReturnFocus.js";
3
+ import { clippingAncestor as te } from "./menuRoom.js";
4
+ import { AUTO_WRITE_MODE as a } from "../../autoRouting.js";
5
+ import { useAssistantTr as o } from "../../i18n.js";
6
+ import { assistantModeShortDescriptionKey as s, translateProductCopy as ne } from "../../productCopy.js";
6
7
  import { AUTO_MODE_OPTION_ID as c, assistantModeMeta as l } from "./AssistantModeSelector.js";
7
- import { TAB_STOP_SELECTOR as u, modeMenuItemKey as ne, modeMenuOpenIndex as re, modeMenuTriggerKey as ie, nextTabStop as d } from "./modeMenuKeys.js";
8
+ import { TAB_STOP_SELECTOR as u, modeMenuItemKey as re, modeMenuOpenIndex as ie, modeMenuTriggerKey as ae, nextTabStop as d } from "./modeMenuKeys.js";
8
9
  import { useCallback as f, useId as p, useRef as m, useState as h } from "react";
9
- import { ChevronDown as ae, Wand2 as oe } from "lucide-react";
10
- import { Fragment as se, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
+ import { Check as oe, ChevronDown as se, Wand2 as ce } from "lucide-react";
11
+ import { Fragment as le, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
12
  // src/shared/assistant/ui/composer/AssistantModeMenu.tsx
12
13
  function v(e, t) {
13
14
  return e(`mode.${t.id}`, t.label || l(t).fallback);
14
15
  }
15
- var ce = "[data-radix-focus-guard],[data-radix-menu-content]";
16
- function le(e) {
16
+ var ue = "[data-radix-focus-guard],[data-radix-menu-content]";
17
+ function de(e) {
17
18
  if (e.disabled === !0 || e.getAttribute("type") === "hidden" || e.closest("[inert],[hidden]")) return !0;
18
19
  let t = e.checkVisibility;
19
20
  return typeof t == "function" && !t.call(e);
20
21
  }
21
- var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !1, disabledReason: ue = null, readOnly: w = !1, chip: T = !1 }) => {
22
- let E = s(), D = p(), O = p(), [k, A] = h(!1);
22
+ var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !1, disabledReason: fe = null, readOnly: w = !1, chip: T = !1 }) => {
23
+ let E = o(), D = p(), O = p(), [k, A] = h(!1), [pe, me] = h(null);
23
24
  k && C && A(!1);
24
- let j = m(null), M = m([]), N = m("checked"), P = m(!1), F = S !== void 0, I = [...F ? [c] : [], ...b.map((e) => e.id)], L = S?.active ? c : y, R = I.indexOf(L), z = !!S?.active && y === "api-calls", B = b.find((e) => e.id === o), V = E("modeSelector.auto", "Auto"), H = E("modeSelector.autoHint", "Answers your questions, and proposes changes for you to approve"), de = b.find((e) => e.id === y), U = z && B ? v(E, B) : null, W = S?.active ? U ? `${V} · ${U}` : V : v(E, de ?? { id: y }), G = f((e) => {
25
+ let j = m(null), M = m([]), N = m("checked"), P = m(!1), F = S !== void 0, I = [...F ? [c] : [], ...b.map((e) => e.id)], L = S?.active ? c : y, R = I.indexOf(L), z = !!S?.active && y === "api-calls", B = b.find((e) => e.id === a), V = E("modeSelector.auto", "Auto"), he = E("modeSelector.autoHint", "Answers your questions, and proposes changes for you to approve"), ge = b.find((e) => e.id === y), H = z && B ? v(E, B) : null, U = S?.active ? H ? `${V} · ${H}` : V : v(E, ge ?? { id: y }), W = f((e) => {
25
26
  if (e === L) {
26
27
  let t = b.find((t) => t.id === e);
27
28
  t?.writeCapable && x(t.id);
@@ -38,100 +39,103 @@ var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !
38
39
  b,
39
40
  x,
40
41
  L
41
- ]), fe = f((e) => {
42
- e && C || (e ? P.current = !0 : N.current = "checked", A(e));
43
- }, [C]), pe = f((e) => {
44
- let t = ie(e.key);
42
+ ]), _e = f((e) => {
43
+ e && C || (e ? (P.current = !0, me(te(j.current))) : N.current = "checked", A(e));
44
+ }, [C]), ve = f((e) => {
45
+ let t = ae(e.key);
45
46
  t !== null && (C ? e.preventDefault() : (N.current = t, e.key === "ArrowUp" && (e.preventDefault(), P.current = !0, A(!0))));
46
- }, [C]), me = f((e) => {
47
+ }, [C]), ye = f((e) => {
47
48
  C && e.preventDefault();
48
- }, [C]), K = f((e) => {
49
+ }, [C]), G = f((e) => {
49
50
  let t = j.current;
50
51
  if (A(!1), !t) return;
51
- let n = t.ownerDocument, r = Array.from(n.querySelectorAll(u)).filter((e) => !M.current.includes(e) && !e.closest(ce)), i = r.indexOf(t);
52
+ let n = t.ownerDocument, r = Array.from(n.querySelectorAll(u)).filter((e) => !M.current.includes(e) && !e.closest(ue)), i = r.indexOf(t);
52
53
  (r[i < 0 ? -1 : d(r.map((e) => ({
53
54
  tabIndex: e.tabIndex,
54
- unreachable: le(e)
55
+ unreachable: de(e)
55
56
  })), i, e)] ?? t).focus();
56
- }, []), q = f((e) => {
57
+ }, []), K = f((e) => {
57
58
  if (e.defaultPrevented) return;
58
- let t = M.current.slice(0, I.length), n = t.findIndex((t) => t !== null && t === e.target), r = ne(e.key, {
59
+ let t = M.current.slice(0, I.length), n = t.findIndex((t) => t !== null && t === e.target), r = re(e.key, {
59
60
  shiftKey: e.shiftKey,
60
61
  index: n,
61
62
  count: I.length
62
63
  });
63
- r.kind === "move" ? (e.preventDefault(), t[r.index]?.focus()) : r.kind === "tab-out" && (e.preventDefault(), K(r.direction));
64
- }, [I.length, K]), he = f((e) => {
64
+ r.kind === "move" ? (e.preventDefault(), t[r.index]?.focus()) : r.kind === "tab-out" && (e.preventDefault(), G(r.direction));
65
+ }, [I.length, G]), q = f((e) => {
65
66
  if (!P.current || e.target !== e.currentTarget) return;
66
67
  P.current = !1, e.preventDefault();
67
- let t = re(N.current, R, I.length);
68
+ let t = ie(N.current, R, I.length);
68
69
  N.current = "checked", M.current[t]?.focus();
69
- }, [R, I.length]), J = f((e) => {
70
+ }, [R, I.length]), be = f((e) => {
70
71
  let t = j.current;
71
- t && !a(t.ownerDocument) && e.preventDefault();
72
- }, []), ge = f((e) => {
73
- j.current?.focus(), G(e);
74
- }, [G]);
72
+ t && !ee(t.ownerDocument) && e.preventDefault();
73
+ }, []), xe = f((e) => {
74
+ j.current?.focus(), W(e);
75
+ }, [W]);
75
76
  if (I.length === 0) return null;
76
- let Y = E("modeMenu.staticLabel", "Mode: {{mode}}", { mode: W }), X = S?.active ? oe : l({ id: y }).icon;
77
+ let J = E("modeMenu.staticLabel", "Mode: {{mode}}", { mode: U }), Y = S?.active ? ce : l({ id: y }).icon;
77
78
  if (I.length === 1 && !b.some((e) => e.writeCapable) || w) return T ? /* @__PURE__ */ _("span", {
78
79
  className: "inline-flex h-8 min-w-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-border-default px-2.5 text-[13px] leading-tight text-text-secondary sm:h-[30px]",
79
- title: w ? E("modeMenu.readOnlyHint", "Change the mode in the full assistant") : Y,
80
+ title: w ? E("modeMenu.readOnlyHint", "Change the mode in the full assistant") : J,
80
81
  "data-testid": "assistant-mode-static",
81
82
  "data-mode-id": y,
82
83
  children: [
83
- /* @__PURE__ */ g(X, {
84
+ /* @__PURE__ */ g(Y, {
84
85
  className: "size-3.5 shrink-0",
85
86
  "aria-hidden": "true"
86
87
  }),
87
88
  /* @__PURE__ */ g("span", {
88
89
  className: "truncate",
89
90
  "aria-hidden": "true",
90
- children: W
91
+ children: U
91
92
  }),
92
93
  /* @__PURE__ */ g("span", {
93
94
  className: "sr-only",
94
95
  "data-testid": "assistant-mode-static-label",
95
- children: Y
96
+ children: J
96
97
  })
97
98
  ]
98
99
  }) : /* @__PURE__ */ g("span", {
99
100
  className: "inline-flex h-9 items-center px-3 text-sm text-text-secondary",
100
101
  "data-testid": "assistant-mode-static",
101
102
  "data-mode-id": y,
102
- children: E("modeMenu.staticLabel", "Mode: {{mode}}", { mode: W })
103
+ children: E("modeMenu.staticLabel", "Mode: {{mode}}", { mode: U })
103
104
  });
104
- let Z = ue === "replying" ? E("modeMenu.disabledReplying", "Mode can't change while the assistant is replying. Stop the reply to change it.") : E("modeMenu.disabledBusy", "Mode can't change right now."), Q = "min-h-11 items-start gap-0 py-2 pe-3", $ = (e) => (t) => {
105
+ let X = fe === "replying" ? E("modeMenu.disabledReplying", "Mode can't change while the assistant is replying. Stop the reply to change it.") : E("modeMenu.disabledBusy", "Mode can't change right now."), Z = "min-h-11 items-start gap-0 rounded-lg py-2 pe-3 data-[state=checked]:bg-action-primary-bg/10", Q = /* @__PURE__ */ g(oe, {
106
+ className: "size-4 text-action-primary-bg",
107
+ "aria-hidden": "true"
108
+ }), $ = (e) => (t) => {
105
109
  M.current[e] = t;
106
110
  };
107
- return /* @__PURE__ */ _(se, { children: [/* @__PURE__ */ _(e, {
111
+ return /* @__PURE__ */ _(le, { children: [/* @__PURE__ */ _(e, {
108
112
  open: k,
109
- onOpenChange: fe,
113
+ onOpenChange: _e,
110
114
  modal: !1,
111
115
  children: [/* @__PURE__ */ g(i, {
112
116
  asChild: !0,
113
117
  children: /* @__PURE__ */ _("button", {
114
118
  ref: j,
115
119
  type: "button",
116
- "aria-label": T ? Y : E("modeMenu.trigger", "Assistant mode: {{mode}}", { mode: W }),
120
+ "aria-label": T ? J : E("modeMenu.trigger", "Assistant mode: {{mode}}", { mode: U }),
117
121
  "aria-disabled": C || void 0,
118
122
  "aria-describedby": C ? D : void 0,
119
- title: C ? Z : void 0,
120
- onKeyDown: pe,
121
- onPointerDown: me,
123
+ title: C ? X : void 0,
124
+ onKeyDown: ve,
125
+ onPointerDown: ye,
122
126
  className: `${T ? "inline-flex h-11 min-w-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-border-default px-2.5 text-[13px] font-medium leading-tight text-text-primary transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10" : "inline-flex h-9 min-w-0 items-center gap-2 rounded-full ps-3 pe-2 text-sm font-medium text-text-primary transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"} ${C ? "cursor-not-allowed opacity-50" : "hover:bg-bg-surface"}`,
123
127
  "data-testid": "assistant-mode-selector",
124
128
  "data-selected-mode-id": L,
125
129
  children: [
126
- /* @__PURE__ */ g(X, {
130
+ /* @__PURE__ */ g(Y, {
127
131
  className: "size-4 shrink-0 text-text-secondary",
128
132
  "aria-hidden": "true"
129
133
  }),
130
134
  /* @__PURE__ */ g("span", {
131
135
  className: "truncate",
132
- children: W
136
+ children: U
133
137
  }),
134
- /* @__PURE__ */ g(ae, {
138
+ /* @__PURE__ */ g(se, {
135
139
  className: "size-4 shrink-0 text-text-muted",
136
140
  "aria-hidden": "true"
137
141
  })
@@ -140,25 +144,28 @@ var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !
140
144
  }), /* @__PURE__ */ g(t, {
141
145
  side: "top",
142
146
  align: "start",
143
- sideOffset: 8,
147
+ sideOffset: 10,
144
148
  collisionPadding: 8,
145
- onFocus: he,
146
- onCloseAutoFocus: J,
147
- onKeyDown: q,
148
- className: "w-72 max-w-[calc(100vw-2rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",
149
+ collisionBoundary: pe,
150
+ avoidCollisions: !1,
151
+ onFocus: q,
152
+ onCloseAutoFocus: be,
153
+ onKeyDown: K,
154
+ className: "scrollbar-slim scrollbar-box w-72 max-w-[calc(100vw-2rem)] max-h-[min(22.5rem,var(--radix-dropdown-menu-content-available-height))] overflow-y-auto overscroll-contain",
149
155
  "data-testid": "assistant-mode-menu",
150
156
  children: /* @__PURE__ */ _(n, {
151
157
  value: L,
152
- onValueChange: ge,
158
+ onValueChange: xe,
153
159
  children: [F ? /* @__PURE__ */ g(r, {
154
160
  ref: $(0),
155
161
  value: c,
156
- onKeyDown: q,
162
+ onKeyDown: K,
157
163
  "aria-labelledby": `${O}-label-0`,
158
164
  "aria-describedby": `${O}-description-0`,
159
- className: Q,
165
+ className: Z,
166
+ indicator: Q,
160
167
  "data-testid": "assistant-mode-auto",
161
- "data-auto-routed": z ? o : void 0,
168
+ "data-auto-routed": z ? a : void 0,
162
169
  children: /* @__PURE__ */ _("span", {
163
170
  className: "flex min-w-0 flex-col",
164
171
  children: [/* @__PURE__ */ g("span", {
@@ -169,18 +176,19 @@ var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !
169
176
  id: `${O}-description-0`,
170
177
  className: "text-xs text-text-secondary",
171
178
  "data-testid": "assistant-mode-description",
172
- children: H
179
+ children: he
173
180
  })]
174
181
  })
175
182
  }) : null, b.map((e, t) => {
176
- let n = t + +!!F, i = e.shortDescription?.trim() ? te(E, ee(e.id), e.shortDescription) : null;
183
+ let n = t + +!!F, i = e.shortDescription?.trim() ? ne(E, s(e.id), e.shortDescription) : null;
177
184
  return /* @__PURE__ */ g(r, {
178
185
  ref: $(n),
179
186
  value: e.id,
180
- onKeyDown: q,
187
+ onKeyDown: K,
181
188
  "aria-labelledby": `${O}-label-${n}`,
182
189
  "aria-describedby": i ? `${O}-description-${n}` : void 0,
183
- className: Q,
190
+ className: Z,
191
+ indicator: Q,
184
192
  "data-testid": `assistant-mode-option-${e.id}`,
185
193
  children: /* @__PURE__ */ _("span", {
186
194
  className: "flex min-w-0 flex-col",
@@ -203,7 +211,7 @@ var y = ({ mode: y, availableModes: b, onModeChange: x, auto: S, disabled: C = !
203
211
  id: D,
204
212
  className: "sr-only",
205
213
  "data-testid": "assistant-mode-disabled-reason",
206
- children: Z
214
+ children: X
207
215
  }) : null] });
208
216
  };
209
217
  export { y as AssistantModeMenu, v as assistantModeOptionName };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Where a menu that opens UP from the message box may go (BOFF-13461, the
3
+ * operator's menu fix of 14 Nov): never above what clips the box. On a page that
4
+ * is the content area under the app's top bar, not the screen's top edge; a menu
5
+ * measured to the screen ran behind the bar, its first rows cut off.
6
+ */
7
+ /** The nearest ancestor of `node` that clips its content (scrolls or hides overflow); null: none, the viewport. */
8
+ export declare function clippingAncestor(node: Element | null): HTMLElement | null;
9
+ /** The room above `anchor` for a menu: to the top of what clips it, less `gap` to the anchor and `edge` to that top. */
10
+ export declare function roomAbove(anchor: Element, gap: number, edge: number): number;
@@ -0,0 +1,14 @@
1
+ // src/shared/assistant/ui/composer/menuRoom.ts
2
+ function e(e) {
3
+ if (typeof getComputedStyle != "function") return null;
4
+ for (let t = e?.parentElement ?? null; t; t = t.parentElement) {
5
+ if (t === document.body || t === document.documentElement) return null;
6
+ if (getComputedStyle(t).overflowY !== "visible") return t;
7
+ }
8
+ return null;
9
+ }
10
+ function t(t, n, r) {
11
+ let i = e(t), a = Math.max(0, i ? i.getBoundingClientRect().top : 0);
12
+ return t.getBoundingClientRect().top - a - n - r;
13
+ }
14
+ export { e as clippingAncestor, t as roomAbove };