Skip to content

feat: restore wheel-scroll tab/pane navigation without rate limiting #108

Description

@GeneralD

type priority complexity estimate AI platform

Motivation

#104 rolled back wheel-scroll tab/pane navigation (#80/#83) entirely,
but the real defect was only the rate-limiting layer. zellij delivers
ScrollUp/ScrollDown with no device identity, so notched wheels and stepless
devices (trackpad, Magic Mouse) are indistinguishable at the event level, and
every rate-limiter attempt — leading-edge cooldown (#83), debounce-to-last-event
(#96), reopen-on-timer throttle (#100) — only traded one failure mode for
another.

The mistake in #104 was deleting the feature along with the buggy throttle.
The navigation itself worked; only the cooldown/debounce/timer machinery was
unreliable. The wheel over the bar is now inert (pre-#80).

Proposal

Restore wheel-scroll tab/pane navigation in its rate-limit-free form:

  • Re-add the ScrollUp/ScrollDown handlers as plain 1-event = 1-step
    navigation — no throttle, no debounce, no timer, no cooldown state.
  • Do not restore the src/scroll.rs rate-limiter, the scroll_cooldown_ms
    key, the EventType::Timer subscription, or the cooldown state.
  • Gate the feature behind a scroll config key (bool, default true
    opt-out). Config parsing stays total, so old layouts keep loading.
  • Restore the projection::pane_ids_in_reading_order helper needed for pane
    traversal.
  • No permission change (stays under ChangeApplicationState).

Known trade-off (accepted)

Without a rate limiter, a single trackpad / Magic Mouse flick emits a burst of
scroll events and will step through several tabs/panes at once. This is the
deliberate trade-off chosen here: the feature is opt-out via scroll = false
rather than absent. Notched-wheel users get usable navigation; stepless-device
users who dislike the multi-step jumps disable it.

Relevant Code (to restore, rate-limiter-free)

  • src/lib.rsScrollUp / ScrollDown arms in the Event::Mouse handler
    (now routed through src/router.rs after the #89 refactor)
  • src/config.rsscroll key (bool, default true); not scroll_cooldown_ms
  • src/projection.rspane_ids_in_reading_order
  • src/line.rs — scroll-target geometry as needed

Out of scope

  • The reorder feature, also removed in #104, is unrelated and stays removed
    in this change.

Refs: #77 (tracking), #80 #83 (original impl), #96 #100 (failed throttle attempts), #103 #104 (removal).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions