@opencode/ui 2.2.1 → 2.2.3

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.
Files changed (146) hide show
  1. package/dist/context/helper.d.ts +1 -0
  2. package/dist/data-display/keybind/keybind.d.ts +1 -1
  3. package/dist/data-display/line-comment/line-comment.d.ts +4 -2
  4. package/dist/i18n/am.d.ts +246 -1
  5. package/dist/i18n/ar.d.ts +0 -3
  6. package/dist/i18n/az.d.ts +246 -1
  7. package/dist/i18n/bg.d.ts +0 -3
  8. package/dist/i18n/bn.d.ts +246 -1
  9. package/dist/i18n/br.d.ts +0 -3
  10. package/dist/i18n/bs.d.ts +0 -3
  11. package/dist/i18n/ca.d.ts +260 -1
  12. package/dist/i18n/cs.d.ts +274 -1
  13. package/dist/i18n/da.d.ts +0 -3
  14. package/dist/i18n/de.d.ts +0 -3
  15. package/dist/i18n/dv.d.ts +246 -1
  16. package/dist/i18n/dz.d.ts +246 -1
  17. package/dist/i18n/el.d.ts +246 -1
  18. package/dist/i18n/en.d.ts +5 -3
  19. package/dist/i18n/es.d.ts +0 -3
  20. package/dist/i18n/et.d.ts +246 -1
  21. package/dist/i18n/fa.d.ts +246 -1
  22. package/dist/i18n/fi.d.ts +246 -1
  23. package/dist/i18n/fo.d.ts +246 -1
  24. package/dist/i18n/fr.d.ts +0 -3
  25. package/dist/i18n/he.d.ts +0 -3
  26. package/dist/i18n/hi.d.ts +246 -1
  27. package/dist/i18n/hr.d.ts +260 -1
  28. package/dist/i18n/hu.d.ts +246 -1
  29. package/dist/i18n/hy.d.ts +246 -1
  30. package/dist/i18n/id.d.ts +246 -1
  31. package/dist/i18n/is.d.ts +246 -1
  32. package/dist/i18n/it.d.ts +260 -1
  33. package/dist/i18n/ja.d.ts +0 -3
  34. package/dist/i18n/ka.d.ts +246 -1
  35. package/dist/i18n/km.d.ts +0 -3
  36. package/dist/i18n/ko.d.ts +0 -3
  37. package/dist/i18n/lo.d.ts +0 -3
  38. package/dist/i18n/lt.d.ts +274 -1
  39. package/dist/i18n/lv.d.ts +260 -1
  40. package/dist/i18n/mk.d.ts +0 -3
  41. package/dist/i18n/mn.d.ts +0 -3
  42. package/dist/i18n/ms.d.ts +246 -1
  43. package/dist/i18n/my.d.ts +0 -3
  44. package/dist/i18n/ne.d.ts +246 -1
  45. package/dist/i18n/nl.d.ts +246 -1
  46. package/dist/i18n/pa.d.ts +246 -1
  47. package/dist/i18n/pl.d.ts +0 -3
  48. package/dist/i18n/ro.d.ts +260 -1
  49. package/dist/i18n/ru.d.ts +0 -3
  50. package/dist/i18n/si.d.ts +246 -1
  51. package/dist/i18n/sk.d.ts +274 -1
  52. package/dist/i18n/sl.d.ts +274 -1
  53. package/dist/i18n/sq.d.ts +246 -1
  54. package/dist/i18n/sr.d.ts +0 -3
  55. package/dist/i18n/sv.d.ts +246 -1
  56. package/dist/i18n/tg.d.ts +0 -3
  57. package/dist/i18n/th.d.ts +0 -3
  58. package/dist/i18n/tk.d.ts +246 -1
  59. package/dist/i18n/tr.d.ts +0 -3
  60. package/dist/i18n/uk.d.ts +274 -1
  61. package/dist/i18n/ur.d.ts +246 -1
  62. package/dist/i18n/uz.d.ts +246 -1
  63. package/dist/i18n/vi.d.ts +246 -1
  64. package/dist/i18n/zh.d.ts +0 -3
  65. package/dist/i18n/zht.d.ts +0 -3
  66. package/dist/theme/context.d.ts +16 -0
  67. package/package.json +3 -2
  68. package/src/components/image-preview.css +3 -2
  69. package/src/components/image-preview.tsx +4 -0
  70. package/src/components/truncated-text.tsx +2 -1
  71. package/src/context/helper.tsx +4 -3
  72. package/src/context/marked-base.tsx +5 -1
  73. package/src/data-display/keybind/keybind.css +11 -3
  74. package/src/data-display/keybind/keybind.tsx +1 -1
  75. package/src/data-display/line-comment/line-comment.css +91 -0
  76. package/src/data-display/line-comment/line-comment.tsx +199 -95
  77. package/src/data-display/line-comment/quote-check.svg +3 -0
  78. package/src/feedback/toast/toast.tsx +11 -31
  79. package/src/forms/select/select.css +0 -28
  80. package/src/forms/typeahead/typeahead.tsx +9 -2
  81. package/src/i18n/am.ts +1 -5
  82. package/src/i18n/ar.ts +0 -4
  83. package/src/i18n/az.ts +1 -5
  84. package/src/i18n/bg.ts +0 -4
  85. package/src/i18n/bn.ts +1 -5
  86. package/src/i18n/br.ts +0 -4
  87. package/src/i18n/bs.ts +0 -4
  88. package/src/i18n/ca.ts +1 -5
  89. package/src/i18n/cs.ts +1 -5
  90. package/src/i18n/da.ts +0 -4
  91. package/src/i18n/de.ts +0 -4
  92. package/src/i18n/dv.ts +1 -5
  93. package/src/i18n/dz.ts +1 -5
  94. package/src/i18n/el.ts +1 -5
  95. package/src/i18n/en.ts +5 -4
  96. package/src/i18n/es.ts +0 -4
  97. package/src/i18n/et.ts +1 -5
  98. package/src/i18n/fa.ts +1 -5
  99. package/src/i18n/fi.ts +1 -5
  100. package/src/i18n/fo.ts +1 -5
  101. package/src/i18n/fr.ts +0 -4
  102. package/src/i18n/he.ts +0 -4
  103. package/src/i18n/hi.ts +1 -5
  104. package/src/i18n/hr.ts +1 -5
  105. package/src/i18n/hu.ts +1 -5
  106. package/src/i18n/hy.ts +1 -5
  107. package/src/i18n/id.ts +1 -5
  108. package/src/i18n/is.ts +1 -5
  109. package/src/i18n/it.ts +1 -5
  110. package/src/i18n/ja.ts +0 -4
  111. package/src/i18n/ka.ts +1 -5
  112. package/src/i18n/km.ts +0 -4
  113. package/src/i18n/ko.ts +0 -4
  114. package/src/i18n/lo.ts +0 -4
  115. package/src/i18n/lt.ts +1 -5
  116. package/src/i18n/lv.ts +1 -5
  117. package/src/i18n/mk.ts +0 -4
  118. package/src/i18n/mn.ts +0 -4
  119. package/src/i18n/ms.ts +1 -5
  120. package/src/i18n/my.ts +0 -4
  121. package/src/i18n/ne.ts +1 -5
  122. package/src/i18n/nl.ts +1 -5
  123. package/src/i18n/no.ts +0 -4
  124. package/src/i18n/pa.ts +1 -5
  125. package/src/i18n/pl.ts +0 -4
  126. package/src/i18n/ro.ts +1 -5
  127. package/src/i18n/ru.ts +0 -4
  128. package/src/i18n/si.ts +1 -5
  129. package/src/i18n/sk.ts +1 -5
  130. package/src/i18n/sl.ts +1 -5
  131. package/src/i18n/sq.ts +1 -5
  132. package/src/i18n/sr.ts +0 -4
  133. package/src/i18n/sv.ts +1 -5
  134. package/src/i18n/tg.ts +0 -4
  135. package/src/i18n/th.ts +0 -4
  136. package/src/i18n/tk.ts +1 -5
  137. package/src/i18n/tr.ts +0 -4
  138. package/src/i18n/uk.ts +1 -5
  139. package/src/i18n/ur.ts +1 -5
  140. package/src/i18n/uz.ts +1 -5
  141. package/src/i18n/vi.ts +1 -5
  142. package/src/i18n/zh.ts +0 -3
  143. package/src/i18n/zht.ts +0 -3
  144. package/src/icons/new-icons.ts +2 -1
  145. package/src/navigation/menu/menu.css +0 -11
  146. package/src/navigation/tabs/tabs.css +19 -0
