Skip to content

Inject tab drag capability registries - #209

Merged
austinywang merged 2 commits into
mainfrom
issue-9521-injected-tab-drag-registry
Aug 9, 2026
Merged

austinywang merged 2 commits into
mainfrom
issue-9521-injected-tab-drag-registry

Conversation

@austinywang

@austinywang austinywang commented Aug 9, 2026 •

Copy link
Copy Markdown

Summary

  • remove the hidden process-wide TabDragTransferRegistry singleton
  • make default controllers own isolated registries
  • expose explicit registry injection for hosts that exchange tabs across controllers

Testing

  • commit d48c582 adds the regression test first and demonstrates that default controllers incorrectly shared process state
  • commit a4f2d28 makes the capability tests pass with explicit sharing and default isolation

Parent fix: manaflow-ai/cmux#9787
Issue: manaflow-ai/cmux#9521


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Removes the hidden process-wide tab drag registry and isolates controllers by default. Adds an initializer to share a registry when controllers need to exchange tabs (fixes manaflow-ai/cmux#9521).

  • Refactors

    • Removed TabDragTransferRegistry.process.
    • SplitViewController now creates a fresh TabDragTransferRegistry by default.
    • Added BonsplitController(configuration:tabDragTransferRegistry:) for explicit registry sharing.
  • Migration

    • For cross-controller tab exchange, create one TabDragTransferRegistry() and pass it to each controller via BonsplitController(configuration:tabDragTransferRegistry:).
    • Keep using BonsplitController(configuration:) for isolated controllers.
    • Replace any .process references with an explicit TabDragTransferRegistry() instance.

Written for commit a4f2d28. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Controllers can now explicitly share a tab-drag transfer registry for coordinated drag-and-drop across controllers.
    • Default controllers use isolated tab-drag capabilities automatically.
    • Registry instances remain publicly constructible for customized sharing.
  • Bug Fixes

    • Prevented unintended process-wide sharing of tab-drag transfer capabilities.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 05077a18-329a-4c19-bef1-b1315307bcd9

📥 Commits

Reviewing files that changed from the base of the PR and between 882bd69 and a4f2d28.

📒 Files selected for processing (4)
  • Sources/Bonsplit/Internal/Controllers/SplitViewController.swift
  • Sources/Bonsplit/Public/BonsplitController.swift
  • Sources/Bonsplit/Public/TabDragTransferRegistry.swift
  • Tests/BonsplitTests/TabDragTransferRegistryTests.swift
💤 Files with no reviewable changes (1)
  • Sources/Bonsplit/Public/TabDragTransferRegistry.swift

📝 Walkthrough

Walkthrough

The change removes the process-wide tab-drag registry. BonsplitController now exposes explicit registry injection, while default controllers create isolated registries. Tests cover shared cross-controller routing and registry isolation.

Changes

Tab-drag registry ownership

Layer / File(s) Summary
Registry API and controller wiring
Sources/Bonsplit/Public/TabDragTransferRegistry.swift, Sources/Bonsplit/Public/BonsplitController.swift, Sources/Bonsplit/Internal/Controllers/SplitViewController.swift
Removes TabDragTransferRegistry.process. Makes registry injection public and explicit. Default controllers create new registry instances.
Registry ownership tests
Tests/BonsplitTests/TabDragTransferRegistryTests.swift
Updates cross-controller drag coverage to inject one shared registry. Adds coverage confirming default controllers use distinct registries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: lawrencecchen

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: explicit injection of tab drag capability registries.
Linked Issues check ✅ Passed The changes implement isolated default registries and explicit shared registry injection, satisfying the linked issue’s tab-drag state requirement [#9787].
Out of Scope Changes check ✅ Passed The changes are limited to registry ownership, dependency injection, singleton removal, and related regression tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-9521-injected-tab-drag-registry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinywang
austinywang merged commit ae3b4ba into main Aug 9, 2026
6 checks passed
@austinywang
austinywang deleted the issue-9521-injected-tab-drag-registry branch August 9, 2026 00:38
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.

Clicks stop registering until app restart: three sticky drag-state latches, none with a ground-truth clear

1 participant