Skip to content

fix(sidebar): keep section drag and tear state from swallowing side-tab clicks - #2052

Merged
Hona merged 1 commit into
devfrom
fix/sidebar-sections-tab-click
Dec 1, 2026
Merged

Hona merged 1 commit into
devfrom
fix/sidebar-sections-tab-click

Conversation

@Hona

@Hona Hona commented Dec 1, 2026

Copy link
Copy Markdown
Member

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

  1. Stale DragState::Ignoring swallowed fresh tab presses (ops.rs::tab_drag, mod.rs::window_left):
    • window_left only cleared drag.is_gesture(), which excluded DragState::Ignoring, Dropped, and Landed.
    • In tab_drag, a fresh plain Phase::Down hit the matches!(state(s).drag, DragState::Ignoring) branch before select_tab, treating the new press as a move and skipping tab activation.
  2. Unscoped DragState::Dropped and stuck Dragging/DraggingSection swallowed Event::Press (drag.rs::step):
    • DragState::Dropped now records the dragged element's source key and only suppresses the trailing Press on that exact element (never an unrelated tab or header).
    • A Press arriving while Dragging or DraggingSection now resets to Idle and returns Effect::Click instead of staying stuck.
  3. DragState::Landed never settled back to Idle (drag.rs, mod.rs::poll):
    • After moving a tab into a section, DragState::Landed lingered indefinitely, keeping .raise() permanently active on the moved tab slot and section block (and disabling PaintKeep window-wide).
    • Landed now carries an explicit clock deadline (LAND_SETTLE = 0.35s), wakes via tx.wake_at, and transitions cleanly to Idle via Event::Tick.
  4. Horizontal jitter on release-activated clicks and Settings-open clicks (ops.rs):
    • Clicking the previously active tab while Settings is open now calls select_tab (closing Settings and showing the session) instead of returning early on current_tab() == Some(uid).
    • If horizontal pointer jitter (> 4 pt) suppresses Rune's on_press while a press stays Pending (below vertical drag slop and horizontal tear-out), releasing over the tab still opens it.
    • Stale horizontal tear-out state (groups::LAYOUT.tearing) now clears on fresh Phase::Down and window_left, and tab_drag resolves the tab's live index via s.tab_at(uid).

Note: 0.0.0-dev-516 (reported in #2034) also preceded Rune 13c24067 (#2011, which cancels an orphaned held drag when a second primary press arrives) and 7ce33b94 (#2033, PaintKeep folded-layer fix), which are already on dev.

Verification

  • pwsh scripts/guardrails.ps1 — 11/11 passed.
  • cargo check -p opencode-desktop and cargo check -p opencode-desktop --features stories — clean.
  • cargo clippy -p opencode-desktop --no-deps --features stories — 0 warnings in touched files.
  • Not run locally: live interactive GUI clicking on macOS 27 arm64 (verified statically and via compile/clippy/guardrails on Windows).

Copilot AI balanced review requested due to automatic review settings December 1, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@Hona
Hona merged commit cdfbd91 into dev Dec 1, 2026
3 checks passed
@Hona
Hona deleted the fix/sidebar-sections-tab-click branch December 1, 2026 18:35
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.

desktop: clicking a side tab sometimes doesn't open its session (Sidebar sections on)

2 participants