@@ -1,8 +1,24 @@
1
- import { For, Show, createSignal, onMount, splitProps, type ComponentProps, type JSX } from "solid-js"
1
+ import {
2
+ For,
3
+ Show,
4
+ createEffect,
5
+ createSignal,
6
+ on,
7
+ onCleanup,
8
+ onMount,
9
+ splitProps,
10
+ type ComponentProps,
11
+ type JSX,
12
+ } from "solid-js"
2
13
  import { FileIcon } from "@opencode/ui/file-icon"
3
14
  import { useI18n } from "../../context/i18n"
4
15
  import { useFilteredList } from "../../hooks"
5
16
  import { Button } from "@opencode/ui/button"
17
+ import { Icon } from "@opencode/ui/icon"
18
+ import { IconButton } from "@opencode/ui/icon-button"
19
+ import { Keybind } from "@opencode/ui/keybind"
20
+ import { Tooltip } from "@opencode/ui/tooltip"
21
+ import check from "./quote-check.svg"
6
22
  import "./line-comment.css"
7
23
 
8
24
  /** Horizontal “more” glyph for the display-card overflow control (Figma outline-dots). */
@@ -72,14 +88,16 @@ export interface LineCommentEditorProps extends Omit<ComponentProps<"div">, "chi
72
88
  onInput: (value: string) => void
73
89
  onCancel: () => void
74
90
  onSubmit: (value: string) => void
