Repository navigation
fix(sidebar): keep section drag and tear state from swallowing side-tab clicks - #2052
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the Experimental › Sidebar sections drag/press state machine so leftover drag, ignore, tear-out, or Settings state cannot swallow side-tab clicks.
Fixes #2034
Root causes fixed
DragState::Ignoringswallowed fresh tab presses (ops.rs::tab_drag,mod.rs::window_left):window_leftonly cleareddrag.is_gesture(), which excludedDragState::Ignoring,Dropped, andLanded.tab_drag, a fresh plainPhase::Downhit thematches!(state(s).drag, DragState::Ignoring)branch beforeselect_tab, treating the new press as a move and skipping tab activation.DragState::Droppedand stuckDragging/DraggingSectionswallowedEvent::Press(drag.rs::step):DragState::Droppednow records the dragged element'ssourcekey and only suppresses the trailingPresson that exact element (never an unrelated tab or header).Pressarriving whileDraggingorDraggingSectionnow resets toIdleand returnsEffect::Clickinstead of staying stuck.DragState::Landednever settled back toIdle(drag.rs,mod.rs::poll):DragState::Landedlingered indefinitely, keeping.raise()permanently active on the moved tab slot and section block (and disablingPaintKeepwindow-wide).Landednow carries an explicit clock deadline (LAND_SETTLE = 0.35s), wakes viatx.wake_at, and transitions cleanly toIdleviaEvent::Tick.ops.rs):select_tab(closing Settings and showing the session) instead of returning early oncurrent_tab() == Some(uid).on_presswhile a press staysPending(below vertical drag slop and horizontal tear-out), releasing over the tab still opens it.groups::LAYOUT.tearing) now clears on freshPhase::Downandwindow_left, andtab_dragresolves the tab's live index vias.tab_at(uid).Note:
0.0.0-dev-516(reported in #2034) also preceded Rune13c24067(#2011, which cancels an orphaned held drag when a second primary press arrives) and7ce33b94(#2033,PaintKeepfolded-layer fix), which are already ondev.Verification
pwsh scripts/guardrails.ps1— 11/11 passed.cargo check -p opencode-desktopandcargo check -p opencode-desktop --features stories— clean.cargo clippy -p opencode-desktop --no-deps --features stories— 0 warnings in touched files.