Skip to content

fix: refresh the bounded layout measurement cache - #21

Merged
tiensonqin merged 1 commit into
mainfrom
fix/1794090722-measurement-cache
Nov 8, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
fix/1794090722-measurement-cache

Conversation

@tiensonqin

Copy link
Copy Markdown

Summary

Keep the four-entry naturalHeight measurement cache current after it fills. A full-cache miss now evicts the oldest width and remembers the new result; previously every later width was recomputed recursively, making nested layouts expensive during sidebar resizing. Cache hits, partial fill, capacity and public APIs are unchanged.

Only ui/layout.go changes (+3 lines). No caret, app, LUI or dependency-pin changes.

Testing

  • Fresh isolated tree: go test ./ui, Darwin/Linux/Windows go build ./... and go vet ./..., production-tag vet, formatting and diff checks passed with CGO_ENABLED=0.
  • WASM build/vet passed for non-CLI packages with non-test Go files.
  • go test ./... is not all green: the previously reproduced clean-baseline TestLocales mismatch (x-Test vs en-001) remains on this macOS VM.
  • Release sizes, with VCS metadata disabled for comparison: counter-native 9,781,938 bytes before/after; hello 9,680,738 before/after.
  • Focused work-count probe: six-level column-chain repeated-width leaf calls fell from 64/64 to 1/0; computed height unchanged. Probe removed.
  • Existing real MyGo Logseq candidate completed ten held-drag cycles per divider. The pre-fix fresh control stalled during sidebar opening, so a matched old-vs-new held-drag/FPS comparison remains untested. No achieved-FPS claim.

Tested on:

  • macOS
  • Windows
  • Linux
  • Web
  • Other: (specify here)

Windows/Linux/WASM checks above were cross-build/vet only, not runtime GUI tests.

AI disclosure

  • Tool and model: Devin built by Cognition AI (underlying model identifier/version is not exposed).
  • Used for: implementation, verification, review and this description.
  • A human read every line of this change and can explain it.

Link to Devin session: https://app.devin.ai/sessions/949a417dd06241acb1e04361de5b162b
Open in Devin Desktop: https://app.devin.ai/desktop/session/949a417dd06241acb1e04361de5b162b?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 c566302 into main Nov 8, 2026
5 checks passed
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