Repository navigation
fix(sidebar): make tab dragging smooth and reliable - #257
Open
barto95100 wants to merge 2 commits into
Open
barto95100 wants to merge 2 commits into
barto95100 wants to merge 2 commits into
Conversation
Fixes the-ora#174. - Drop delegates use the dragged tab id right away instead of reading it back asynchronously from the drag item on every hover (lag, moves applied out of order). - Moving a tab renumbers only its section (favorites, pinned or normal), like a list: dragged down it lands after the target, up before it, from another section in its place. The old reorder swapped orders across all sections and could index out of bounds or leave duplicate orders. - The window drag gesture now sits behind the tabs: on top of them it competed with tab drags, which got cancelled or stuck to the mouse, and it was never re-enabled after a first tab drag. - Each drag has its own session: the drag item of a previous drag, released late, no longer ends the current one. - Duplicated tabs land right after the original. - Tests: TabReorderingTests.
[Medium impact] The changes stay within sidebar tab organization and window-drag interactions. The PR appears safe to merge with two non-blocking tab-placement issues. FindingsSummaryThis PR makes tab moves synchronous and limits renumbering to the destination section.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Start tab drag] --> B[Store tab ID and drag session]
B --> C{Hover target}
C -->|Existing tab| D[Move tab and renumber destination section]
C -->|Empty section| E[Change section and set order to 1]
D --> F[Drop saves changes]
E --> F
B --> G[Provider released]
G --> H{Session still current?}
H -->|Yes| I[Clear drag state]
H -->|No| J[Leave current drag alone]
Reviews (1) · Last reviewed commit: "fix(sidebar): make tab dragging smooth a..." · Reviewed by Greptile |
…ayed order when moving - A duplicated tab is placed right after its original, in its section (pinned and favorite ones included): its order, count + 1, could be below the original's, so moving it onto the original put it before. - Moves start from the section in the order the sidebar shows it, the moved tab included: with tabs sharing an order, a move down by one place could leave the list unchanged. Each move renumbers the section. - Tests for inserting after the original.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #174.
Type of Change
Testing
TabReorderingTests(pure reordering rules).AI Assistance Disclosure
Code written with Claude (AI) under my direction; I reviewed and tested every change on macOS.
Checklist