zed/crates
Finn Eitreim 7b9afc8c45
gpui: Recalculate list layout after the window has been resized (#51414)
Closes #51417

I noticed this bug in the settings menu where when I opened the settings
menu, I could not scroll down through all the available options, eg. on
the initial page I wasn't able to scroll down to privacy. When I saw
that no one else had reported this issue, I figured it may be due to my
setup, and it turns out that using Aerospace, the window manager I use,
was what made this bug visible to me. Because aerospace resizes the
window right after it launches, the originally computed heights for the
list are incorrect, meaning the scroll bar is the wrong size as well.

in the relevant code there was a comment that says "If the width of the
list has changed, invalidate all cached item heights" which wasn't
incorrect per-se, but it just invalidated them without triggering any
re-computation, causing incorrect scroll bars.

My intuition is that window resizes/events that change the width of the
list bounds are fairly rare, so there shouldn't be a large performance
hit from the change.

Also implemented a test that directly showcases the behavior, if you run
the test without the change it fails, as the max_offset_for_scrollbar
will be wrong.

Videos:

Before 


https://github.com/user-attachments/assets/2b680222-7071-4098-863f-519361f0756a

After:


https://github.com/user-attachments/assets/1222a299-23d7-4007-8e88-55d2daccce64


[x] Tests
[x] Video of behavior


Release Notes:

- gpui: fixed list height re-computation when the list width changes.
2026-03-12 17:12:31 -07:00
..
acp_thread acp: Update to 0.10.2 (#51280) 2026-03-11 12:52:03 +00:00
acp_tools ui: Improve performance in the CopyButton component (#47292) 2026-01-21 13:40:42 -03:00
action_log agent: Add thread git stats to sidebar (#51287) 2026-03-11 14:52:57 +00:00
activity_indicator Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
agent agent_ui: Add keybinding to cycle through new thread location options & settings (#51384) 2026-03-12 10:14:10 -03:00
agent_servers acp: Update to 0.10.2 (#51280) 2026-03-11 12:52:03 +00:00
agent_settings agent_ui: Add keybinding to cycle through new thread location options & settings (#51384) 2026-03-12 10:14:10 -03:00
agent_ui Implement worktree interactions for the sidebar (#51421) 2026-03-12 15:34:09 -07:00
ai_onboarding ai_onboarding: Add student plan examples to component preview (#51338) 2026-03-11 23:21:57 +00:00
anthropic Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
askpass Reduce amount of monomorphizations from FnMut closures (#49453) 2026-02-18 12:00:02 +01:00
assets
assistant_slash_command Handle removed IconName variants in text thread deserialization (#47624) 2026-01-26 23:56:55 +00:00
assistant_slash_commands build: Tear up crate graph (move terminal closer to editor) (#48602) 2026-02-06 20:14:35 +01:00
assistant_text_thread Prevent remote edits from triggering edit predictions when collaborating (#51196) 2026-03-10 15:23:49 +00:00
audio livekit_client: Route selected audio input/output devices into legacy audio (#51128) 2026-03-09 20:50:52 +01:00
auto_update auto_update: Always display update progress when requesting manual update (#51087) 2026-03-09 10:10:42 +00:00
auto_update_helper Try to fix auto-updates when Explorer.exe holds Zed.exe (#50332) 2026-03-03 17:47:35 +01:00
auto_update_ui auto_update_ui: Add announcement toast component (#49543) 2026-02-19 10:41:16 -03:00
aws_http_client
bedrock bedrock: Add Claude Sonnet 4.6 (#49439) 2026-02-19 07:23:27 +01:00
breadcrumbs Clean up some Cargo.toml files (#48623) 2026-02-06 20:21:19 +00:00
buffer_diff Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
call Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
channel Prevent remote edits from triggering edit predictions when collaborating (#51196) 2026-03-10 15:23:49 +00:00
cli zed: Clear the FORCE_CLI_MODE environment variable after reading (#46475) 2026-03-06 19:18:33 +00:00
client client: Populate plans for organizations (#51334) 2026-03-11 22:22:17 +00:00
clock text: Narrow insertion-relative offsets from usize to u32 (#49801) 2026-02-25 08:12:04 +01:00
cloud_api_client cloud_api_client: Send the organization ID in LLM token requests (#50517) 2026-03-04 15:45:33 +01:00
cloud_api_types client: Populate plans for organizations (#51334) 2026-03-11 22:22:17 +00:00
cloud_llm_client Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
codestral zeta: Allow the server to select the editable and context ranges more flexibly (#50975) 2026-03-09 19:58:31 -04:00
collab Implement sidebar rendering of the configured worktrees (#51342) 2026-03-12 17:53:38 +00:00
collab_ui Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
collections
command_palette Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
command_palette_hooks
component
component_preview gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
context_server Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
copilot Add size to DiskState to detect file changes (#49436) 2026-03-10 13:55:57 -05:00
copilot_chat Enable extended reasoning for Anthropic models in Copilot (#46540) 2026-03-08 09:34:46 +00:00
copilot_ui Re-add MultiWorkspace (#48800) 2026-02-12 01:06:23 +00:00
crashes Redact string panics (#51248) 2026-03-11 03:08:39 +00:00
credentials_provider
csv_preview Add CSV preview with live table view and interactive features (#48207) 2026-03-03 15:49:40 +01:00
dap Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
dap_adapters util: Always use posix_spawn on macOS even with pre_exec hooks (#49090) 2026-02-13 20:16:11 +01:00
db Increase SQLite busy_timeout from 1ms to 500ms (#49039) 2026-02-12 16:26:13 +00:00
debug_adapter_extension
debugger_tools Reduce amount of monomorphizations from FnMut closures (#49453) 2026-02-18 12:00:02 +01:00
debugger_ui debugger: Fix restart only working once per session (#51247) 2026-03-12 13:05:52 +00:00
deepseek
denoise
dev_container Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
diagnostics Truncate long diagnostic messages in the status bar (#51031) 2026-03-12 18:25:52 +02:00
docs_preprocessor docs: Add consent banner (#50302) 2026-03-04 15:38:31 +01:00
edit_prediction ep: Avoid including collaborator edits in edit history sent to model (#51343) 2026-03-12 16:56:37 -04:00
edit_prediction_cli ep: Add multi-region format (#51185) 2026-03-10 13:43:27 +02:00
edit_prediction_context Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
edit_prediction_types Differentiate between explicit rejection and ignored in ep acceptance tracking (#48409) 2026-02-04 17:54:11 -05:00
edit_prediction_ui ep: Skip context retrieval when already performed (#51100) 2026-03-09 14:42:15 +00:00
editor Fix title/camelCase commands stripping leading indentation Fixes (#50523) 2026-03-12 19:33:48 +00:00
encoding_selector Revert PRs for landing in main (#48969) 2026-02-12 00:28:17 +00:00
etw_tracing time_format: Add Windows implementation (#50227) 2026-02-28 21:47:30 -05:00
eval Refresh LLM API token on organization change (#50931) 2026-03-06 19:15:21 +00:00
eval_cli agent: Allow NativeAgent to work with multiple projects (#51202) 2026-03-10 17:04:48 +01:00
eval_utils gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
explorer_command_injector explorer_command_injector: Avoid COM out-pointer overwrite in class factory exports (#49210) 2026-02-28 22:42:19 -05:00
extension extension_cli: Add tests for semantic token rules and language tasks (#50750) 2026-03-09 11:47:12 +01:00
extension_api extension_api: Add language server schema methods (#48334) 2026-03-07 11:05:10 +01:00
extension_cli extension_cli: Add tests for semantic token rules and language tasks (#50750) 2026-03-09 11:47:12 +01:00
extension_host Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
extensions_ui extensions_ui: Fix extension author list overflow (#51045) 2026-03-09 12:18:12 -03:00
feature_flags Redact string panics (#51248) 2026-03-11 03:08:39 +00:00
feedback Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
file_finder Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
file_icons
fs Implement sidebar rendering of the configured worktrees (#51342) 2026-03-12 17:53:38 +00:00
fs_benchmarks gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
fuzzy
git Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
git_graph git_graph: Add select first & last actions (#50956) 2026-03-10 19:34:42 +00:00
git_hosting_providers Implement extract_pull_request for GitLab provider (#47973) 2026-01-31 21:56:34 +00:00
git_ui git_ui: Remove unused ProjectDiffEmptyState component (#51436) 2026-03-12 21:09:53 -03:00
go_to_line Do not derive symbol highlights if they do not fit into multi buffer (#50948) 2026-03-09 15:50:44 +00:00
google_ai Remove deprecated Gemini 3 Pro Preview (#50503) 2026-03-04 15:53:26 +00:00
gpui gpui: Recalculate list layout after the window has been resized (#51414) 2026-03-12 17:12:31 -07:00
gpui_linux image_viewer: Add pinch event support (#47351) 2026-03-11 18:12:48 +01:00
gpui_macos GPUI updates (#51415) 2026-03-12 22:15:12 +00:00
gpui_macros gpui: Add property_test macro (#50935) 2026-03-06 14:03:45 +00:00
gpui_platform GPUI updates (#51415) 2026-03-12 22:15:12 +00:00
gpui_tokio
gpui_util GPUI on the web (#50228) 2026-02-26 18:36:50 +01:00
gpui_web Remove Executor::close() (#50970) 2026-03-07 04:11:45 +00:00
gpui_wgpu Linux: Handle device lost with wgpu (#50898) 2026-03-05 22:59:48 -07:00
gpui_windows Disable the IME on Windows when text input is unexpected (#51041) 2026-03-08 04:54:05 +00:00
html_to_markdown
http_client cloud_api_client: Send the organization ID in LLM token requests (#50517) 2026-03-04 15:45:33 +01:00
http_client_tls
icons agent_ui: Add archive view to the sidebar (#51336) 2026-03-12 14:05:30 -03:00
image_viewer image_viewer: Add pinch event support (#47351) 2026-03-11 18:12:48 +01:00
inspector_ui Reduce amount of closure monomorphizations part 2 (#49688) 2026-02-20 08:32:45 +00:00
install_cli Revert PRs for landing in main (#48969) 2026-02-12 00:28:17 +00:00
journal Implement worktree interactions for the sidebar (#51421) 2026-03-12 15:34:09 -07:00
json_schema_store extension_api: Add language server schema methods (#48334) 2026-03-07 11:05:10 +01:00
keymap_editor Re-add MultiWorkspace (#48800) 2026-02-12 01:06:23 +00:00
language Add size to DiskState to detect file changes (#49436) 2026-03-10 13:55:57 -05:00
language_extension extension_api: Add language server schema methods (#48334) 2026-03-07 11:05:10 +01:00
language_model Assign meaningful names to some single-letter bindings (#51432) 2026-03-12 22:49:17 +00:00
language_models Assign meaningful names to some single-letter bindings (#51432) 2026-03-12 22:49:17 +00:00
language_onboarding
language_selector language_selector: Auto-select current language when opening (#48475) 2026-02-26 15:18:25 +00:00
language_tools buffer_diff: Do not block on parsing in set_snapshot_with_secondary_inner (#50385) 2026-02-28 11:53:06 +00:00
languages python: Add label_for_symbol for ty adapter (#51355) 2026-03-12 13:24:51 +01:00
line_ending_selector
livekit_api Update Rust crate jsonwebtoken to v10 [SECURITY] (#48294) 2026-02-03 15:51:40 -05:00
livekit_client audio: Run webrtc receiver task on the realtime-priority thread as well (#51315) 2026-03-11 20:26:19 +01:00
lmstudio ai: Add LMStudio API URL & API key support (#48309) 2026-03-06 16:49:55 +00:00
lsp git: Move diff num stat calculation to repository snapshot layer (#50645) 2026-03-04 18:54:23 +00:00
markdown markdown_preview: Enable parser options individually (#50440) 2026-03-05 14:00:08 +00:00
markdown_preview markdown_preview: Fix slow checkbox check/uncheck UI updates (#48633) 2026-03-06 17:23:50 +01:00
media
menu
migrator editor: Add support for no auto-indent on enter (#47751) 2026-03-04 20:29:20 +00:00
miniprofiler_ui project_panel: Fix scrolling in empty area below file list (#50683) 2026-03-04 19:13:32 +01:00
mistral mistral: Enable streaming tool calls (#50793) 2026-03-05 08:59:05 +00:00
multi_buffer Prevent remote edits from triggering edit predictions when collaborating (#51196) 2026-03-10 15:23:49 +00:00
nc acp: Claude Code -> Claude Agent (#49345) 2026-02-17 10:41:10 +00:00
net Add ETW profile recorder action (#49712) 2026-02-20 13:36:04 +00:00
node_runtime util: Always use posix_spawn on macOS even with pre_exec hooks (#49090) 2026-02-13 20:16:11 +01:00
notifications Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
ollama ollama: Remove backwards compatibility for Ollama tool call IDs (#49246) 2026-02-16 14:33:29 +00:00
onboarding Reduce amount of monomorphizations from FnMut closures (#49453) 2026-02-18 12:00:02 +01:00
open_ai open_ai: Support reasoning summaries in OpenAI Responses API (#50959) 2026-03-09 13:51:22 +00:00
open_path_prompt Re-add MultiWorkspace (#48800) 2026-02-12 01:06:23 +00:00
open_router Add user picked model to be used as a default for open router provider when generating comments and thread summary (#47475) 2026-02-12 14:02:16 +00:00
outline Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
outline_panel Do not derive symbol highlights if they do not fit into multi buffer (#50948) 2026-03-09 15:50:44 +00:00
panel build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
paths Remove Supermaven-related code from Zed (#50537) 2026-03-02 22:18:49 +00:00
picker picker: Prevent clicking non-selectable entries from confirming selection (#50705) 2026-03-05 18:59:01 +00:00
platform_title_bar Fix window drags when dragging button/input on titlebar in macOS (#51400) 2026-03-12 21:16:48 +05:30
prettier Add configurable LSP timeout setting (#44745) 2026-02-07 00:36:37 +00:00
project Implement sidebar rendering of the configured worktrees (#51342) 2026-03-12 17:53:38 +00:00
project_benchmarks gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
project_panel project_panel: Improve wording around file deletion (#43801) 2026-03-12 18:15:17 +01:00
project_symbols Re-add MultiWorkspace (#48800) 2026-02-12 01:06:23 +00:00
prompt_store Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
proto Implement sidebar rendering of the configured worktrees (#51342) 2026-03-12 17:53:38 +00:00
recent_projects Implement worktree interactions for the sidebar (#51421) 2026-03-12 15:34:09 -07:00
refineable
release_channel
remote Fix a few cases where we weren't escaping shell vars correctly (#50562) 2026-03-02 23:31:11 -07:00
remote_connection build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
remote_server agent: Re-use ACP connections per project (#51209) 2026-03-10 17:32:51 +00:00
repl Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
reqwest_client Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
rope editor: Prevent panic in lsp_symbols_at_cursor with diff hunks handling (#51077) 2026-03-09 08:35:19 +00:00
rpc Support LSP document symbols in breadcrumbs and outline UI (#48780) 2026-02-11 21:30:03 +02:00
rules_library Fix window drags when dragging button/input on titlebar in macOS (#51400) 2026-03-12 21:16:48 +05:30
scheduler Remove Executor::close() (#50970) 2026-03-07 04:11:45 +00:00
schema_generator
search Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
session Re-add MultiWorkspace (#48800) 2026-02-12 01:06:23 +00:00
settings editor: Add support for no auto-indent on enter (#47751) 2026-03-04 20:29:20 +00:00
settings_content agent_ui: Add keybinding to cycle through new thread location options & settings (#51384) 2026-03-12 10:14:10 -03:00
settings_json
settings_macros
settings_profile_selector Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
settings_ui agent_ui: Add keybinding to cycle through new thread location options & settings (#51384) 2026-03-12 10:14:10 -03:00
shell_command_parser Skip /dev/null redirects from terminal auto-allow command extraction (#49503) 2026-02-18 13:01:01 -05:00
snippet
snippet_provider extension_cli: Validate that all snippets can be parsed (#47649) 2026-01-26 13:49:26 +00:00
snippets_ui Revert PRs for landing in main (#48969) 2026-02-12 00:28:17 +00:00
sqlez sqlez: Open named in-memory databases as SQLite URIs (#50967) 2026-03-10 20:25:12 +00:00
sqlez_macros
story
storybook gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
streaming_diff
sum_tree gpui: Add property_test macro (#50935) 2026-03-06 14:03:45 +00:00
svg_preview Prevent remote edits from triggering edit predictions when collaborating (#51196) 2026-03-10 15:23:49 +00:00
system_specs
tab_switcher Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
task extension_cli: Add tests for semantic token rules and language tasks (#50750) 2026-03-09 11:47:12 +01:00
tasks_ui Limit editors' refresh runnables (#51299) 2026-03-11 15:05:22 +00:00
telemetry
telemetry_events ep_cli: rated-after: query (#47906) 2026-01-28 16:36:44 -08:00
terminal Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
terminal_view Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
text Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
theme Add hotkeys and actions for toggle light and dark theme (#49027) 2026-03-12 21:35:42 +02:00
theme_extension
theme_importer vim: Add configurable yank highlight background color (#49517) 2026-02-26 12:01:57 +00:00
theme_selector
time_format time_format: Add Windows implementation (#50227) 2026-02-28 21:47:30 -05:00
title_bar cloud_api_types: Add ZedBusiness variant to Plan (#51329) 2026-03-11 21:28:29 +00:00
toolchain_selector Revert "Added support for dismissing the toolchain path selector via … (#49504) 2026-02-18 17:07:10 -05:00
ui agent_ui: Add UI refinements to the sidebar and archive view (#51419) 2026-03-12 17:41:56 -03:00
ui_input build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
ui_macros
ui_prompt
util Fix parsing of filenames like main (1).log (#50770) 2026-03-10 06:57:43 +00:00
util_macros
vercel project: Move tests to integration layer (#47596) 2026-01-25 21:35:32 +01:00
vim vim: Fix visual mode entry at line end near trailing newline (#50709) 2026-03-12 19:05:28 +00:00
vim_mode_setting
watch Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
web_search
web_search_providers Assign meaningful names to some single-letter bindings (#51432) 2026-03-12 22:49:17 +00:00
which_key
workspace Implement worktree interactions for the sidebar (#51421) 2026-03-12 15:34:09 -07:00
worktree Add size to DiskState to detect file changes (#49436) 2026-03-10 13:55:57 -05:00
worktree_benchmarks gpui: Extract gpui_platform out of gpui (#49277) 2026-02-19 18:57:49 +01:00
x_ai Add support for streaming tool input to more providers (#50682) 2026-03-04 17:36:25 +01:00
zed workspace: Fix opening closed projects randomly when Zed restarts (#50961) 2026-03-12 22:43:34 +00:00
zed_actions Add hotkeys and actions for toggle light and dark theme (#49027) 2026-03-12 21:35:42 +02:00
zed_env_vars
zeta_prompt ep: Avoid including collaborator edits in edit history sent to model (#51343) 2026-03-12 16:56:37 -04:00
zlog zlog: Fix log file rotation never truncating original file (#50571) 2026-03-03 08:37:58 +00:00
zlog_settings
ztracing ztracing: Annotate more callsites that invoke TreeSitter (#47522) 2026-02-11 11:24:04 +00:00
ztracing_macro