Skip to content

Remove wheel-scroll tab/pane navigation (rollback #80/#83)#104

Merged
GeneralD merged 2 commits into
mainfrom
revert/103-remove-wheel-scroll
Jun 19, 2026
Merged

Remove wheel-scroll tab/pane navigation (rollback #80/#83)#104
GeneralD merged 2 commits into
mainfrom
revert/103-remove-wheel-scroll

Conversation

@GeneralD

@GeneralD GeneralD commented Jun 19, 2026

Copy link
Copy Markdown
Owner

type breaking scope diff files tests

Rolls back and completely removes the mouse-wheel tab/pane navigation
feature (scroll + scroll_cooldown_ms, #80/#83). Closes #103.

Why

zellij delivers ScrollUp/ScrollDown with no device identity and no
physical detent
, so a notched wheel and a stepless device (Magic Mouse,
trackpad) are indistinguishable at the event level. A stepless device emits a
burst of events per flick, and no single rate-limiter value reconciles both
classes — a short cooldown still races through many tabs/panes, a long one locks
out deliberate input and lets momentum tails add stray steps. The successive
attempts each only moved the failure mode:

On a Magic Mouse / trackpad the bar still receives a flood of scroll events up
front and then stops responding. There is no scroll_cooldown_ms value that
behaves correctly for both device classes, so the feature is removed rather than
tuned further. Full rationale in #103.

What's removed

  • src/scroll.rs — deleted in full (traversal + gate rate-limiter).
  • src/lib.rsscroll_cooling state, the ScrollUp/ScrollDown/Timer
    handlers, the EventType::Timer subscription, scroll / arm_scroll_cooldown
    / scroll_tabs / scroll_panes / focused_pane_id / pane_focus_order, and
    the wheel test suite + helpers.
  • src/config.rs — the scroll and scroll_cooldown_ms keys, their defaults,
    parsing, and tests.
  • src/projection.rspane_ids_in_reading_order (scroll-only) and its tests;
    is_tiled_terminal stays (still used by project).
  • README.md — the scroll / scroll_cooldown_ms documentation.

Compatibility / breaking

Config parsing is total, so existing layouts that still set scroll /
scroll_cooldown_ms keep loading — the now-unknown keys are simply ignored and
have no effect. The wheel over the bar returns to inert (pre-#80). No permission
change: wheel navigation needed nothing beyond the default set
(ReadApplicationState + ChangeApplicationState).

Verification

  • cargo build --target wasm32-wasip1 — ✓
  • cargo test --lib (host triple) — 268 passed, 0 failed
  • cargo clippy --lib — clean ✓
  • cargo fmt --check — clean ✓

Related

#80 (feature), #83 (cooldown), #96 / #97, #100 / #101 (fix attempts),
#77 (mouse-interaction tracking).

Summary by CodeRabbit

  • Documentation
    • Updated configuration examples and option descriptions: removed scroll/cooldown settings; added tab gap and pane fill gradient controls, plus inactive-tab dimming and active-tab depth lift.
  • Removed Features
    • Removed mouse wheel navigation for switching tabs and panes, along with related cooldown gating.
    • Removed tab drag/reorder behavior and the associated configuration option.
  • Permissions
    • Simplified the permission request to a fixed two-permission set.

zellij delivers ScrollUp/ScrollDown with no device identity and no
physical detent, so a notched wheel and a stepless device (Magic Mouse,
trackpad) are indistinguishable at the event level. A stepless device
emits a burst of scroll events per flick, and no single rate-limiter
setting reconciles both classes: a short cooldown still races through
many tabs/panes, while a long one locks out deliberate input and lets
momentum tails add stray steps. The successive attempts -- leading-edge
cooldown (#83), debounce-to-last-event (#96), reopen-on-timer throttle
(#100) -- each only traded one failure mode for another.

Roll the feature back entirely: delete src/scroll.rs, the scroll /
scroll_cooldown_ms config keys, the ScrollUp/ScrollDown/Timer handlers
and the EventType::Timer subscription, the cooldown state, the
scroll-only pane traversal helper (projection::pane_ids_in_reading_order),
and the README docs. The wheel over the bar returns to inert (pre-#80).

Closes #103.

BREAKING CHANGE: the `scroll` and `scroll_cooldown_ms` config keys are
removed and the mouse wheel no longer navigates tabs/panes. Existing
layouts keep loading -- config parsing is total, so the now-unknown keys
are simply ignored -- but they have no effect. No permission change.
Copilot AI review requested due to automatic review settings June 19, 2026 12:59
@GeneralD GeneralD self-assigned this Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0528c31-f35f-4793-af7c-aea2f9277a5f

📥 Commits

Reviewing files that changed from the base of the PR and between 1f595df and 8c216fd.

📒 Files selected for processing (5)
  • README.md
  • cliff.toml
  • src/config.rs
  • src/lib.rs
  • src/line.rs

📝 Walkthrough

Walkthrough

The PR removes mouse-wheel tab/pane navigation and drag-to-reorder features entirely. src/config.rs drops scroll, scroll_cooldown_ms, and reorder fields with parsing and tests. src/lib.rs removes the scroll module export, scroll_cooling and drag state fields, timer subscription, and all scroll/drag handlers and helpers. src/line.rs removes Shift enum and drag_steps gesture API. src/projection.rs deletes pane_ids_in_reading_order helper. Tests across all files are updated or removed. README.md and cliff.toml documentation are revised.

Changes

Gesture feature removal

Layer / File(s) Summary
Config: scroll and reorder settings removal
src/config.rs
Removes ScrollMode import, scroll, scroll_cooldown_ms, and reorder struct fields with defaults and doc comments; removes parsing branches in from_configuration; updates test assertions and deletes parsing-specific unit tests.
State struct and subscription initialization changes
src/lib.rs
Removes pub mod scroll export, scroll_cooling and drag fields from State, DragState type definition; updates load() to use Self::permissions() without arguments and removes EventType::Timer subscription.
Permissions function and event handler cleanup
src/lib.rs
Simplifies State::permissions() to a zero-arg function with fixed return value; removes mouse wheel scroll/navigation and timer-driven cooldown handling from update() dispatch; strips drag gesture arms.
Helper implementation and impl block cleanup
src/lib.rs
Deletes scroll dispatcher, cooldown arming, tab/pane scroll helpers, focused-pane lookup, and pane-order traversal functions from impl State block.
Event and interaction test updates and removals
src/lib.rs
Updates permission test for fixed two-permission request; changes load test input to remove reorder config; removes drag-reorder expectations from mouse interaction tests; deletes scroll/cooldown and wheel event tests; adjusts close-button click test; removes scroll/drag test helpers.
Line module gesture API removal
src/line.rs
Updates module documentation to clarify click-to-focus behavior and remove drag references; removes Shift enum and drag_steps function with drop-resolution helpers; deletes drag_steps test suite.
Projection helper removal
src/projection.rs
Removes pane_ids_in_reading_order public function and tests; is_tiled_terminal remains intact.
Documentation and changelog updates
README.md, cliff.toml
Removes scroll/cooldown example and documentation; adds tab_gap and gradient rendering options (gradient, gradient_shape, gradient_angle, gradient_radial), inactive_dim, and perspective; updates changelog note about reorder permissions and adds note on releases/latest/download/ permission keying.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • GeneralD/zellij-tabmap#21: Inverse change that introduces Shift enum and drag_steps function to src/line.rs for drag-to-reorder gesture calculation.
  • GeneralD/zellij-tabmap#22: Inverse change that adds drag-to-reorder state (drag: Option<DragState>) and handler logic to src/lib.rs with MoveTabByTabId permission.
  • GeneralD/zellij-tabmap#90: Introduces the wheel-scroll cooldown implementation (scroll_cooldown_ms, cooldown gate logic) that this PR deletes across config, scroll module, and state handling.

Poem

🐇 Two gestures spun beyond our reach,
Scroll bursts and drag reorder teach
That some code paths belong in dreams.
We hop back clean—no middle schemes!
The bar stays still, the drags are gone,
Simplicity: our best new dawn. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: removing wheel-scroll navigation and rolling back prior changes (#80/#83), which aligns with all the significant code deletions across multiple files.
Linked Issues check ✅ Passed All code changes align with #103 requirements: src/scroll.rs deleted, scroll state/handlers removed from src/lib.rs, scroll config removed from src/config.rs, pane_ids_in_reading_order removed from src/projection.rs, and documentation updated in README.md, with backward compatibility maintained.
Out of Scope Changes check ✅ Passed All changes are directly scoped to removing wheel-scroll navigation as specified in #103; no unrelated modifications detected beyond the intended removal scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/103-remove-wheel-scroll

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts and removes the previously added mouse-wheel tab/pane navigation feature, returning wheel behavior over the tab bar to inert (pre-#80) and eliminating the associated config surface and traversal logic.

Changes:

  • Deletes the wheel traversal + cooldown limiter implementation and its unit tests (src/scroll.rs).
  • Removes wheel event handling/state and all scroll-specific helpers/tests from the plugin state machine (src/lib.rs).
  • Removes scroll / scroll_cooldown_ms config keys (and their docs/tests), and drops the now-scroll-only reading-order helper from projection (src/config.rs, src/projection.rs, README.md).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/scroll.rs Removes the pure traversal + cooldown-gate module and its tests.
src/lib.rs Removes wheel event handling, cooldown state, and pane/tab traversal helpers/tests.
src/config.rs Removes scroll-related config keys, defaults, parsing, and tests.
src/projection.rs Removes the scroll-only pane reading-order helper and its tests; keeps the tiled-pane filter.
README.md Removes documentation for scroll and scroll_cooldown_ms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zellij never delivers the tab-drag Hold/Release events to a
non-selectable `default_tab_template` bar, so drag-to-reorder was inert
in normal use (#102) — the same "mouse gesture on a pinned bar" dead-end
that sank wheel-scroll (#103). Rather than keep dead code and a dormant
permission behind a config flag, remove the feature entirely.

- config: drop the `reorder` key (parsing is total — existing layouts
  keep loading, the key is simply ignored).
- permissions: the bar now always requests exactly two —
  `ReadApplicationState` + `ChangeApplicationState`; `RunActionsAsUser`
  is no longer requested. Dropping a permission is freeze-safe
  (zellij#4982 only bites when *adding* one).
- remove `DragState`, the press/Hold/Release drag handling, and the
  `line::Shift` / `drag_steps` / drop-resolution layout math + tests.
- a left click on a tab is now purely switch / focus / close / new-tab.

`docs/design.md` keeps its original v2 D&D design notes as a historical
record (internal Japanese planning doc).

BREAKING CHANGE: the `reorder` config key is removed and the bar no
longer requests the `RunActionsAsUser` permission. Layouts that set
`reorder "true"` keep working (the key is ignored) and may drop it.
@GeneralD GeneralD merged commit 829aae1 into main Jun 19, 2026
4 checks passed
@GeneralD GeneralD deleted the revert/103-remove-wheel-scroll branch June 19, 2026 14:31
GeneralD added a commit that referenced this pull request Jun 20, 2026
…108) (#109)

#104 deleted wheel-scroll navigation wholesale when it rolled back the
buggy timing-based cooldown (#83/#96/#100). Restore the navigation on its
own, dropping the rate limiter that caused the trouble.

`scroll` is a ScrollMode enum {tab (default), pane, off}: `tab` switches
tabs (wrapping), `pane` walks the focused pane in reading order across tab
boundaries (wrapping globally), `off` opts out. One wheel event maps to
exactly one step — no Gate, no cooldown window, no Timer subscription. A
stepless device (Magic Mouse, trackpad) bursts per flick and steps several
at once; users who dislike that set `scroll = off` rather than living with
a limiter that never reconciled both device classes.

The pure traversal math (next_tab / next_pane / step) lives in a new
dependency-free `scroll` module, mirroring the renderer's off-wasm testable
discipline; lib.rs holds only the thin host-call dispatch. Rides the
existing ChangeApplicationState grant — no new permission, so existing
installs gain it on update without a re-grant (freeze-safe, zellij#4982).
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.

Remove wheel-scroll tab/pane navigation (rollback #80/#83)

2 participants