@opencode/ui 0.0.0-dev-19821 → 0.0.0-dev-19825

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/ui",
3
- "version": "0.0.0-dev-19821",
3
+ "version": "0.0.0-dev-19825",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- import { createEffect, mergeProps, onCleanup, onMount, Show, splitProps, type ComponentProps } from "solid-js"
1
+ import { createEffect, mergeProps, on, onCleanup, onMount, Show, splitProps, type ComponentProps } from "solid-js"
2
2
  import { Portal } from "solid-js/web"
3
3
  import { createResizeObserver } from "@solid-primitives/resize-observer"
4
4
  import { createStore } from "solid-js/store"
@@ -236,18 +236,22 @@ export function ScrollView(props: ScrollViewProps) {
236
236
  local.viewportRef(viewportRef)
237
237
  }
238
238
 
239
+ // The observer reports every target once when it starts observing (including a thumb mount that
240
+ // appears later), after layout. Measuring here as well would force a synchronous layout per
241
+ // ScrollView while the page is still rendering.
239
242
  createResizeObserver(
240
243
  () => [viewportRef, viewportRef.firstElementChild, thumbMount()].filter(Boolean) as HTMLElement[],
241
244
  updateThumb,
242
245
  )
243
-
244
- updateThumb()
245
246
  })
246
247
 
247
- createEffect(() => {
248
- thumbMount()
249
- updateThumb()
250
- })
248
+ // Inputs that change the thumb without resizing anything: re-measure on change, but leave the
249
+ // first measurement to the observer.
250
+ createEffect(
251
+ on([() => local.verticalScrollAdjustment, vertical, horizontal, thumbMount], () => updateThumb(), {
252
+ defer: true,
253
+ }),
254
+ )
251
255
 
252
256
  createEffect(() => {
253
257
  if (!horizontal() || !viewportRef) return