Skip to content

Fix issues with tab swapping and change distribution#1831

Merged
ianyh merged 18 commits intodevelopmentfrom
phantom-windows
Mar 1, 2026
Merged

Fix issues with tab swapping and change distribution#1831
ianyh merged 18 commits intodevelopmentfrom
phantom-windows

Conversation

@ianyh
Copy link
Copy Markdown
Owner

@ianyh ianyh commented Jan 1, 2026

  • Deliver change events to layouts on reflow to target correct layout
  • Observe window closes
  • Improve native tab handling
  • Make bsp state make sense

This fixes a variety of issues around state management. For one thing, window closes got lost at some point, and were not being delivered to stateful layouts (including custom ones). There was an additional issue around native tab swapping and what that actually means for layout state.

This closes many (but not all) issues with bsp.

Fixes #1614

This is a significant change, but a necessary one. In my refactoring I seem to have at some point dropped window close events in their entirety. Stateless layouts are unaffected because they don't rely on the events, but bsp (and by extension any stateful layout) was not getting them.
This avoids doing a ton of id cache regenerations for an app that potentially has many windows.
@ianyh
Copy link
Copy Markdown
Owner Author

ianyh commented Jan 2, 2026

Tab swapping stopped working after I upgraded from macOS 26.1 to macOS 26.2. 😓

@alfredomtx
Copy link
Copy Markdown

@ianyh is there anything I could do to help you solve this issue?
I'm using the Ghostty terminal, and this happens very often

@ianyh
Copy link
Copy Markdown
Owner Author

ianyh commented Feb 7, 2026

It's annoying because correctly swapping the tabs requires dropping events, but stateful layouts need all of them to stay consistent, so it has been a source of bsp bugs. So it's less about finding a solution, and more about finding time to implement it.

@alfredomtx
Copy link
Copy Markdown

alfredomtx commented Feb 10, 2026

I see, unfortunately I have zero knowledge of Swift to help you out with it.
I can spin up Claude Code and try to implement this and submit a new pull request based on your ongoing work(after I test and make sure the issue with Ghostty is resolved). But I feel bad about opening a PR with something 100% AI generated that I do not understand thorougly, if you don't mind to see the results, I can do that no problem

@ianyh ianyh marked this pull request as ready for review March 1, 2026 02:30
@ianyh
Copy link
Copy Markdown
Owner Author

ianyh commented Mar 1, 2026

Okay, let's give this a go. 😅

@ianyh ianyh merged commit 3299ceb into development Mar 1, 2026
1 check passed
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.

Adding a Finder tab switches window

2 participants