Improve tab drag interaction with groups
The attached bug contains details on where the previous logic in GetTabGroupForTargetIndex was causing different behavior based on group size. This CL updates the logic to focus more on current position than previous group membership. As noted in the inline comments: (If the tab is between two tabs with the same group membership, match that group.) // If the tabs on the left and right have different group memberships, // including if one is ungrouped or nonexistent, change the group of the // dragged tab based on whether it is "leaning" toward the left or the // right of the gap. If the tab is centered in the gap, make the tab // ungrouped. ("Leaning" is defined by being 1/4 the tab width toward either side of the gap.) // Extra polish: Prefer staying in an existing group, if any. This prevents // tabs at the edge of the group from flickering between grouped and // ungrouped. It also gives groups a slightly "sticky" feel while dragging. (There is also some special handling for the far left and far right of the tab strip.) A screencast of this interaction is attached to the bug. Bug: 1004946 Change-Id: Id3cf631354a47ffa5c3f1aeacdc82bd2af13ea24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823729 Commit-Queue: Connie Wan <connily@chromium.org> Reviewed-by:Charlene Yan <cyan@chromium.org> Reviewed-by:
Bret Sepulveda <bsep@chromium.org> Cr-Commit-Position: refs/heads/master@{#700449}
Showing
Please register or sign in to comment