Skip to content

Keep split views together when tabs move to another profile - #17

Merged
afrojun merged 1 commit into
mainfrom
feature/split-moves
Nov 5, 2026
Merged

afrojun merged 1 commit into
mainfrom
feature/split-moves

Conversation

@afrojun

@afrojun afrojun commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

sequenceDiagram
    participant S as Source extension
    participant H as ProfileBar helper
    participant D as Destination extension
    S->>H: openURLs / openGroup { urls, splits: [[1, 2]] }
    H->>H: TabSplits.parse (neighbouring pairs, in range, each tab once)
    H->>D: relay "open" or claimGroup { urls, splits }
    D->>D: create tabs, then TabSplits.rebuild → chrome.tabs.createSplit
Loading
  • Moving either half of a split view from the tab strip moves both. Right-clicking a page inside one half still moves only that page.
  • Group moves carry the splits inside the group, and the receiver splits after grouping, because Chrome splits only within one group.
  • extension/tab-splits.js holds both ends of the extension's side and is shared by the service worker and the group receiver.
  • Page tests now load each page's scripts in the order its HTML lists them, so a missing script fails the test.

Both ends of the protocol change in this PR, as AGENTS.md requires. Older versions on either side ignore splits and still move the tabs, without the split. Stacked on #16.

Evidence

  • Before: split halves moved as separate tabs, and the destination never split them.
    After: 75 extension tests and ./test.sh pass. Breaking each part (source pairs, partner expansion, arrival rebuild, group rebuild) in a scratch copy fails a test.
  • Live, Chrome 156, Profile 3 → Profile 2 through the real menu code (moveToProfile):
    • One half of a split: both halves left the source and arrived split at neighbouring indexes.
    • A group of three with a split inside: it arrived with its title and colour, and the split was rebuilt inside the group.
  • Pre-push review finding: [[Int.max, 0]] overflowed before the range check and would crash the helper. Fixed by checking the range first, with Int.max and -1 regression cases.

Merge Danger

Door: two-way

Blast Radius: native protocol

Release ProfileBar 1.6.0 before the extension update that sends splits. In the other order nothing breaks, but splits aren't rebuilt until the app catches up.

🤖 Generated with Claude Code

Moving either half of a split view from the tab strip now moves both, and a
group move carries the splits inside it. The move sends ProfileBar the split
views as pairs of neighbouring positions in its URL list. ProfileBar checks
them and passes them on through the profile relay and the group handoff, and
the destination's copy of the extension splits those tabs again with
chrome.tabs.createSplit (Chrome 155 and later).

Older versions of either end ignore the new field and still move the tabs,
without the split. tab-splits.js holds both ends of the extension's side, and
the page tests now load each page's scripts in the order its HTML lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@afrojun
afrojun changed the base branch from feature/action-menu to main November 5, 2026 02:45
@afrojun
afrojun force-pushed the feature/split-moves branch from 9c3fe90 to b30c436 Compare November 5, 2026 02:45
@afrojun
afrojun merged commit 315689d into main Nov 5, 2026
2 checks passed
@afrojun
afrojun deleted the feature/split-moves branch November 5, 2026 02:49
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