Skip to content

feat(tabs): transfer folders onto existing tabs - #2092

Merged
l0gicgate merged 3 commits into
mainfrom
feat/2090-cross-tab-folder-transfers
Nov 8, 2026
Merged

l0gicgate merged 3 commits into
mainfrom
feat/2090-cross-tab-folder-transfers

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Make files and folders behave consistently when dragged between tabs. Existing tab headers reuse the shared transfer and hover handlers; + and unused tab-bar space still open folders in new tabs. Extend existing QA scenarios instead of duplicating file/folder implementations.

Known limitations: the shared X11 Escape-after-hover issue remains tracked in #2091. An exploratory List multi-folder Ctrl-drag copied only one selected folder; its source-grouping cause remains unisolated (details in #2090). Neither is claimed fixed by this routing change.

Owner-approved exception: skip the unavailable CodeScene check for this push/PR (no token). Code health remains unverified; required CI is not waived.

Visual evidence

cross-tab-drag-and-drop-2090-20261108T082709Z.mp4

How to test

  1. Open two tabs on different temporary directories. Put a file and a nonempty folder in the source.
  2. Drag each onto the existing destination tab. Undo, then repeat holding Ctrl to copy.
  3. Hold a folder drag over the other tab until it activates, then drop into a subfolder.
  4. Drop a folder onto + or unused tab-bar space.

Expected result: Existing tabs transfer files and folders using the same move/copy and undo behavior. Hover activates the destination without creating another tab. + and unused space open the folder in a new tab without transferring its contents.

Related issue

Closes #2090

Reuse the shared file-drop handler for folder transfers and hover activation. Restrict folder-open intents to plus and unused tab-bar targets, preserving sidebar opening and tab reordering.

Extend existing QA scenarios with file/folder variants and move undo coverage. Track the separate X11 hover-cancellation issue in #2091.

Refs #2090
Tab headers' sidebar-location offer filter could never decide anything:
sidebar drags are in-process String drags that the shared offer check
already rejects, and the strip overlay claims them first. Remove it with
the now-unused FileDropState::filter_offers hook. The append check in
intent() was likewise unreachable because connect_accept already refuses
folder drags on non-appending targets.

Refs #2090
@l0gicgate

Copy link
Copy Markdown
Contributor

Review and cleanup

Merged main at afa70b348 (a3a4e6b3a), no conflicts.

Review against the description and #2090. Confirmed: folders dropped on an existing tab header now go through the shared file-drop pipeline (move, Ctrl-copy, conflicts, undo), folder drags hover-activate tabs, and + / unused tab-bar space still open folders as new tabs. Sidebar-location opening and tab reordering keep their overlay route (the overlay's capture target rejects only folder drags). No earlier reviews or comments to reconcile. The skipped CodeScene check now passes locally: drop.rs 8.88 → 9.46, strip.rs 7.31 → 7.33, clipboard.rs unchanged at 7.18.

Fixes pushed

  • faefd0d5a refactor(tabs): drop unreachable folder and sidebar drop filters. The new pinned_drop::dragged_location offer filter on tab headers never ran: sidebar drags are in-process String drags, so content_drop::accepts_offer already rejects them, and the strip overlay claims them first anyway. Removing it left FileDropState::filter_offers with no callers, so that hook is gone too. The append gate added to intent() was unreachable because connect_accept already refuses folder drags on non-append targets. folder_locations is now private.

Tests. No tests removed. The scenario changes extend existing coverage with file/folder variants and undo checks instead of adding new scenarios. The text checks are not redundant with unchanged (which compares names and sizes only).

Validation

  • ./scripts/test-headless.py ui::window::composition::tabs::tests: 34 passed
  • ./scripts/test-headless.py ui::browser::clipboard::tests: 38 passed
  • ./scripts/test-headless.py ui::browser::content_drop: 2 passed
  • ./scripts/qa.sh --test-threads 6 drop-on-tab-moves-files ctrl-drop-on-tab-copies hovered-tab-takes-drop view-folders-open-new-tabs sidebar-locations-open-new-tabs tab-drag-reorders-numbers foreign-content-reaches-every-drop-target/columns-tab drop-folder-into-itself escape-cancels-file-drag: 31/31 passed (PR CI does not run QA scenarios)
  • ./scripts/quality.sh fmt, ./scripts/quality.sh clippy: clean

Follow-ups outside this PR

  • With enough tabs to overflow the strip, the unused space collapses and + scrolls out of view, so a folder drag has no visible "open as new tab" target. Every visible spot is a header that now transfers.
  • Folder drags now hover-switch tabs, so the X11 Escape-after-hover bug (fix(drag): cancel transfers after hovering into another tab #2091) can now move a whole folder tree, not just files.
  • The author commit 4b285c7a5 is unsigned; it was left as is to avoid a force-push.

CI: all checks green on faefd0d5a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tabs): transfer folders dropped on existing tabs

2 participants