Skip to content

Remove drag-to-reorder (rollback #10/#23)#105

Merged
GeneralD merged 1 commit into
revert/103-remove-wheel-scrollfrom
revert/102-remove-inert-reorder
Jun 19, 2026
Merged

Remove drag-to-reorder (rollback #10/#23)#105
GeneralD merged 1 commit into
revert/103-remove-wheel-scrollfrom
revert/102-remove-inert-reorder

Conversation

@GeneralD

Copy link
Copy Markdown
Owner

type breaking scope diff files tests review stacked on

Closes #102.

Stacked on #104 (revert/103-remove-wheel-scroll) to avoid conflicts in the shared files (config.rs, lib.rs, line.rs, README). Merge #104 first; GitHub then auto-retargets this PR to main. The diff below is reorder-only.

Why

Drag-to-reorder (#10, opt-in since #23) never worked in normal use: zellij does not deliver the tab-drag Hold/Release mouse events to a non-selectable default_tab_template bar, 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 RunActionsAsUser permission, and an opt-in flag for something that can't fire. Removing it is cleaner than gating inert code.

What changed

  • config — drop the reorder key. Parsing is total (get(key).and_then(parse).unwrap_or(DEFAULT)), so existing layouts keep loading; a leftover reorder "true" 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 freezes the bar when adding a permission not in the cached grant, never when removing one.
  • drag mechanics removedDragState, the press/Hold/Release handling, and the line::Shift / drag_steps / drop-resolution layout math (plus their unit tests).
  • left click on a tab is now purely switch / focus-pane (mouse: click a minimap pane to focus it (position -> pane hit-test) #74) / close (mouse: an 'x' close button on each tab block (click hit-test) #86) / new-tab (mouse: a '+' button at the end of the tab strip to open a new tab #76) — the press no longer arms a drag.
  • docs — README config example + the "Enabling reorder" permission note, and the cliff.toml release-notes permission hint, are removed.

docs/design.md keeps 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/Hold mechanism (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 reorder config key is removed and the bar no longer requests RunActionsAsUser. Layouts that set reorder "true" keep working (the key is ignored) and can drop it.

Verification

  • cargo build --target wasm32-wasip1 — clean
  • CARGO_BUILD_TARGET=aarch64-apple-darwin cargo test --lib242 passed
  • cargo clippy --target wasm32-wasip1 --all-features --lib (CI's command) — clean
  • cargo fmt --check — clean

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.
Copilot AI review requested due to automatic review settings June 19, 2026 13:19
@GeneralD GeneralD self-assigned this Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c6c9ebb9-1092-4277-bd0e-8b42ca4c896e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/102-remove-inert-reorder

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 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 reorder configuration 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.

@GeneralD GeneralD merged commit 8c216fd into revert/103-remove-wheel-scroll Jun 19, 2026
7 checks passed
@GeneralD GeneralD deleted the revert/102-remove-inert-reorder branch June 19, 2026 14:31
GeneralD added a commit that referenced this pull request Jun 19, 2026
* 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.
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.

2 participants