75
- /** Optional context in the footer, e.g. the page or element being commented on. */
91
+ /** Optional context in the footer, or above the input in the compact variant. */
76
92
  selection?: JSX.Element
93
+ /** Compact layout with a growing input and inline action. */
94
+ variant?: "default" | "compact"
77
95
  placeholder?: string
78
96
  rows?: number
79
97
  cancelLabel?: string
80
98
  submitLabel?: string
81
99
  autofocus?: boolean
82
- /** Submit an empty value too, such as to clear a comment that exists (default: false). */
100
+ /** Submit an empty value too, such as to clear a comment that exists (default: false). Compact empty actions otherwise cancel. */
83
101
  allowEmpty?: boolean
84
102
  mention?: LineCommentEditorMention
85
103
  }
@@ -108,6 +126,7 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
108
126
  "onCancel",
109
127
  "onSubmit",
110
128
  "selection",
129
+ "variant",
111
130
  "placeholder",
112
131
  "rows",
113
132
  "cancelLabel",
@@ -120,6 +139,12 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
120
139
  ])
121
140
 
122
141
  const canSubmit = () => !!local.allowEmpty || local.value.trim().length > 0
142
+ const compactCancel = () => !canSubmit()
143
+
144
+ const compactLabel = () =>
145
+ compactCancel()
146
+ ? (local.cancelLabel ?? i18n.t("ui.lineComment.cancel"))
147
+ : (local.submitLabel ?? i18n.t("ui.lineComment.submit"))
123
148
 
124
149
  const closeMention = () => {
125
150
  setMentionOpen(false)
@@ -215,124 +240,203 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
215
240
  requestAnimationFrame(() => textareaRef?.focus())
216
241
  })
217
242
 
