Skip to content

Conversation

@dinocosta
Copy link
Member

When the UI font size changes, the settings window's scrollbar would break because list item measurements were cached and not invalidated.

We're using ListState.measure_all() to pre-measure all items for an accurate scrollbar. When font size changes, these cached measurements become stale but weren't being refreshed.

This commit fixes the issue by calling ListState.measure_all() when settings change, ensuring items are re-measured on the next layout without affecting scroll position.

Closes #43683

Release Notes:

  • Fixed bug where changing the UI Font Size in the Settings UI would break the scrollbar for the "Appearance" page
When the UI font size changes, the settings window's scrollbar would
break because list item measurements were cached and not invalidated.

We're using `ListState.measure_all()` to pre-measure all items for an
accurate scrollbar. When font size changes, these cached measurements
become stale but weren't being refreshed.

This commit fixes the issue by calling `ListState.measure_all()` when
settings change, ensuring items are re-measured on the next layout
without affecting scroll position.

Closes #43683
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 17, 2025
@maxdeviant maxdeviant changed the title settings_ui: Fix scrollbar breaking when ui font size changes Dec 17, 2025
Introduce a new method `ListState::remeasure` to allow clients to
invalidate cached measurements without changing the scroll position.
This is useful when item heights may have changed (e.g., font size
changes) but the number and identity of items remains the same.
@dinocosta dinocosta force-pushed the 43683-incorrect-scrollbar branch from fc8809d to 9fb12ee Compare December 19, 2025 00:25
dinocosta and others added 3 commits December 19, 2025 17:11
Preserve proportional scroll position when remeasuring list items. When
item heights change (e.g., due to font size changes), the scroll
position is now maintained relative to the item rather than jumping.
@dinocosta dinocosta marked this pull request as ready for review December 22, 2025 16:47
@Anthony-Eid
Copy link
Contributor

@dinocosta I think this is good to merge btw! Is there any blockers on your end that I could help fix?

@dinocosta
Copy link
Member Author

@dinocosta I think this is good to merge btw! Is there any blockers on your end that I could help fix?

Thank you for the review! On my end, the only remaining question were these changes – #45099 (comment) – but since that looks good to you, I'll go ahead and merge this 🚢

@dinocosta dinocosta merged commit bbb3d51 into main Jan 6, 2026
23 checks passed
@dinocosta dinocosta deleted the 43683-incorrect-scrollbar branch January 6, 2026 11:38
rtfeldman pushed a commit that referenced this pull request Jan 6, 2026
When the UI font size changes, the settings window's scrollbar would
break because list item measurements were cached and not invalidated.

We're using `ListState.measure_all()` to pre-measure all items for an
accurate scrollbar. When font size changes, these cached measurements
become stale but weren't being refreshed.

This commit fixes the issue by calling `ListState.measure_all()` when
settings change, ensuring items are re-measured on the next layout
without affecting scroll position.

Closes #43683

Release Notes:

- Fixed bug where changing the UI Font Size in the Settings UI would
break the scrollbar for the "Appearance" page

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…dustries#45099)

When the UI font size changes, the settings window's scrollbar would
break because list item measurements were cached and not invalidated.

We're using `ListState.measure_all()` to pre-measure all items for an
accurate scrollbar. When font size changes, these cached measurements
become stale but weren't being refreshed.

This commit fixes the issue by calling `ListState.measure_all()` when
settings change, ensuring items are re-measured on the next layout
without affecting scroll position.

Closes zed-industries#43683

Release Notes:

- Fixed bug where changing the UI Font Size in the Settings UI would
break the scrollbar for the "Appearance" page

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…dustries#45099)

When the UI font size changes, the settings window's scrollbar would
break because list item measurements were cached and not invalidated.

We're using `ListState.measure_all()` to pre-measure all items for an
accurate scrollbar. When font size changes, these cached measurements
become stale but weren't being refreshed.

This commit fixes the issue by calling `ListState.measure_all()` when
settings change, ensuring items are re-measured on the next layout
without affecting scroll position.

Closes zed-industries#43683

Release Notes:

- Fixed bug where changing the UI Font Size in the Settings UI would
break the scrollbar for the "Appearance" page

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

3 participants