Remove drag-to-reorder (rollback #10/#23)#105
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR rolls back the drag-to-reorder feature by removing the reorder config/permission surface area and deleting the associated drag state + layout math. It aligns the implementation with the confirmed host limitation (no Hold/Release delivery to this non-selectable bar), leaving left-click behavior as switch/focus/close/new-tab only.
Changes:
- Removed drag-to-reorder layout math (
Shift,drag_steps, drop clamping) and its unit tests. - Removed drag state machine (
DragState, Hold/Release handling, reorder planning/emission) and simplified permissions to a fixed two-permission set. - Removed
reorderconfiguration key and updated docs/release-notes hints accordingly.
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/line.rs | Deletes drag-to-reorder hit-test/drop-resolution helpers and related tests; updates docs to reflect click-only usage. |
| src/lib.rs | Removes drag state + Hold/Release handling; makes permissions fixed (Read + Change only); updates tests accordingly. |
| src/config.rs | Drops the reorder config field/default/parsing/tests so the key becomes ignored. |
| README.md | Removes reorder from the config example and deletes the “Enabling reorder” permission note. |
| cliff.toml | Removes the release-notes hint about adding RunActionsAsUser when reorder is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* feat!: remove wheel-scroll tab/pane navigation (#103) 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. * feat!: remove drag-to-reorder (#102) (#105) 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.
Closes #102.
Why
Drag-to-reorder (#10, opt-in since #23) never worked in normal use: zellij does not deliver the tab-drag
Hold/Releasemouse events to a non-selectabledefault_tab_templatebar, so the gesture was inert — root cause confirmed in #102. This is the same dead-end that sank wheel-scroll (#103): a mouse gesture aimed at a pinned, non-focusable bar that the host never routes there.Keeping the feature meant carrying dead code, a dormant
RunActionsAsUserpermission, and an opt-in flag for something that can't fire. Removing it is cleaner than gating inert code.What changed
reorderkey. Parsing is total (get(key).and_then(parse).unwrap_or(DEFAULT)), so existing layouts keep loading; a leftoverreorder "true"is simply ignored.ReadApplicationState+ChangeApplicationState.RunActionsAsUseris no longer requested. Dropping a permission is freeze-safe — zellij#4982 only freezes the bar when adding a permission not in the cached grant, never when removing one.DragState, the press/Hold/Releasehandling, and theline::Shift/drag_steps/ drop-resolution layout math (plus their unit tests).docs/design.mdkeeps its original v2 D&D design notes as a historical record (internal Japanese planning doc — out of scope to rewrite here).Note
#93 (pane drag-to-move) was planned to reuse this same
DragState/Holdmechanism (per #102). That mechanism is now gone; #93 would need a fresh approach if ever revisited — but it hits the identical host limitation, so it is unlikely to be viable as a bar gesture.Breaking change
The
reorderconfig key is removed and the bar no longer requestsRunActionsAsUser. Layouts that setreorder "true"keep working (the key is ignored) and can drop it.Verification
cargo build --target wasm32-wasip1— cleanCARGO_BUILD_TARGET=aarch64-apple-darwin cargo test --lib— 242 passedcargo clippy --target wasm32-wasip1 --all-features --lib(CI's command) — cleancargo fmt --check— clean