Skip to content

Keep ungrouped tabs out of the sort; place groups by explicit index - #107

Open
infixlabs wants to merge 1 commit into
nitzanpap:masterfrom
infixlabs:sort-groups-front
Open

infixlabs wants to merge 1 commit into
nitzanpap:masterfrom
infixlabs:sort-groups-front

Conversation

@infixlabs

Copy link
Copy Markdown

Problem

With "Keep groups sorted alphabetically" on, sortGroups ends by calling tabs.move(id, { index: -1 }) on every ungrouped tab. In Firefox, a tab moved to the end of the strip is absorbed into the group that sits last there. Result: single-site tabs that never reached the minimum join an unrelated group (for example, the alphabetically last one). Each close also re-moves every ungrouped tab, which reshuffles them.

Change

  • Remove moveUngroupedTabsToEnd and its call. Ungrouped tabs are never passed to tabs.move.
  • Move groups with an explicit target index: each group goes after the tabs of every group placed before it (pinnedCount + cumulative sizes). A plain index: pinnedCount + i would land inside an earlier multi-tab group and split it in Firefox.
  • Groups now sit at the left of the strip in alphabetical order; ungrouped tabs keep their relative order after them.
  • Tests: ungrouped tabs are never moved; multi-tab group indexes; pinned tabs offset.

Testing

  • vitest run: 965 passed on this branch (based on current master).
  • tsc --noEmit and biome check on the changed files: clean.
  • Manual: Firefox Developer Edition, auto-grouping on and off, groups of 2–4 tabs plus singles, sort on. Groups stayed intact and singles stayed ungrouped in their original order.

Open question for maintainers: the sort now puts groups on the left instead of the right. Happy to flip the direction if that's a problem.

🤖 Generated with Claude Code

Moving an ungrouped tab to index -1 put it at the strip's end, where Firefox
joined it into whichever group sat last. The sort now moves only groups, to
explicit indexes: each group goes after the tabs of the groups placed before
it, so no group is split. Ungrouped tabs are never passed to tabs.move.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Et6Fr6EXRmrdavvvh8wgC
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@infixlabs is attempting to deploy a commit to the nitzanpap's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant