Skip to content

Upstream merge 2026 02 26 - #11

Merged
lukemarsden merged 93 commits into
mainfrom
upstream-merge-2026-02-26
Feb 26, 2026
Merged

Upstream merge 2026 02 26#11
lukemarsden merged 93 commits into
mainfrom
upstream-merge-2026-02-26

Conversation

@lukemarsden

Copy link
Copy Markdown

No description provided.

Veykril and others added 30 commits February 24, 2026 09:24
…es#49963)

This hits the sqlite database unnecessarily

Release Notes:

- N/A *or* Added/Fixed/Improved ...
…d-industries#49931)

Follow-up to zed-industries#45600.

## Summary

Fix mouse scroll reports sending only one event when scrolling down in
terminal apps with mouse mode (tmux, neovim, etc.), regardless of how
many lines were scrolled.

## The Problem

After zed-industries#45600, trackpad scrolling speed was fixed. But when scrolling
**down** (negative `scroll_lines`), the terminal was still sending only
**one** scroll report per gesture, no matter how many lines the user
scrolled. Scrolling up worked correctly.

## Root Cause

In `scroll_report()` we had:

https://github.com/zed-industries/zed/blob/a8043dcff8f28a0443d7ec238e7f020689ebe1ff/crates/terminal/src/mappings/mouse.rs#L96

`scroll_lines` can be negative (scroll down) or positive (scroll up).
For negative values:

| scroll_lines | max(scroll_lines, 1) | Reports sent | Verdict |
|--------------|---------------------|--------------|------|
| 3 (up)       | 3                   | 3           |Right
| -3 (down)    | 1                   | 1           |WRONG|

So we always sent exactly 1 report when scrolling down, losing the
scroll magnitude.

Use `scroll_lines.unsigned_abs()` instead of `max(scroll_lines, 1)`.
This matches how `alt_scroll()` in the same file already handles
`scroll_lines`. Now both directions send the correct number of reports.

https://github.com/zed-industries/zed/blob/a8043dcff8f28a0443d7ec238e7f020689ebe1ff/crates/terminal/src/mappings/mouse.rs#L102

## Testing

- Added unit tests: `scroll_report_repeats_for_negative_scroll_lines`
and `scroll_report_repeats_for_positive_scroll_lines`
- Manually tested scrolling in tmux and neovim with mouse mode

---

Release Notes:

- Fixed mouse scroll in terminal apps (tmux, neovim, etc.) only sending
one scroll event when scrolling down, regardless of scroll amount
…industries#49858)

## Summary
- Route `zed:extension/github` in `since_v0_0_4` to the `since_v0_6_0`
bindings
- Call `latest_github_release` through `since_v0_6_0` for compatibility
with the v0.0.4 extension API

Release Notes:

- Fixed backward compatibility for v0.0.4 extension API GitHub bindings.
Today I added ubuntu LTS distributions to my debian repo.
You can find the index of noble and jammy here
https://debian.griffo.io/apt/dists/noble/main/binary-amd64/Packages
https://debian.griffo.io/apt/dists/jammy/main/binary-amd64/Packages

So far zed is the second most download package in my repo!

<img width="769" height="648" alt="image"
src="https://github.com/user-attachments/assets/e07a2312-e56a-4e2c-86d9-70cbf6c6aa73"
/>

Release Notes:

- N/A
…zed-industries#49968)

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Closes zed-industries#40602

### Summary

This PR ensures that active debug lines only open in a single pane and
new active debug lines are added to the most recent pane that contained
an active debug line. This fixes a bug where Zed could go to the active
debug line file and location in every pane a user had open, even if that
pane was focused on a different file.

I fixed this by storing the `entity_id` of the pane containing the most
recently active debug line on `BreakpointStore`, this is consistent with
where the selected stack frame is stored. I used an `entity_id` instead
of a strong type to avoid circular dependencies. Whenever an active
debug line is being set in the editor or by the debugger it now checks
if there's a specific pane it should be set in, and after setting the
line it updates `BreakpointStore` state.

I also added a new method on the `workspace::Item` trait called `fn
pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>)`
To enable `Editor` to update `BreakpointStore`'s active debug line pane
id whenever an `Editor` is moved to a new pane.