243
+ onMount(() => {
244
+ if (CSS.supports("field-sizing", "content")) return
245
+
246
+ createEffect(() => {
247
+ const textarea = textareaRef
248
+
249
+ if (local.variant !== "compact" || !textarea) return
250
+
251
+ const resize = () => {
252
+ // Reset before measuring so the field can shrink as well as grow.
253
+ textarea.style.height = "0px"
254
+ textarea.style.height = `${textarea.scrollHeight}px`
255
+ }
256
+
257
+ createEffect(on(() => local.value, resize))
258
+
259
+ let width = 0
260
+
261
+ const observer = new ResizeObserver(([entry]) => {
262
+ if (!entry || entry.contentRect.width === width) return
263
+ width = entry.contentRect.width
264
+ resize()
265
+ })
266
+
267
+ observer.observe(textarea)
268
+ onCleanup(() => {
269
+ observer.disconnect()
270
+ textarea.style.removeProperty("height")
271
+ })
272
+ })
273
+ })
274
+
218
275
  return (
219
276
  <div
220
277
  {...rest}
221
278
  data-component="line-comment-v2"
222
279
  data-variant="editor"
280
+ data-layout={local.variant ?? "default"}
223
281
  classList={{
224
282
  ...local.classList,
225
283
  [local.class ?? ""]: !!local.class,
226
284
  }}
227
285
  >
228
286
  <div data-slot="line-comment-v2-shell">
229
- <div data-slot="line-comment-v2-field">
230
- <textarea
231
- ref={(el) => {
232
- textareaRef = el
233
- }}
234
- data-slot="line-comment-v2-textarea"
235
- aria-label={local.label ?? i18n.t("ui.lineComment.submit")}
236
- dir="auto"
237
- rows={local.rows ?? 4}
238
- placeholder={local.placeholder ?? i18n.t("ui.lineComment.contextPlaceholder")}
239
- value={local.value}
240
- style={{ "unicode-bidi": "plaintext", "text-align": "start" }}
241
- onInput={(e) => {
242
- local.onInput(e.currentTarget.value)
243
- syncMention()
244
- }}
245
- onClick={() => syncMention()}
246
- onSelect={() => syncMention()}
247
- onKeyDown={(e) => {
248
- e.stopPropagation()
249
-
250
- if (e.isComposing || e.keyCode === 229) return
251
-
252
- if (mentionOpen()) {
253
- if (e.key === "Escape") {
254
- e.preventDefault()
255
- closeMention()
256
-
257
- return
287
+ <Show when={local.variant === "compact" && local.selection}>
288
+ {(selection) => <div data-slot="line-comment-v2-preview">{selection()}</div>}
289
+ </Show>
290
+ <div data-slot="line-comment-v2-input">
291
+ <div data-slot="line-comment-v2-field">
292
+ <textarea
293
+ ref={(el) => {
294
+ textareaRef = el
295
+ }}
296
+ data-slot="line-comment-v2-textarea"
297
+ data-scrollable
298
+ aria-label={local.label ?? i18n.t("ui.lineComment.submit")}
299
+ dir="auto"
300
+ rows={local.rows ?? (local.variant === "compact" ? 1 : 4)}
301
+ placeholder={local.placeholder ?? i18n.t("ui.lineComment.contextPlaceholder")}
302
+ value={local.value}
303
+ style={{ "unicode-bidi": "plaintext", "text-align": "start" }}
304
+ onInput={(e) => {
305
+ local.onInput(e.currentTarget.value)
306
+ syncMention()
307
+ }}
308
+ onClick={() => syncMention()}
309
+ onSelect={() => syncMention()}
310
+ onKeyDown={(e) => {
311
+ e.stopPropagation()
312
+
313
+ if (e.isComposing || e.keyCode === 229) return
314
+
315
+ if (mentionOpen()) {
316
+ if (e.key === "Escape") {
317
+ e.preventDefault()
318
+ closeMention()
319
+
320
+ return
321
+ }
322
+
323
+ if (e.key === "Tab") {
324
+ if (mention.flat().length === 0) return
325
+ e.preventDefault()
326
+ selectActiveMention()
327
+
328
+ return
329
+ }
330
+
331
+ const nav = e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter"
332
+
333
+ const ctrlNav =
334
+ e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
335
+
336
+ if ((nav || ctrlNav) && mention.flat().length > 0) {
337
+ mention.onKeyDown(e)
338
+ e.preventDefault()
339
+
340
+ return
341
+ }
258
342
  }
259
343
 
260
- if (e.key === "Tab") {
261
- if (mention.flat().length === 0) return
344
+ if (e.key === "Escape") {
262
345
  e.preventDefault()
263
- selectActiveMention()
346
+ e.currentTarget.blur()
347
+ local.onCancel()
264
348
 
265
349
  return
266
350
  }
267
351
 
268
- const nav = e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter"
269
- const ctrlNav = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
270
-
271
- if ((nav || ctrlNav) && mention.flat().length > 0) {
272
- mention.onKeyDown(e)
352
+ if (e.key === "Enter" && !e.shiftKey) {
273
353
  e.preventDefault()
274
-
275
- return
354
+ submit()
276
355
  }
356
+ }}
357
+ />
358
+ <Show when={mentionOpen() && mention.flat().length > 0}>
359
+ <div data-slot="line-comment-v2-mention-list">
360
+ <For each={mention.flat().slice(0, 10)}>
361
+ {(item) => {
362
+ const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
363
+ const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
364
+
365
+ return (
366
+ <button
367
+ type="button"
368
+ data-slot="line-comment-v2-mention-item"
369
+ data-active={mention.active() === item.path ? "" : undefined}
370
+ onMouseDown={(event) => event.preventDefault()}
371
+ onMouseEnter={() => mention.setActive(item.path)}
372
+ onClick={() => selectMention(item)}
373
+ >
374
+ <FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
375
+ <div data-slot="line-comment-v2-mention-path">
376
+ <span data-slot="line-comment-v2-mention-dir">{directory}</span>
377
+ <Show when={name}>
378
+ <span data-slot="line-comment-v2-mention-file">{name}</span>
379
+ </Show>
380
+ </div>
381
+ </button>
382
+ )
383
+ }}
384
+ </For>
385
+ </div>
386
+ </Show>
387
+ </div>
388
+ <Show when={local.variant === "compact"}>
389
+ <Tooltip
390
+ value={
391
+ <>
392
+ {compactLabel()} <Keybind keys={[compactCancel() ? "Esc" : "⏎"]} variant="neutral" />
393
+ </>
277
394
  }
278
-
279
- if (e.key === "Escape") {
280
- e.preventDefault()
281
- e.currentTarget.blur()
282
- local.onCancel()
283
-
284
- return
285
- }
286
-
287
- if (e.key === "Enter" && !e.shiftKey) {
288
- e.preventDefault()
289
- submit()
290
- }
291
- }}
292
- />
293
- <Show when={mentionOpen() && mention.flat().length > 0}>
294
- <div data-slot="line-comment-v2-mention-list">
295
- <For each={mention.flat().slice(0, 10)}>
296
- {(item) => {
297
- const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
298
- const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
299
-
300
- return (
301
- <button
302
- type="button"
303
- data-slot="line-comment-v2-mention-item"
304
- data-active={mention.active() === item.path ? "" : undefined}
305
- onMouseDown={(event) => event.preventDefault()}
306
- onMouseEnter={() => mention.setActive(item.path)}
307
- onClick={() => selectMention(item)}
308
- >
309
- <FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
310
- <div data-slot="line-comment-v2-mention-path">
311
- <span data-slot="line-comment-v2-mention-dir">{directory}</span>
312
- <Show when={name}>
313
- <span data-slot="line-comment-v2-mention-file">{name}</span>
314
- </Show>
315
- </div>
316
- </button>
395
+ placement="top"
396
+ >
397
+ <IconButton
398
+ data-slot="line-comment-v2-submit"
399
+ type="button"
400
+ size="small"
401
+ variant={local.value.trim() ? "neutral" : "ghost-muted"}
402
+ icon={
403
+ compactCancel() ? (
404
+ <Icon name="close" />
405
+ ) : (
406
+ <span
407
+ aria-hidden="true"
408
+ data-slot="line-comment-v2-submit-icon"
409
+ style={{ mask: `url("${check}") center / contain no-repeat` }}
410
+ />
317
411
  )
412
+ }
413
+ aria-label={compactLabel()}
414
+ onClick={() => (compactCancel() ? local.onCancel() : submit())}
415
+ onKeyDown={(event) => {
416
+ if (event.key !== "Escape" || event.isComposing) return
417
+ event.preventDefault()
418
+ event.stopPropagation()
419
+ local.onCancel()
318
420
  }}
319
- </For>
320
- </div>
421
+ />
422
+ </Tooltip>
321
423
  </Show>
322
424
  </div>
323
- <div data-slot="line-comment-v2-footer">
324
- <Show when={local.selection}>
325
- {(selection) => <div data-slot="line-comment-v2-footer-meta">{selection()}</div>}
326
- </Show>
327
- <div data-slot="line-comment-v2-footer-actions">
328
- <Button type="button" size="small" variant="ghost" onClick={() => local.onCancel()}>
329
- {local.cancelLabel ?? i18n.t("ui.lineComment.cancel")}
330
- </Button>
331
- <Button type="button" size="small" variant="contrast" disabled={!canSubmit()} onClick={submit}>
332
- {local.submitLabel ?? i18n.t("ui.lineComment.submit")}
333
- </Button>
425
+ <Show when={local.variant !== "compact"}>
426
+ <div data-slot="line-comment-v2-footer">
427
+ <Show when={local.selection}>
428
+ {(selection) => <div data-slot="line-comment-v2-footer-meta">{selection()}</div>}
429
+ </Show>
430
+ <div data-slot="line-comment-v2-footer-actions">
431
+ <Button type="button" size="small" variant="ghost" onClick={() => local.onCancel()}>
432
+ {local.cancelLabel ?? i18n.t("ui.lineComment.cancel")}
433
+ </Button>
434
+ <Button type="button" size="small" variant="contrast" disabled={!canSubmit()} onClick={submit}>
435
+ {local.submitLabel ?? i18n.t("ui.lineComment.submit")}
436
+ </Button>
437
+ </div>
334
438
  </div>
335
- </div>
439
+ </Show>
336
440
  </div>
337
441
  </div>
338
442
  )
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M2.44444 8.22222L6 12.6667L13.5556 3.33333" stroke-linecap="square" stroke="currentColor"/>
3
+ </svg>
@@ -2,7 +2,7 @@ import { Toaster, toast, type ToasterProps } from "solid-sonner"
2
2
  import { boundToastDescription } from "./description"
3
3
  import { isRTL } from "@kobalte/core/i18n"
4
4
  import type { ComponentProps, JSX } from "solid-js"
5
- import { createContext, onCleanup, onMount, splitProps, useContext } from "solid-js"
5
+ import { createContext, onCleanup, splitProps, useContext } from "solid-js"
6
6
  import { Portal } from "solid-js/web"
7
7
  import { useI18n } from "../../context/i18n"
8
8
  import "../../actions/button/button.css"
@@ -14,46 +14,26 @@ export interface ToastRegionProps extends ToasterProps {}
14
14
  function ToastRegion(props: ToastRegionProps) {
15
15
  const i18n = useI18n()
16
16
  const [local, rest] = splitProps(props, ["class", "className", "style", "toastOptions", "swipeDirections"])
17
- onMount(() => {
17
+
18
+ // The Portal's container holds the toast region whenever it exists. Watching the container, not the whole body,
19
+ // keeps every DOM change elsewhere in the page (each streamed delta, each mounted row) from scanning the document.
20
+ const observe = (container: HTMLDivElement) => {
18
21
  const sync = () => {
19
- document.querySelectorAll<HTMLElement>(".toast-v2-region .toast-v2").forEach((element) => {
22
+ container.querySelectorAll<HTMLElement>(".toast-v2-region .toast-v2").forEach((element) => {
20
23
  const hidden = element.dataset.visible === "false"
21
24
  element.inert = hidden
22
25
  element.tabIndex = hidden ? -1 : 0
23
26
  })
24
27
  }
25
28
 
26
- let connected = false
27
-
28
- const connect = () => {
29
- const regions = document.querySelectorAll(".toast-v2-region")
30
-
31
- if (!regions.length) return
32
- observer.disconnect()
33
- regions.forEach((region) => {
34
- observer.observe(region, {
35
- subtree: true,
36
- childList: true,
37
- attributes: true,
38
- attributeFilter: ["data-visible"],
39
- })
40
- })
41
- connected = true
42
- sync()
43
- }
44
-
45
- const observer = new MutationObserver(() => {
46
- if (!connected) connect()
47
- else sync()
48
- })
49
-
50
- observer.observe(document.body, { subtree: true, childList: true })
51
- queueMicrotask(connect)
29
+ const observer = new MutationObserver(sync)
30
+ observer.observe(container, { subtree: true, childList: true, attributes: true, attributeFilter: ["data-visible"] })
31
+ sync()
52
32
  onCleanup(() => observer.disconnect())
53
- })
33
+ }
54
34
 
55
35
  return (
56
- <Portal>
36
+ <Portal ref={observe}>
57
37
  <Toaster
58
38
  position={isRTL(i18n.locale()) ? "bottom-left" : "bottom-right"}
59
39
  offset={isRTL(i18n.locale()) ? { left: 32, bottom: 48 } : { right: 32, bottom: 48 }}
@@ -16,34 +16,6 @@
16
16
  background: var(--v2-background-bg-layer-01);
17
17
  border-radius: 6px;
18
18
  box-shadow: var(--v2-elevation-floating);
19
- transform-origin: top center;
20
- animation: select-v2-content-in 120ms ease-out;
21
- }
22
-
23
- [data-component="menu-v2-content"][data-slot="select-v2-content"][data-closed] {
24
- animation: select-v2-content-out 80ms ease-in forwards;
25
- }
26
-
27
- @keyframes select-v2-content-in {
28
- from {
29
- opacity: 0;
30
- transform: translateY(-2px);
31
- }
32
- to {
33
- opacity: 1;
34
- transform: translateY(0);
35
- }
36
- }
37
-
38
- @keyframes select-v2-content-out {
39
- from {
40
- opacity: 1;
41
- transform: translateY(0);
42
- }
43
- to {
44
- opacity: 0;
45
- transform: translateY(-2px);
46
- }
47
19
  }
48
20
 
49
21
  /* Shared trigger structure for the inline control. */
@@ -152,6 +152,7 @@ export function Typeahead<T>(props: {
152
152
  </button>
153
153
  </Show>
154
154
  </div>
155
+ <div aria-hidden="true" class="h-[0.5px] shrink-0 bg-v2-border-border-base" />
155
156
  {/* Initial results and the empty state snap into place; other search resizing animates. */}
156
157
  <div
157
158
  class="overflow-hidden duration-[200ms] ease-[cubic-bezier(0.645,0.045,0.355,1)] motion-reduce:transition-none"
@@ -164,7 +165,13 @@ export function Typeahead<T>(props: {
164
165
  )
165
166
  }
166
167
  >
167
- <div id={typeahead.listID} role="listbox" class="max-h-56 overflow-y-auto px-1 pb-1 empty:hidden">
168
+ {/* A stable gutter keeps rows from shifting when the list overflows; the end padding gives way to it. */}
169
+ <div
170
+ id={typeahead.listID}
171
+ role="listbox"
172
+ data-scrollable
173
+ class="max-h-56 overflow-y-auto py-1 ps-1 pe-[max(0px,calc(4px-var(--scrollbar-size,0px)))] [scrollbar-gutter:stable] empty:hidden"
174
+ >
168
175
  <For each={results().items}>
169
176
  {(item) => (
170
177
  <div
@@ -192,7 +199,7 @@ export function Typeahead<T>(props: {
192
199
  {/* Stays mounted while a retry or a newer query is pending, so the list never collapses to nothing. */}
193
200
  <Show when={results().items.length === 0}>
194
201
  <div
195
- class="mx-1 flex h-8 items-center px-2 pb-1 text-v2-text-text-faint"
202
+ class="mx-1 flex h-9 items-center px-2 py-1 text-v2-text-text-faint"
196
203
  classList={{ invisible: store.answered === undefined }}
197
204
  >
198
205
  <Show when={failed()} fallback={props.emptyLabel}>
package/src/i18n/am.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const dict: Record<string, string> = {
1
+ export const dict = {
2
2
  "ui.sessionReview.title": "የክፍለ ጊዜ ለውጦች",
3
3
  "ui.sessionReview.title.git": "Gitይለውጣል",
4
4
  "ui.sessionReview.title.branch": "ቅርንጫፍ ለውጦች",
@@ -70,10 +70,6 @@ export const dict: Record<string, string> = {
70
70
  "dialog.usageExceeded.freeTier.title": "ነፃ ገደብ ላይ ደርሷል",
71
71
  "dialog.usageExceeded.freeTier.description": "ለምርጥ ክፍት ምንጭ ሞዴሎች ታማኝ መዳረሻ ለማግኘት በወር $10 ለOpenCode Go ይመዝገቡ።",
72
72
  "dialog.usageExceeded.freeTier.actionLabel": "ለደንበኝነት ይመዝገቡ",
73
- "dialog.usageExceeded.accountRateLimit.title": "የሂድ ገደብ ላይ ደርሷል",
74
- "dialog.usageExceeded.accountRateLimit.description":
75
- "የአጠቃቀም ገደብ ላይ ደርሷል። ይህን ሞዴል አሁን መጠቀሙን ለመቀጠል ካለው ቀሪ ሒሳብ መጠቀምን ያንቁ",
76
- "dialog.usageExceeded.accountRateLimit.actionLabel": "ክፍት ቅንብሮች",
77
73
  "ui.sessionTurn.status.delegating": "ሥራን በውክልና መስጠት",
78
74
  "ui.sessionTurn.status.planning": "ቀጣዮቹን ደረጃዎች ማቀድ",
79
75
  "ui.sessionTurn.status.gatheringContext": "ማሰስ",
package/src/i18n/ar.ts CHANGED
@@ -79,10 +79,6 @@ export const dict = {
79
79
  "dialog.usageExceeded.freeTier.description":
80
80
  "اشترك في OpenCode Go مقابل $10/شهر للحصول على وصول موثوق إلى أفضل النماذج مفتوحة المصدر.",
81
81
  "dialog.usageExceeded.freeTier.actionLabel": "اشترك",
82
- "dialog.usageExceeded.accountRateLimit.title": "تم الوصول إلى حد Go",
83
- "dialog.usageExceeded.accountRateLimit.description":
84
- "تم الوصول إلى حد الاستخدام. لمتابعة استخدام هذا النموذج الآن، قم بتفعيل الاستخدام من رصيدك المتاح",
85
- "dialog.usageExceeded.accountRateLimit.actionLabel": "فتح الإعدادات",
86
82
 
87
83
  "ui.sessionTurn.status.delegating": "جارٍ تفويض العمل",
88
84
  "ui.sessionTurn.status.planning": "تخطيط الخطوات التالية",
package/src/i18n/az.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const dict: Record<string, string> = {
1
+ export const dict = {
2
2
  "ui.sessionReview.title": "Sessiya dəyişiklikləri",
3
3
  "ui.sessionReview.title.git": "Git dəyişiklikləri",
4
4
  "ui.sessionReview.title.branch": "Branch dəyişiklikləri",
@@ -71,10 +71,6 @@ export const dict: Record<string, string> = {
71
71
  "dialog.usageExceeded.freeTier.description":
72
72
  "Ayda $10 olan OpenCode Go abunəliyi ilə ən yaxşı açıq mənbəli modellərə etibarlı giriş əldə edin.",
73
73
  "dialog.usageExceeded.freeTier.actionLabel": "Abunə ol",
74
- "dialog.usageExceeded.accountRateLimit.title": "Go limitinə çatdınız",
75
- "dialog.usageExceeded.accountRateLimit.description":
76
- "İstifadə limitinə çatdınız. Bu modeldən indi istifadə etməyə davam etmək üçün mövcud balansınızdan istifadəni aktivləşdirin",
77
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Tənzimləmələri aç",
78
74
  "ui.sessionTurn.status.delegating": "İş həvalə edilir",
79
75
  "ui.sessionTurn.status.planning": "Növbəti addımlar planlanır",
80
76
  "ui.sessionTurn.status.gatheringContext": "Araşdırılır",
package/src/i18n/bg.ts CHANGED
@@ -71,10 +71,6 @@ export const dict = {
71
71
  "dialog.usageExceeded.freeTier.description":
72
72
  "Абонирайте се за OpenCode Go за надежден достъп до най-добрите модели с отворен код за $10/месец.",
73
73
  "dialog.usageExceeded.freeTier.actionLabel": "Абонирайте се",
74
- "dialog.usageExceeded.accountRateLimit.title": "Лимитът за движение е достигнат",
75
- "dialog.usageExceeded.accountRateLimit.description":
76
- "Лимитът за използване е достигнат. За да продължите да използвате този модел сега, активирайте използването от вашия наличен баланс",
77
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Отворете настройките",
78
74
  "ui.sessionTurn.status.delegating": "Делегиране на работа",
79
75
  "ui.sessionTurn.status.planning": "Планиране на следващите стъпки",
80
76
  "ui.sessionTurn.status.gatheringContext": "Изследване",
package/src/i18n/bn.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const dict: Record<string, string> = {
1
+ export const dict = {
2
2
  "ui.sessionReview.title": "সেশন পরিবর্তন",
3
3
  "ui.sessionReview.title.git": "Git পরিবর্তন",
4
4
  "ui.sessionReview.title.branch": "শাখা পরিবর্তন",
@@ -73,10 +73,6 @@ export const dict: Record<string, string> = {
73
73
  "dialog.usageExceeded.freeTier.description":
74
74
  "সেরা ওপেন-সোর্স মডেলগুলিতে নির্ভরযোগ্য অ্যাক্সেসের জন্য $10/মাসে OpenCode Go-তে সদস্যতা নিন৷",
75
75
  "dialog.usageExceeded.freeTier.actionLabel": "সদস্যতা",
76
- "dialog.usageExceeded.accountRateLimit.title": "যাওয়ার সীমা পৌঁছে গেছে",
77
- "dialog.usageExceeded.accountRateLimit.description":
78
- "ব্যবহারের সীমা পৌঁছেছে। এখন এই মডেল ব্যবহার চালিয়ে যেতে, আপনার উপলব্ধ ব্যালেন্স থেকে ব্যবহার সক্ষম করুন",
79
- "dialog.usageExceeded.accountRateLimit.actionLabel": "সেটিংস খুলুন",
80
76
  "ui.sessionTurn.status.delegating": "কাজ অর্পণ",
81
77
  "ui.sessionTurn.status.planning": "পরবর্তী পদক্ষেপের পরিকল্পনা",
82
78
  "ui.sessionTurn.status.gatheringContext": "অন্বেষণ",
package/src/i18n/br.ts CHANGED
@@ -120,10 +120,6 @@ export const dict = {
120
120
  "dialog.usageExceeded.freeTier.description":
121
121
  "Assine o OpenCode Go por $10/mês para ter acesso confiável aos melhores modelos de código aberto.",
122
122
  "dialog.usageExceeded.freeTier.actionLabel": "Assinar",
123
- "dialog.usageExceeded.accountRateLimit.title": "Limite do Go atingido",
124
- "dialog.usageExceeded.accountRateLimit.description":
125
- "Limite de uso atingido. Para continuar usando este modelo agora, ative o uso a partir do seu saldo disponível",
126
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Abrir configurações",
127
123
 
128
124
  "ui.sessionTurn.status.delegating": "Delegando trabalho",
129
125
  "ui.sessionTurn.status.planning": "Planejando próximos passos",
package/src/i18n/bs.ts CHANGED
@@ -80,10 +80,6 @@ export const dict = {
80
80
  "dialog.usageExceeded.freeTier.description":
81
81
  "Pretplati se na OpenCode Go za $10/mjesec i ostvari pouzdan pristup najboljim modelima otvorenog koda.",
82
82
  "dialog.usageExceeded.freeTier.actionLabel": "Pretplati se",
83
- "dialog.usageExceeded.accountRateLimit.title": "Dostignut Go limit",
84
- "dialog.usageExceeded.accountRateLimit.description":
85
- "Dostignut je limit korištenja. Da sada nastaviš koristiti ovaj model, omogući korištenje raspoloživog salda",
86
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Otvori postavke",
87
83
 
88
84
  "ui.sessionTurn.status.delegating": "Delegiranje posla",
89
85
  "ui.sessionTurn.status.planning": "Planiranje sljedećih koraka",
package/src/i18n/ca.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const dict: Record<string, string> = {
1
+ export const dict = {
2
2
  "ui.sessionReview.title": "Canvis de sessió",
3
3
  "ui.sessionReview.title.git": "Canvis de Git",
4
4
  "ui.sessionReview.title.branch": "Canvis de branca",
@@ -72,10 +72,6 @@ export const dict: Record<string, string> = {
72
72
  "dialog.usageExceeded.freeTier.description":
73
73
  "Subscriviu-vos a OpenCode Go per 10 dòlars al mes i obteniu accés fiable als millors models de codi obert.",
74
74
  "dialog.usageExceeded.freeTier.actionLabel": "Subscriu-te",
75
- "dialog.usageExceeded.accountRateLimit.title": "S'ha assolit el límit de Go",
76
- "dialog.usageExceeded.accountRateLimit.description":
77
- "S'ha arribat al límit d'ús. Per continuar utilitzant aquest model ara, activeu l'ús des del vostre saldo disponible",
78
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Obre la configuració",
79
75
  "ui.sessionTurn.status.delegating": "Delegació de feina",
80
76
  "ui.sessionTurn.status.planning": "Planificant els propers passos",
81
77
  "ui.sessionTurn.status.gatheringContext": "Explorant",
package/src/i18n/cs.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const dict: Record<string, string> = {
1
+ export const dict = {
2
2
  "ui.sessionReview.title": "Změny relace",
3
3
  "ui.sessionReview.title.git": "Git změny",
4
4
  "ui.sessionReview.title.branch": "Změny ve větvi",
@@ -73,10 +73,6 @@ export const dict: Record<string, string> = {
73
73
  "dialog.usageExceeded.freeTier.description":
74
74
  "Předplaťte si OpenCode Go za 10 USD měsíčně a získejte spolehlivý přístup k nejlepším modelům s otevřeným zdrojovým kódem.",
75
75
  "dialog.usageExceeded.freeTier.actionLabel": "Přihlásit se k odběru",
76
- "dialog.usageExceeded.accountRateLimit.title": "Dosažen limit služby Go",
77
- "dialog.usageExceeded.accountRateLimit.description":
78
- "Bylo dosaženo limitu využití. Chcete-li nyní tento model nadále používat, povolte používání ze svého dostupného zůstatku",
79
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Otevřete nastavení",
80
76
  "ui.sessionTurn.status.delegating": "Delegování práce",
81
77
  "ui.sessionTurn.status.planning": "Plánování dalších kroků",
82
78
  "ui.sessionTurn.status.gatheringContext": "Zkoumání",
package/src/i18n/da.ts CHANGED
@@ -110,10 +110,6 @@ export const dict = {
110
110
  "dialog.usageExceeded.freeTier.description":
111
111
  "Abonnér på OpenCode Go for $10/måned, og få pålidelig adgang til de bedste open source-modeller.",
112
112
  "dialog.usageExceeded.freeTier.actionLabel": "Abonnér",
113
- "dialog.usageExceeded.accountRateLimit.title": "Go-grænse nået",
114
- "dialog.usageExceeded.accountRateLimit.description":
115
- "Forbrugsgrænse nået. For at fortsætte med at bruge denne model nu, aktivér forbrug fra din tilgængelige saldo",
116
- "dialog.usageExceeded.accountRateLimit.actionLabel": "Åbn indstillinger",
117
113
 
118
114
  "ui.sessionTurn.status.delegating": "Delegerer arbejde",
119
115
  "ui.sessionTurn.status.planning": "Planlægger næste trin",