5cc3b3a
wait for workspace window to show
Agus Zubiaga created
5cc3b3a
wait for workspace window to show
Agus Zubiaga created
422dc4f
Reuse cloning code from git_panel
Agus Zubiaga created
b1aa0e2
Use git/commit style format
Agus Zubiaga created
3dbfee1
Merge branch 'main' into git-clone
Agus Zubiaga created
0c9992c
terminal: Forward Ctrl+V when clipboard contains images (#42258)
When running Codex CLI, Claude Code, or other TUI agents in Zed’s terminal, pasting images wasn’t supported — Zed treated all clipboard content as plain text and simply pushed it into the PTY, so the agent never saw the image data. This change makes terminal pastes behave like they do in a native terminal: if the clipboard contains an image, Zed now emits a raw Ctrl+V to the PTY so the agent can read the system clipboard itself. Release Notes: - Fixed terminal-launched Codex/Claude sessions by forwarding Ctrl+V for clipboard images so agents can attach them
Kingsword created
cec4607
git_ui: Preserve newlines in commit messages (#45167)
Closes #44982 Release Notes: - Fixed Git panel to preserve newlines in commit messages
Mayank Verma created
f9b69ae
Fix Wayland platform resize resulting in non-interactive window (#45153)
Closes #40361 Release Notes: - Linux(Wayland): Fixed an issue where the settings window would not respond to user interaction until resized
Ben Kunkle created
f00cb37
macOS: Bundle placeholder Document.icns so Finder can display Zed file icons (#44833)
Generated by AI. `DocumentTypes.plist` declares `CFBundleTypeIconFile` as `Document` for Zed’s document types, but the macOS bundle did not include `Contents/Resources/Document.icns`, causing Finder to fall back to generic icons. This PR: - Adds `crates/zed/resources/Document.icns` as a placeholder document icon (currently derived from the app icon). - Updates `script/bundle-mac` to copy it into the `.app` at `Contents/Resources/Document.icns` during bundling. - Adds `script/verify-macos-document-icon` for one-command validation. ## How to test (CLI) 1. Build a debug bundle: - `./script/bundle-mac -d aarch64-apple-darwin` 2. Verify the bundle contains the referenced icon: - `./script/verify-macos-document-icon "target/aarch64-apple-darwin/debug/bundle/osx/Zed Dev.app"` ## Optional visual validation in Finder - Pick a file (e.g. `.rs`), Get Info → Open with: Zed Dev → Change All... - Restart Finder: `killall Finder` (or log out/in) @JosephTLyons — would you mind running the steps above and confirming Finder shows Zed’s icon for source files after "Change All" + Finder restart? @danilo-leal — this PR ships a placeholder `Document.icns`. When the real document icon is ready, replace `crates/zed/resources/Document.icns` and the bundling script will include it automatically. Closes #44403. Release Notes: - TODO --------- Co-authored-by: Matt Miller <mattrx@gmail.com>
Nathan Sobo and Matt Miller created
25e1e2e
Don't trigger autosave on focus change in modals (#45166)
Closes #28732
Release Notes:
- Opening the command palette or other modals no longer triggers
auto-save with the `{ "autosave": "on_focus_change" }` setting. This
reduces the chance of unwanted format changes when executing actions,
and fixes a race condition with `:w` in Vim mode
Ben Kunkle created
f2d29f4
Auto-release preview as Zippy (#45163)
I think we're not triggering the after-release workflow because of github's loop detection when you use the default GITHUB_TOKEN Closes #ISSUE Release Notes: - N/A
Conrad Irwin created
623e137
git: Unify commit popups (#38749)
Closes #26424 Supersedes #35328 Originally, `git::blame` uses its own `ParsedCommitMessage` as the source for the commit information, including the PR section. This changes unifies this with `git::repository` and `git_ui::git_panel` by moving this and some other commit-related structs to `git::commit` instead, and making both `git_ui::blame_ui` and `git_ui::git_panel` pull their information from these structs. Release notes : - (Let's Git Together) Fixed the commit tooltip in the git panel not showing information like avatars. --------- Co-authored-by: Cole Miller <cole@zed.dev> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
LoricAndre , Cole Miller , and Zed Zippy created
302a4bb
git panel: Fix file path truncation and add some UI code clean up (#45161)
This PR ensures truncation works for the file paths, which should set up the stage for when the new GPUI `truncation_start` method lands (https://github.com/zed-industries/zed/pull/45122) so that we can use for them. In the process of doing so and figuring it out why it wasn't working as well before, I noticed some opportunities to clean up some UI code: removing unnecessary styles, making the file easier to navigate given all of the different UI conditions, etc. Note: You might notice a subtle label flashing that comes with the label truncation and that's a standalone GPUI bug that's also visible in other surface areas of the app. I don't think it should block these changes here as it's something we should fix on its own... Release Notes: - N/A
Danilo Leal created
c4f8f2f
Use less generic globs for JSONC to avoid overmatching (#45162)
Otherwise, all *.json files under `zed` directory will be matched as JSONC, e.g `zed/crates/vim/test_data/test_a.json` which is not right. On top, `globset` considers that `zed/crates/vim/test_data/test_a.json` matches `**/zed/*.json` glob (!). Release Notes: - N/A
Kirill Bulatov created
52c7447
gpui: Add Vietnamese chars to `LineWrapper::is_word_char` (#45160)
Cameron Mcloughlin created
65f7412
A couple new inline assistant tests (#45049)
Also adjust the code for streaming tool use to always use a rewrite_section; remove insert_here entirely. Release Notes: - N/A Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Michael Benfield and Max Brunsfeld created
8aab646
terminal: Improve regex hyperlink performance for long lines (#44721)
Related to - #44407 This PR further improves performance for regex hyperlink finding by eliminating unnecessary regex matching. Currently, we repeatedly search for matches from the start of the line until the match contains the hovered point. This is only required to support custom regexes which match strings containing spaces, with multiple matches on a single line. This isn't actually a useful scenario, and is no longer supported. This PR changes to only search twice, the first match starting from the start of the line, and the hovered word (space-delimited). The most dramatic improvement is for long lines with many words. In addition to the above changes, this PR: - Adds test for the scenarios from #44407 and #44510 - Simplifies the logic added in #44407 Performance measurements For the scenario from #44407, this improves the perf test's iteration time from 1.22ms to 0.47ms. main: | Branch | Command | Iter/sec | Mean [ms] | SD [ms] | Iterations | Importance (weight) | |:---|:---|---:|---:|---:|---:|---:| | main | terminal_hyperlinks::tests::path::perf::pr_44407_hyperlink_benchmark | 819.64 | 937.60 | 2.20 | 768 | average (50) | | this PR | terminal_hyperlinks::tests::path::perf::pr_44407_hyperlink_benchmark | 2099.79 | 1463.20 | 7.20 | 3072 | average (50) | Release Notes: - terminal: Improve path hyperlink performance for long lines
Dave Waggoner created
9ad059d
copilot: Add support for Next Edit Suggestion (#44486)
This PR introduces support for Next Edit Suggestions while doing away with calling legacy endpoints. In the process we've also removed support for cycling completions, as NES will give us a single prediction, for the most part. Closes #30124 Release Notes: - Zed now supports Copilot's [Next Edit Suggestions](https://code.visualstudio.com/blogs/2025/02/12/next-edit-suggestions).
Piotr Osiewicz created
0d0a082
Fix windows path canonicalization (#45145)
Closes #44962 Release Notes: - N/A
localcc created
8146322
Support opening and saving files with legacy encodings (#44819)
## Summary
Addresses #16965
This PR adds support for **opening and saving** files with legacy
encodings (non-UTF-8).
Previously, Zed failed to open files encoded in Shift-JIS, EUC-JP, Big5,
etc., displaying a "Could not open file" error screen. This PR
implements automatic encoding detection upon opening and ensures the
original encoding is preserved when saving.
## Implementation Details
1. **Worktree (Loading)**:
* Updated `load_file` to use `chardetng` for automatic encoding
detection.
* Files are decoded to UTF-8 internal strings for editing, while
preserving the detected `Encoding` metadata.
2. **Language / Buffer**:
* Added an `encoding` field to the `Buffer` struct to store the detected
encoding.
3. **Worktree (Saving)**:
* Updated `write_file` to accept the stored encoding.
* **Performance Optimization**:
* **UTF-8 Path**: Uses the existing optimized `fs.save` (streaming
chunks directly from Rope), ensuring no performance regression for the
vast majority of files.
* **Legacy Encoding Path**: Implemented a fallback that converts the
Rope to a contiguous `String/Bytes` in memory, re-encodes it to the
target format (e.g., Shift-JIS), and writes it to disk.
* *Note*: This fallback involves memory allocation, but it is necessary
to support legacy encodings without refactoring the `fs` crate's
streaming interfaces.
## Changes
- `crates/worktree`:
- Add dependencies: `encoding_rs`, `chardetng`.
- Update `load_file` to detect encoding and decode content.
- Update `write_file` to handle re-encoding on save.
- `crates/language`: Add `encoding` field and accessors to `Buffer`.
- `crates/project`: Pass encoding information between Worktree and
Buffer.
- `crates/vim`: Update `:w` command to use the new `write_file`
signature.
## Verification
I validated this manually using a Rust script to generate test files
with various encodings.
**Results:**
* ✅ **Success (Opened & Saved correctly):**
* **Japanese:** `Shift-JIS` (CP932), `EUC-JP`, `ISO-2022-JP`
* **Chinese:** `Big5` (Traditional), `GBK/GB2312` (Simplified)
* **Western/Unicode:** `Windows-1252` (CP1252), `UTF-16LE`, `UTF-16BE`
* ⚠️ **limitations (Detection accuracy):**
* Some specific encodings like `KOI8-R` or generic `Latin1` (ISO-8859-1)
may partially display replacement characters (`?`) depending on the file
content length. This is a known limitation of the heuristic detection
library (`chardetng`) rather than the saving logic.
Release Notes:
- Added support for opening and saving files with legacy encodings
(Shift-JIS, Big5, etc.)
---------
Co-authored-by: CrazyboyQCD <53971641+CrazyboyQCD@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Ichimura Tomoo , CrazyboyQCD , and Conrad Irwin created
e8807e5
git: Fix tree view folders not opening when file inside is selected (#45137)
Closes #44715 Release Notes: - Fixed git tree view folders don't open when file inside is selected
Xipeng Jin created
73f129a
git: New actions for git panel navigation (#43701)
I could not find any related issue, but at least I want to use the git panel like this :) Being used to `lazygit`, this PR makes navigation of the git panel more similar to the CLI tool. Instead of selecting -> enter'ing for skimming each file, I just want to move between the files in the git panel and have the diff multibuffer advance to the appropriate file. This also adheres to the behavior of the outline panel, which I like better. If the multibuffer is not active, it behaves same as before (just selecting the file in the panel, nothing else). I did not modify existing `menu::Select*` actions in case anybody still prefers previous behavior. https://github.com/user-attachments/assets/2d1303d4-50c8-4500-ab3b-302eb7d4afda Release Notes: - Improved navigation of the git panel, by advancing the "Uncommitted Changes" multibuffer to the current selected file. To restore the old behavior, you can bind `up` and `down` to `menu::SelectPrevious` and `menu::SelectNext` under the `GitPanel` context in your keymap. Co-authored-by: Cole Miller <cole@zed.dev>
Luis Cossío and Cole Miller created
fa529b2
agent_ui_v2: Fix broken LICENSE-GPL symlink pointing to itself (#45136)
Fix broken LICENSE-GPL symlink that was pointing to itself instead of the LICENSE-GPL file in the root of the repo. It caused jujutsu to freak out and made it impossible to work with the repo using it without switching to raw git: ``` Internal error: Failed to check out commit 22d04a82b119882e7aed88fb422430367c4df5f9 Caused by: 1: Failed to validate path /Users/aqrln/git/zed/crates/agent_ui_v2/LICENSE-GPL 2: Too many levels of symbolic links (os error 62) ``` Release Notes: - N/A
Oleksii (Alexey) Orlenko created
27c5d39
Add Gemini 3 Flash (#45139)
Add support for the new Gemini 3 Flash model Release Notes: - Added support for Gemini 3 Flash model
Richard Feldman created
83ca2f9
Add Vim-like Which-key Popup menu (#43618)
Closes #10910
Follow up work continuing from the last PR
https://github.com/zed-industries/zed/pull/42659. Add the UI element for
displaying vim like which-key menu.
https://github.com/user-attachments/assets/3dc5f0c9-5a2f-459e-a3db-859169aeba26
Release Notes:
- Added a which-key like modal with a compact, single-column panel
anchored to the bottom-right. You can enable with `{"which_key":
{"enabled": true}}` in your settings.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Xipeng Jin , Conrad Irwin , and Zed Zippy created
847457d
Fix a bug where switching the disable AI flag would cause a panic (#45050)
Also quiet some noisy logs Release Notes: - N/A
Mikayla Maki created
8c7a04c
Autotrust new git worktrees (#45138)
Follow-up of https://github.com/zed-industries/zed/pull/44887 - Inherit git worktree trust - Tidy up the security modal Release Notes: - N/A --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Conrad Irwin and Kirill Bulatov created
b22ccfa
gpui: Fix macOS memory leaks (#45051)
The below memory leaks were caused by failing to release reference counted resources. I confirmed using instruments that my changes stopped the leaks from occurring. - System prompts - Screen capturing - loading font families There were also two memory leaks I found from some of our dependencies that I made PRs to fix - https://github.com/RustAudio/coreaudio-rs/pull/147 - https://github.com/servo/core-foundation-rs/pull/746 Release Notes: - N/A
Anthony Eid created
0fe60ec
Trigger auto-fix auto-matically (#44947)
This updates our CI workflow to try to run the autofix.yml workflow if any of prettier, cargo fmt, or cargo clippy fail. Release Notes: - N/A
Conrad Irwin created
c56eb46
Add davidbarsky to community champion labelers (#45132)
Miguel Raz Guzmán Macedo created
ec6702a
Remove global workspace trust concept (#45129)
Follow-up of https://github.com/zed-industries/zed/pull/44887 Trims the worktree trust mechanism to the actual `worktree`s, so now "global", workspace-level things like `prettier`, `NodeRuntime`, `copilot` and global MCP servers are considered as "trusted" a priori. In the future, a separate mechanism for those will be considered and added. Release Notes: - N/A
Kirill Bulatov created
f084e20
Fix stale pending keybinding indicators on focus change (#44678)
Closes #ISSUE Problem: - The status bar’s pending keystroke indicator (shown next to --NORMAL-- in Vim mode) didn’t clear when focus moved to another context, e.g. hitting g in the editor then clicking the Git panel. The keymap state correctly canceled the prefix, but observers that render the indicator never received a “pending input changed” notification, so the UI kept showing stale prefixes until a new keystroke occurred. Fix: - The change introduces a `pending_input_changed_queued` flag and a new helper `notify_pending_input_if_needed` which will flushes the queued notification as soon as we have an App context. The `pending_input_changed` now resets the flag after notifying subscribers. Before: https://github.com/user-attachments/assets/7bec4c34-acbf-42bd-b0d1-88df5ff099aa After: https://github.com/user-attachments/assets/2264dc93-3405-4d63-ad8f-50ada6733ae7 Release Notes: - Fixed: pending keybinding prefixes on the status bar now clear immediately when focus moves to another panel or UI context. --------- Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Xipeng Jin , Nathan Sobo , and Conrad Irwin created
ad58f1f
docs: Add migrate docs for Webstorm / Pycharm / RustRover (#45128)
Release Notes: - N/A
Katie Geer created
74b4013
git: Mark entries as pending when staging a files making the staged highlighting more "optimistic" (#43434)
This at least speeds it up, not sure if this would close the issue On main (342eba6f220625c015d00334c6bc354f0e2c52e1): https://github.com/user-attachments/assets/55d10187-b4e6-410d-9002-06509e8015c9 This branch: https://github.com/user-attachments/assets/e9a5c14f-9694-4321-a81c-88d6f62fb342 Closes #26870 Release Notes: - Added optimistic staged hunk updating
Ramon created
f6c944f
Fix focus lost when navigating to settings subpages (#45111)
Fixes #42668 When clicking 'Configure' to enter a settings subpage, focus was being lost because push_sub_page only called cx.notify() without managing focus. Similarly, pop_sub_page had the same issue when navigating back. This fix: - Adds window parameter to push_sub_page and pop_sub_page - Focuses the content area when entering/leaving subpages - Resets scroll position when entering a subpage Release Notes: - Fixed a bug that prevented keyboard navigation in the settings window.
Antonio Scandurra created
081e820
docs: Dev container (#44498)
Release Notes: - N/A --------- Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Katie Geer , Danilo Leal , and Danilo Leal created
1446d84
Blockmap sync fix (#44743)
Release Notes: - Improved display map rendering performance with many lines in the the multi-buffer. --------- Co-authored-by: cameron <cameron.studdstreet@gmail.com> Co-authored-by: Cole Miller <cole@zed.dev>
Yara 🏳️⚧️ , cameron , and Cole Miller created
80aefbe
Unified wording for discarding file changes in git panel (#45124)
In the `...` menu, we use `Discard...` <img width="390" height="317" alt="SCR-20251217-kbdh" src="https://github.com/user-attachments/assets/f88271a6-efab-48fb-bac1-2dacf4fad8f0" /> But in the context menu of each entry, we use "Restore..." <img width="366" height="250" alt="SCR-20251217-kbcj" src="https://github.com/user-attachments/assets/6c10842b-80f4-4868-a655-2703cba6bd5e" /> This PR just makes this more consistent, by using "Discard..." in the second case. Release Notes: - Unified wording for discarding file changes in git panel
Joseph T. Lyons created
1705a7c
ui: Remove `InlineCode` component (#45123)
We recently added this `InlineCode` component but I'd forgotten that many months ago I also introduced an `inline_code` method to the Label component which does the same thing. That means we don't need a standalone component at all! Release Notes: - N/A
Danilo Leal created
1cf3422
editor: Separate delimiters computation from the newline method (#45119)
Some refactoring I ran into while working on automatic Markdown list continuation on newline. This PR: - Moves `comment_delimiter` and `documentation_delimiter` computation outside of newline method. - Adds `NewlineFormatting`, which holds info about how newlines affect indentation and other formatting we need. - Moves newline-specific methods into the new `NewlineFormatting` struct. Release Notes: - N/A
Smit Barmase created
00ee061
Allow opening git commit view via URI scheme (#43341)
Add support for `zed://git/commit/<path-to-repo>#<sha>` (**EDIT:** now changed to `zed://git/commit/<sha>?repo=<path>`) URI scheme to access the git commit view implement parsing and handling of git commit URIs to navigate directly to commit views from external links. the main use case for me is to use OSC8 hyperlinks to link from a git sha into zed. this allows me e.g. to easily navigate from a terminal into zed **questions** - is this URI scheme appropriate? it was the first one i thought of, but wondering if `?ref=<some sha>` might make more sense – the git/commit namespace was also an equally arbitrary choice <details> <summary>video demo showing navigation from zed's built in terminal</summary> https://github.com/user-attachments/assets/18ad7e64-6b39-44b2-a440-1a9eb71cd212 </details> <details> <summary>video demo showing navigation from ghostty to zed's commit view</summary> https://github.com/user-attachments/assets/1825e753-523f-4f98-b59c-7188ae2f5f19 </details> Release Notes: - Added support for `zed://git/commit/<sha>?repo=<path>` URI scheme to access the git commit view --------- Co-authored-by: Agus Zubiaga <agus@zed.dev>
peter schilling and Agus Zubiaga created
5b8e4e5
git_ui: Fix select first entry selects the wrong visual first entry when tree view is enabled (#45108)
This PR fixes a bug where the select first didn't select the first visual entry when the first entry is a collapsed directory. Follow-up: https://github.com/zed-industries/zed/pull/45030 **Before**: https://github.com/user-attachments/assets/5e5865cc-ec0f-471d-a81b-9521fb70df41 **After**: https://github.com/user-attachments/assets/05562572-e43f-4d1e-9638-80e4dccc0998 Release Notes: - git_ui: Fix select first entry selects the wrong visual first entry when tree view is enabled
Remco Smits created
a16f071
agent_ui: Fix double axis scroll in the edited files list (#45116)
Previously, the list of edit files had a double axis scroll issue because the list itself scrolled vertically and each file row would scroll horizontally, causing a bad UX. The horizontal scroll intention was so that you could see the whole path, but I've included it in the tooltip in case it becomes obscured due to a small panel width. <img width="500" height="666" alt="Screenshot 2025-12-17 at 11 24@2x" src="https://github.com/user-attachments/assets/ea87236d-f5c6-475a-bf66-1afae7a6ca05" /> Release Notes: - agent: N/A
Danilo Leal created
c186877
lsp: Open updated imports in multibuffer after file rename (#45110)
Fixes an issue where we would update the imports after a file rename in TypeScript, but those changes wouldn't surface anywhere until those buffers were manually opened (https://github.com/zed-industries/zed/issues/35930#issuecomment-3366852945). In https://github.com/zed-industries/zed/pull/36681 we already added support for opening a multibuffer with edits, but vtsls has a different flow for renames. Release Notes: - Files with updated imports now open in a multibuffer when renaming or moving TypeScript or JavaScript files
Gaauwe Rombouts created
0c304c0
lsp: Persist vtsls update imports on rename choice (#45105)
Closes #35930 When a TypeScript file is renamed or moved, vtsls can automatically update the imports in other files. It pops up a message with the option to always automatically update imports. This choice would previously only be remembered for the current session and would pop up again after a restart. Now we persist that choice to the vtsls LSP settings in Zed, so that it remembers across editor sessions. Release Notes: - When renaming a TypeScript or JavaScript file, the selected option to automatically update imports will now be remembered across editor sessions.
Gaauwe Rombouts created
1b24b44
docs: Add Tailwind configuration section for JavaScript/TypeScript (#45057)
Addresses some tasks in #43969. Namely adding TailwindCSS documentation for the following languages: HTML, JavaScript and Typescript. **Some Notes** - Maybe the additional information in the HTML section is unnecessary, unsure open to suggestions. - I tried utilizing capturing groups with alternatives like `\\.(add|remove|toggle|contains)` but this didn't seem to work, so I was forced to use multiple lines. Release Notes: - N/A --------- Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
André Eriksson and Danilo Leal created
71e8b55
nightly: Temporarly delete commit message prompt from rules library (#45106)
Relevant for Nightly Users only, follow up to #45004. In case you use nightly this will break preview/stable since deserialisation will fail. Shipping this to Nightly so that staff does not run into this issue. We can revert this PR in the following days. I'll make a follow up PR which only stores the prompt in the database in case you customise it. Release Notes: - N/A
Bennet Bo Fenner created
acae823
agent_ui: Add regeneration button to text and agent thread titles (#43859)
<img width="500" height="830" alt="Screenshot 2025-12-17 at 10 10@2x" src="https://github.com/user-attachments/assets/057fe20b-50b3-44de-96b8-8a6e3d9239df" /> Release Notes: - agent: Added the ability to regenerate the auto-summarized title of threads to the "Regenerate Thread Title" button available the ellipsis menu of the agent panel. --------- Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Aero and Danilo Leal created
9b8bc63
Revert "Remove CopyAsMarkdown" (#45101)
Reverts https://github.com/zed-industries/zed/pull/44933. It turns out that if you're copying agent responses to paste it anywhere else that isn't the message editor (e.g., for a follow up prompt), getting Markdown formatting is helpful. However, with the revert, the underlying issue in https://github.com/zed-industries/zed/issues/42958 remains, so I'll reopen that issue, unfortunately. Release Notes: - N/A
Danilo Leal created
4af26f0
Fix tab bar button flickering when opening menus (#45098)
Closes #33018 ### Problem When opening a `PopoverMenu` or `RightClickMenu`, the pane's tab bar buttons would flicker (disappear for a couple frames then reappear). This happened because: 1. The menu is created and `window.focus()` was called immediately 2. However, menus are rendered using `deferred()`, so their focus handles aren't connected in the dispatch tree until after the deferred draw callback runs 3. When the pane checks `has_focus()`, it calls `contains_focused()` which walks up the focus hierarchy — but the menu's focus handle isn't linked yet 4. `has_focus()` returns false → tab bar buttons disappear 5. Next frame, the menu is rendered and linked → `has_focus()` returns true → buttons reappear ### Solution Delay the focus transfer by 2 frames using nested `on_next_frame()` calls before focusing the menu. **Why 2 frames instead of 1?** The frame lifecycle in GPUI runs `next_frame_callbacks` BEFORE `draw()`: ``` on_request_frame: 1. Run next_frame_callbacks 2. window.draw() ← menu rendered here via deferred() 3. Present ``` So: - **Frame 1**: First `on_next_frame` callback runs, queues second callback. Then `draw()` renders the menu and connects its focus handle to the dispatch tree. - **Frame 2**: Second `on_next_frame` callback runs and focuses the menu. Now the focus handle is connected (from Frame 1's draw), so `contains_focused()` returns true. With only 1 frame, the focus would happen BEFORE `draw()`, when the menu's focus handle isn't connected yet. This follows the same pattern established in b709996ec6 which fixed the identical issue for the editor's `MouseContextMenu`.
Antonio Scandurra created
b29e824
Fix Yara's GitHub handle (#45095)
Release Notes: - N/A
Yara 🏳️⚧️ created