### PR review TODO list

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- debugger: Fix bug where active debug lines could be set in the wrong
pane
As we have checkerboard, used same pattern as git diff inside Image
Viewer.
Now that CPU instructions aren't an issue, perhaps size can be lowered
to 16/24 for base boxes.



Release Notes:

- N/A
…9972)

Lost another battle to the GitHub docs. Instead, now let's just do it
ourselves here in bash and not guess whatever GitHub is referring to in
their documentation..

Release Notes:

- N/A
…tries#49980)

This makes the "Open File" button in the file header within multibuffers
also visible as you hover over the headers. Previously, this button
would only show up for the selected/focused file, but it now also shows
up on hover for making mouse-based interaction easier.

Release Notes:

- N/A
…cerpt` (zed-industries#49986)

Co-authored by: John Tur <jtur@zed.dev>
Release Notes:

- N/A *or* Added/Fixed/Improved ...
…ed-industries#49988)

This PR hides the `git: review diff` action when not in the branch diff
view, because otherwise, that wouldn't do anything.

Release Notes:

- N/A
…-industries#49993)

The AI-assisted "Review Diff" action was only working for committed
changes because we were passing HEAD in the git command. Without it, it
captures all of the working tree changes, the same way the Branch Diff
view itself does. I think this is now better and more intuitive, because
it shouldn't be required that you commit the changes to have them
quickly reviewed by an agent.

Release Notes:

- N/A
## Summary

Add `workspace::ActivateLastPane` so users can bind a shortcut (for
example `cmd-9`) to focus the last pane.

## Why

Today, the closest option is `workspace::ActivatePane` with an index
(for example `8`), but that has side effects: when the index does not
exist, it creates/splits panes (`activate_pane_at_index` fallback).

`ActivateLastPane` gives a stable, no-surprises target: focus the
rightmost/last pane in current pane order, never create a new pane.

## Context

This capability has been requested by users before:
- zed-industries#17503 (comment)

## Prior art

VS Code exposes explicit editor-group focus commands and index-based
focus patterns (e.g. `workbench.action.focusSecondEditorGroup` ...
`focusEighthEditorGroup`) in its workbench commands:
-
https://github.com/microsoft/vscode/blob/main/src/vs/workbench/browser/parts/editor/editorCommands.ts#L675-L724

Zed already follows numbered pane focus in default keymaps
(`ActivatePane` 1..9 on macOS/Linux/Windows), so adding a dedicated
"last pane" action is a small, natural extension:
- `assets/keymaps/default-macos.json`
- `assets/keymaps/default-linux.json`
- `assets/keymaps/default-windows.json`

## Change

- Added `workspace::ActivateLastPane`
- Implemented `Workspace::activate_last_pane(...)`
- Wired action handler in workspace listeners
- Added `test_activate_last_pane`

## Validation

- `cargo test -p workspace test_activate_last_pane -- --nocapture`
- `cargo test -p workspace test_pane_navigation -- --nocapture`
- `cargo fmt --all -- --check`

## Risk

Low: focus-only behavior, no layout/data changes, no default keymap
changes.

Release Notes:

- Added `workspace::ActivateLastPane` action for keybindings that focus
the last pane.

---------

Co-authored-by: xj <gh-xj@users.noreply.github.com>
This makes the full history available in tests. 

Release Notes:

- N/A
…9999)

Cleans up a new GitHub Actions workflow.

Before you mark this PR as ready for review, make sure that you have:
- ~~[ ] Added a solid test coverage and/or screenshots from doing manual
testing~~
- [x] Done a self-review taking into account security and performance
aspects
- ~~[ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)~~

Release Notes:

- N/A
Updates the check to explicitly compare against `origin/main` as opposed
to just `main`.

Release Notes:

- N/A
…ed-industries#48977)

When copying multiple selections with copy-and-trim, create a single
clipboard selection spanning the original buffer range rather than one
selection per trimmed line. This preserves correct paste behavior in Vim
mode when pasting trimmed content.

Closes zed-industries#48869.

Release Notes:

- Fixed clipboard selection range for multi-line copy-and-trim

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
Disable the cron schedule for the background agent MVP workflow. Manual
runs via workflow_dispatch are still available.

The workflow was running daily on weekdays but the project is being
paused. This change:
- Comments out the schedule trigger
- Adds a note pointing to the Notion doc for context
- Preserves the ability to run manually

See [Background Agent for
Zed](https://www.notion.so/Background-Agent-for-Zed-3038aa087eb980449b9ee02f70ae8413)
Notion doc for current status and contacts to resume this work.

Release Notes:

- N/A
Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
GitHub 4 me 0 - after testing for x times in a local and even the remote
setup provided by Namespace during an action, this now adds a dedicated
step to debug the failure we are seeing in extension tests to finally
resolve said issue.

Release Notes:

- N/A
…ed-industries#50014)

Also removes the debugging step again.

Release Notes:

- N/A
We were resolving inlay hints against an old snapshot, which
occasionally led to panics

Co-Authored-By: Cole <cole@zed.dev>

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed a (rare) panic in inlay hints

Co-authored-by: Cole <cole@zed.dev>
…-industries#49191)

## Summary

Fixes **ZED-2XA** — "Unexpected duplicated status entries: Untracked and
Untracked" crash.

**Impact:** 22 occurrences, 3 users affected (Sentry). The panic was
introduced in zed-industries#23483 (2025-01-22) which added the `dedup_by` logic for
handling deleted-in-index + untracked file combinations.

No related GitHub issues were found filed against this crash.

## Root Cause

`GitStatus::from_str` sorts entries by path and then calls `dedup_by` to
merge duplicate entries. The only handled case was `(INDEX_DELETED,
Untracked)` — all other duplicates hit a catch-all `panic!`. In
practice, git can produce duplicate `??` (untracked) entries for the
same path, which triggered this crash.

## Fix

- Identical duplicate statuses (e.g., `Untracked, Untracked`) are now
silently deduplicated (keep one)
- Other unexpected duplicate combinations log a warning instead of
crashing
- Added a regression test that parses `"?? file.txt\0?? file.txt"` and
verifies it produces a single entry

## Verification

- Reproduction test passes: `cargo test -p git --
test_duplicate_untracked_entries`
- Full crate tests pass: `cargo test -p git` (20/20)
- Clippy clean: `./script/clippy`

Release Notes:

- Fixed a crash when git produces duplicate status entries for the same
file path

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…50021)

## Summary

Add a standalone **humanizer** skill based on Wikipedia's "Signs of AI
writing" guide that detects and fixes 24 common AI-writing patterns.
Also update brand-writer to recommend running humanizer as a
pre-validation step for high-stakes content.

## Details

**New skill: `/humanizer`**
- Detects 24 AI-writing anti-patterns from Wikipedia's guide (maintained
by WikiProject AI Cleanup)
- Covers content patterns (significance inflation, vague attributions),
language patterns (copula avoidance, synonym cycling), style patterns
(em dash overuse, boldface), and communication patterns (chatbot
artifacts, sycophantic tone)
- Includes a two-pass audit workflow: draft rewrite → "What makes this
obviously AI generated?" → final revision
- Adds guidance on injecting "soul" and personality, not just removing
bad patterns

**Updated: brand-writer**
- Added Phase 4 "Humanizer Pass" recommending `/humanizer` for
high-stakes content (homepage, announcements, product pages)
- Phases renumbered (Validation is now Phase 5)

## Attribution

Based on [blader/humanizer](https://github.com/blader/humanizer) and
[Wikipedia:Signs of AI
writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing).

Release Notes:

- N/A
Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
Port of zed-industries#10314 to the wgpu renderer

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed a panic when rendering an image larger than the GPU could
support.
rtfeldman and others added 23 commits February 25, 2026 12:36
This code was part of a series of stacked diff PRs that became obsolete
because we changed the UI design, so none of this code is necessary
anymore.

Release Notes:

- N/A
…red files (zed-industries#49521)

## Summary
- Keep auto-reveal behavior for ignored files unchanged (no implicit
reveal).
- When an ignored file is already visible in the project panel, mark it
as selected on `ActiveEntryChanged`.
- Add regression coverage for switching back to a visible gitignored
file.

## Testing
- `project_panel_tests::test_autoreveal_and_gitignored_files`
- `project_panel_tests::test_gitignored_and_always_included`
- `project_panel_tests::test_explicit_reveal`

Closes zed-industries#49515

Release Notes:

- Fixed project panel not updating selection when switching to a
gitignored file that was already visible.
Also, `ep split train=100` now means 100 lines, not 100 groups (repos or
cursor_paths).


Release Notes:

- N/A
…s#50114)

Trying to keep it from reiterating instructions


Release Notes:

- N/A
This is a follow-up on zed-industries#50027

I address my comments by adding a hash map look-up to find the selected
pending commit. I also removed the limitation where we would only retry
finding the pending commit 5 times. The pending selection is removed
when the graph is fully loaded and doesn't contain the pending commit.

This PR also cleans up some internal code structure and starts work to
enable search and propagating git log error messages to the UI.

UI wise I made the git graph item show the repository name instead of
"Git Graph" in Zed.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
This PR removes Preview callouts from documentation for features that
are now in Stable.

Features documented with Preview callouts are now included in the stable
release.

Generated by script/docs-strip-preview-callouts

Release Notes:

- N/A
Documentation updates for Preview release - generated by
docs-suggest-publish

Release Notes:

- N/A
…s#50122)

Adds `gpt-5.3-codex` as a built-in model under the OpenAI provider for
BYOK usage.

Model specs:
- 400,000 context window
- 128,000 max output tokens
- Reasoning token support (default medium effort)
- Uses the Responses API (like other codex models)
- Token counting falls back to the gpt-5 tokenizer

Closes AI-59

Release Notes:

- Added support for GPT-5.3-Codex as a bring-your-own-key model in the
OpenAI provider.
Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This PR shortens the length of the Git SHAs in the PR titles to 7
characters, as this is the default for short SHAs.

Release Notes:

- N/A
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
…ies#50137)

We don't want to show the sidebar to users if they have `disable_ai`
enabled because it's an AI focused feature. In the future if we add non
AI functionality to the sidebar we'll reenable it.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
- Render the output only when needed, fixes the duplicate output that
can happen after opening a saved notebook.
- Vim in Jupyter View with j/k navigation across notebook cells

Release Notes:

- N/A
…space to multi workspace (zed-industries#49995)

Now that MultiWorkspace is the root view, actions bound to the
`Workspace` key context wouldn't be dispatched when `Workspace` is not
in the key context stack (e.g. when the sidebar is focused). To fix
this, the `Workspace` key context and action handlers are moved up to
the MultiWorkspace rendering layer. This avoids introducing a new key
context and the keymap migration that would require.

This PR also moves modal rendering up a layer so modals are centered
within the window (MultiWorkspace element) instead of the Workspace
element.

### Before
<img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/233a0b75-47a1-423a-8394-c6a1b50fb991"
/>
### After
<img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/9c51c839-e524-4ef8-afc9-9429b028def0"
/>


Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
…re mode (zed-industries#50141)

In some evals, the teacher produced hallucinations, seemingly due to
context rot. This makes the zeta prompt crate's budgeted rendering
usable by the teacher, so that it can truncate the list of excerpts.

I've also cleaned up the implementation of zeta_prompt's
`format_related_files_within_budget`, and changed the behavior so that
it filters the the excerpts by priority but renders the files in their
original order.

Release Notes:

- N/A
## Summary

Fixes issues discovered while running the docs automation workflow for
the first time, plus improvements based on the v0.225 run where 44
suggestions overwhelmed a single Droid invocation.

### docs-suggest-publish
- Ignore untracked files when checking for clean working directory
- Add `--auto high` flag to droid exec for non-interactive use
- Add error handling to show droid output on failure
- Remove non-existent `documentation` label from PR creation
- Use `--write` flag for prettier to fix formatting
- **Batch suggestions** into groups of 10 (configurable with
`--batch-size`) to prevent Droid from dropping suggestions when context
is too large
- **Pre-PR docs build validation** — runs `generate-action-metadata` +
`mdbook build` before creating the PR to catch invalid `{#action}` and
`{#kb}` references locally instead of waiting for CI (skippable with
`--skip-validation`)
- **Prompt guardrail** — instructs Droid not to invent `{#kb}` or
`{#action}` references, only reusing action names already present in
docs files
- **Stable release detection** — at publish time, checks each queued
PR's merge commit against the latest stable release tag. PRs already in
stable get annotated "ALREADY IN STABLE" so Droid applies content
changes without adding incorrect Preview callouts
- **Feature flag detection** — parses
`crates/feature_flags/src/flags.rs` for all feature flag struct names,
then checks each PR's diff for references. PRs behind feature flags are
skipped entirely since those features aren't generally available yet

### docs-strip-preview-callouts
- Remove non-existent `documentation` label from PR creation
- Add `Release Notes: - N/A` to generated PR body (fixes Danger bot
check)

## Context

These scripts were run for the first time as part of the v0.225 release.
Issues found:
1. The `documentation` label doesn't exist in this repo
2. Droid exec needs `--auto high` for non-interactive execution
3. Prettier needs `--write` to actually fix files (was running in check
mode)
4. Untracked files should not block the workflow
5. Sending all 44 suggestions in one Droid invocation only applied 2 —
batching in groups of 10 fixed this
6. Droid hallucinated action names (`settings::OpenSettings`,
`gpui::Modifiers::secondary_key`) that broke the docs preprocessor build
7. PRs that shipped in stable v0.225 incorrectly got Preview callouts
because the queue doesn't distinguish preview-only from
already-in-stable
8. PRs behind feature flags (subagents, git graph) got documented
despite not being generally available

Release Notes:

- N/A
More fallout from zed-industries#49277.

Closes zed-industries#50149.

Release Notes:

- Fixed remote server failing to launch on Windows.
This PR improves the language server submenu UI, which previously, had
its width growing way too much to fit the server message as well as some
other small inconsistencies. Now, this is all fixed and the server
message appear in full.

| Before | After |
|--------|--------|
| <img width="2312" height="1342" alt="Screenshot 2026-02-26 at 1 
13@2x"
src="https://github.com/user-attachments/assets/6922a78f-75aa-4004-af34-9343998ac6c5"
/> | <img width="2312" height="1342" alt="Screenshot 2026-02-26 at 1 
17@2x"
src="https://github.com/user-attachments/assets/03c6a9c9-e814-4de2-a0d6-de86a73fa1df"
/> |

Release Notes:

- N/A
When `row_infos.is_empty()` (if you have very very tiny editors) we
could
end up trying to read the first item out of it.

Fixes ZED-5AT
Fixes ZED-54F
Fixes ZED-56N

Updates  zed-industries#49260

cc @Veykril

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed a panic rendering diff hunk headers in 0-height editors
…industries#49032)

## Summary

- Fix SSH `-L` port-forward arguments to wrap IPv6 addresses in brackets
(e.g. `-L[::1]:8080:[::1]:80`), so SSH can correctly parse them
- Rewrite `parse_port_forward_spec` to support bracket-wrapped IPv6
tokens like `[::1]:8080:[::1]:80`
- Add diagnostic logging for stdin read failures in the remote server to
aid debugging connection issues

Closes zed-industries#49009

## Test plan

- [x] New unit tests: `test_parse_port_forward_spec_ipv6`,
`test_port_forward_ipv6_formatting`,
`test_build_command_with_ipv6_port_forward`
- [x] Existing tests pass: `cargo test -p remote --lib
transport::ssh::tests` (6/6)
- [ ] Manual verification: connect via SSH to an IPv6 host with port
forwarding configured

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
@lukemarsden
lukemarsden merged commit b118f85 into main Feb 26, 2026
14 checks passed
lukemarsden pushed a commit that referenced this pull request Apr 9, 2026
)

When atlas tiles are rapidly allocated and freed (e.g. watching a shared
screen in Collab), a texture can become unreferenced and be removed
while GPU uploads for it are still pending. On the next frame,
`flush_uploads` indexes into the now-empty texture slot and panics:

```
  thread 'main' panicked at crates/gpui_wgpu/src/wgpu_atlas.rs:231:40:
  texture must exist...

  #11 core::option::expect_failed
  #12 gpui_wgpu::wgpu_atlas::WgpuAtlas::before_frame
  #13 gpui_wgpu::wgpu_renderer::WgpuRenderer::draw
```

This change drains pending uploads for a texture when it becomes
unreferenced in `remove`, and skips uploads for missing textures in
`flush_uploads` as a safety net.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


Release Notes:

- Fixed occasional crashes when viewing a screen share
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.