Skip to content

editor: Fix sticky header drag cancels autoscroll - #53592

Merged
Veykril merged 2 commits into
zed-industries:mainfrom
timvermeulen:fix-sticky-header-drag-cancels-autoscroll
Jul 24, 2026
Merged

editor: Fix sticky header drag cancels autoscroll#53592
Veykril merged 2 commits into
zed-industries:mainfrom
timvermeulen:fix-sticky-header-drag-cancels-autoscroll

Conversation

@timvermeulen

Copy link
Copy Markdown
Collaborator

In #52636 I seem to have introduced this bug, where mouse-down on a sticky header followed by an immediate mouse movements sometimes dropped the pending autoscroll request (to jump to the sticky header line):

self.autoscroll_request.take();

Fixed by exiting early from mouse_dragged when editor.has_autoscroll_request().

What sometimes happened before this fix:

bug.mov

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed bug where clicking on a sticky header would sometimes not jump to that line in the editor

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 10, 2026
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested a review from a team April 10, 2026 07:01
@github-actions github-actions Bot added the community champion Issues filed by our amazing community champions! 🫶 label Apr 10, 2026
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from as-cii and nathansobo and removed request for a team April 10, 2026 07:01
@zelenenka zelenenka assigned cole-miller and unassigned as-cii Apr 10, 2026

@Veykril Veykril left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril

Veykril commented Jun 1, 2026

Copy link
Copy Markdown
Member

has conflicts it seems

@cole-miller cole-miller removed their assignment Jun 8, 2026
@smitbarmase smitbarmase added the area:editor Feedback for code editing, formatting, editor iterations, etc label Jun 30, 2026
@Veykril
Veykril enabled auto-merge July 15, 2026 08:30
auto-merge was automatically disabled July 24, 2026 00:12

Head branch was pushed to by a user without write access

@timvermeulen
timvermeulen force-pushed the fix-sticky-header-drag-cancels-autoscroll branch 2 times, most recently from 1b9c87f to 9feff29 Compare July 24, 2026 00:42
@timvermeulen
timvermeulen force-pushed the fix-sticky-header-drag-cancels-autoscroll branch from 9feff29 to 3bcd04a Compare July 24, 2026 00:42
@Veykril
Veykril added this pull request to the merge queue Jul 24, 2026
Merged via the queue into zed-industries:main with commit f16101a Jul 24, 2026
36 checks passed
mdz-axo added a commit to mdz-axo/zed-kask that referenced this pull request Jul 25, 2026
Upstream changes (zed-industries/zed main, 27 commits):
- agent: Add agent.compaction_model setting for context compaction (zed-industries#60012)
- agent: Show effort selector for anthropic compatible providers (zed-industries#61579)
- acp: Update agent-client-protocol SDK to 2.0.0 (zed-industries#61570)
- client: Extract proxy handshakes into new proxy_handshake crate (zed-industries#61427)
- collab: Fix multiworkspace location out of sync bugs (zed-industries#61598)
- editor: Fix sticky header drag cancels autoscroll (zed-industries#53592)
- editor: Fix crash when copying and pasting using multiple cursors (zed-industries#61545)
- editor: Skip untitled buffers when saving a multi-buffer (zed-industries#61380)
- gpui: Fix images not being drawn with rounded corners with ObjectFit::Cover (zed-industries#61383)
- gpui: Fix deadlock in performance profiler and reenable it (zed-industries#61584)
- git_ui: Prevent Git panel bindings in repository selector (zed-industries#61282)
- language_model: Add explicit OpenAI conversation compaction and fix Anthropic compaction (zed-industries#61370)
- markdown: Fix squashed Mermaid diagrams in markdown preview (zed-industries#61260)
- Opus 5 BYOK Support (zed-industries#61596)
- repl: Show add-cell controls in empty notebooks (zed-industries#61329)
- search: Escape seeded buffer search query in regex mode (zed-industries#57748)
- settings: Fix VS Code import appending duplicate file associations (zed-industries#61355)
- settings: Split VSCode and Zed keymap files (zed-industries#61532)
- Treat blank spawn_agent session IDs as absent (zed-industries#60893)
- worktree: Reload git state when a watcher rescan covers a repository (zed-industries#61541)
- Plus 7 more minor fixes.

Merge fixes:
- crates/agent/src/thread.rs: replay_tool_call used 'message_ix' (undefined)
  after auto-merge; renamed to 'owning_message_ix' (the parameter name).
- Cargo.toml: Removed stale workspace members hkask-wallet and hkask-git-cas
  (both directories deleted in prior commits but workspace entries remained).
- kask/crates/hkask-regulation/src/wallet_manager.rs: Stubbed consume() and
  settle_rjoules() on WalletBudgetPort — these were API-key encumbrance
  operations from the deleted hkask-wallet crate; regulation tracks per-agent
  gas balances, not per-key encumbrances.
- kask/crates/hkask-regulation/src/wallet_gas_calibrator.rs: Fixed test to
  use crate::agent_wallet_store::WalletStore instead of hkask_storage::WalletStore.
- kask/crates/hkask-regulation/Cargo.toml: Added tokio macros feature to
  dev-dependencies for #[tokio::test].
- kask/crates/kask_bridge/Cargo.toml: Added futures dependency (needed by
  context_injector.rs for futures::executor::block_on).
- kask/crates/kask_bridge/src/context_injector.rs: Fixed futures_util::executor
  to futures::executor (futures-util doesn't include executor module).

Release Notes:

- N/A
0arm pushed a commit to 0arm/zed that referenced this pull request Jul 26, 2026
In zed-industries#52636 I seem to have introduced this bug, where mouse-down on a
sticky header followed by an immediate mouse movements sometimes dropped
the pending autoscroll request (to jump to the sticky header line):
https://github.com/zed-industries/zed/blob/1fcf9749a6ed384ae346ddf2049ae76e0cc430a9/crates/editor/src/scroll.rs#L453

Fixed by exiting early from `mouse_dragged` when
`editor.has_autoscroll_request()`.

What sometimes happened before this fix:


https://github.com/user-attachments/assets/b6dd6650-b5f0-4ea1-ae70-9c4cf69e31a0

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 bug where clicking on a sticky header would sometimes not jump
to that line in the editor
@timvermeulen
timvermeulen deleted the fix-sticky-header-drag-cancels-autoscroll branch July 27, 2026 14:06
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
In zed-industries#52636 I seem to have introduced this bug, where mouse-down on a
sticky header followed by an immediate mouse movements sometimes dropped
the pending autoscroll request (to jump to the sticky header line):
https://github.com/zed-industries/zed/blob/4999bd649d54b0758c373f8aac7ed7ebcb2692f2/crates/editor/src/scroll.rs#L453

Fixed by exiting early from `mouse_dragged` when
`editor.has_autoscroll_request()`.

What sometimes happened before this fix:


https://github.com/user-attachments/assets/b6dd6650-b5f0-4ea1-ae70-9c4cf69e31a0

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 bug where clicking on a sticky header would sometimes not jump
to that line in the editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants