Skip to content

feat(ui): expose committed clipped layout widths - #24

Merged
tiensonqin merged 2 commits into
mainfrom
fix/1794110650-committed-layout-extent
Nov 8, 2026
Merged

tiensonqin merged 2 commits into
mainfrom
fix/1794110650-committed-layout-extent

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

  • Add opt-in Element.TrackLayoutWidth() and CommittedSpace.LayoutWidth() for non-scrolling boxes. Local-DIP client/content widths include padding, exclude borders, and preserve finite clipping constraints.
  • Measure the box's own flow allocation and final direct-child inline-end border-box reach, including relative/absolute placement. Exclude hidden/leaving children, transforms and overflowing grandchildren; this is not recursive DOM scrollWidth.
  • Reuse committed geometry lifetime and contentW, with a separate cache-input boolean. Existing scrolling metrics, dependencies and toolchain are unchanged. Document the downstream nowrap/nonshrinking-pill contract.

Conflict resolution: ordinary merge of main at fc67c1f293461d4db5814c06a88125e34e6c1355 into the original PR head 6fe0971afd238172731757343d6082e130744ce0, producing 420f520bffa776d0aa7838c0fafb1f8dac9795fd. The only textual conflict was two independent sections in docs/ui/migration.md; both are retained. Regenerated the UI facade and migration API index from the combined source. Navigation registration, its event-only cache classification, width tracking and its layout-cache input all remain. No feature redesign, dependency changes or rewritten history.

Testing

  • Full headless CGO_ENABLED=0 go test -count=1 -timeout 20m -exec <owned-domain-wrapper> ./... passed. MYGO_E2E was absent in every child. Darwin tests run in the previously verified synthetic bundle, with a pre-main bundle-ID guard; isolated TestLocales also passed. The former baseline locale failure is fixed by fix: keep Darwin preferred languages global #25, now included from main.
  • Focused race checks passed for the existing navigation, committed-width and layout-cache contracts (TestNavigationKeysRespectFocusedChildAndNearestOwner, TestCommittedLayoutWidth, TestLayoutInputs, TestLayoutCacheMatches, TestLayoutCacheReuses, TestLayoutCacheInvalidates). Race tooling uses CGO_ENABLED=1; production builds and ordinary tests remain cgo-free. No test assertions were changed for this merge.
  • go generate ./ui and existing TestUIAPI pass; a second generation preserved the facade/index byte-for-byte. gofmt and both staged/unstaged whitespace checks passed.
  • CGO_ENABLED=0 go build ./..., go vet ./..., and go vet -tags mygo_noinspector ./... passed for macOS/arm64, Linux/amd64+arm64 and Windows/amd64+arm64. JS/wasm source-package build/vet passed, excluding the CLI and test-only packages.
  • bun install --frozen-lockfile, bun run build, bun run test (251 tests) and bun run typecheck passed.
  • This conflict-only pass does not requalify the earlier full-suite race allocation-count discrepancy or Wasm/Node runtime failures. Neither was hidden, weakened or represented as resolved. No GUI/browser acceptance is claimed.

Release sizes against current main (fc67c1f2), identical Go 1.27.3, CGO_ENABLED=0, -buildvcs=false -trimpath -tags mygo_noinspector, production linker flags (-s -w, plus -H=windowsgui on Windows):

Platform counter-native main → combined hello delta
macOS arm64 9,782,050 → 9,782,082 (+32 bytes) 0
Linux amd64 9,961,735 → 9,961,735 (0) 0
Linux arm64 9,175,303 → 9,175,303 (0) 0
Windows amd64 10,585,088 → 10,586,624 (+1,536 bytes) 0
Windows arm64 9,570,304 → 9,571,840 (+1,536 bytes) 0

This is not fully size-neutral. Fresh unstripped -dumpdep/nm comparisons show computeBox → (*node).keepLayoutWidth (208 bytes on macOS ARM64; 384 bytes on Windows AMD64), plus growth of computeBox (32/64 bytes) and sameLayout (32/32 bytes), symbol/type metadata and final-file alignment. No new library/dependency or registry is introduced.

Tested on:

  • macOS (headless unit/race checks and builds only)
  • Windows (cross-build/vet and paired sizes only)
  • Linux (cross-build/vet and paired sizes only)
  • Web (wasm build/vet only)
  • Other: no additional runtime validation in this conflict update

AI disclosure

  • Tool and model: Devin, built by Cognition AI (underlying model identifier is not exposed).
  • Used for: implementation, existing tests, conflict resolution, validation and this description.
  • A human read every line of this change and can explain it.

Link to Devin session: https://app.devin.ai/sessions/79be43a0fc7b4ee3b783fa85566b6c1d
Open in Devin Desktop: https://app.devin.ai/desktop/session/79be43a0fc7b4ee3b783fa85566b6c1d?variant=devin
Requested by: @tiensonqin

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit 7fe2886 into main Nov 8, 2026
5 checks passed
@tiensonqin
tiensonqin deleted the fix/1794110650-committed-layout-extent branch November 8, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant