fix: correct split view tab bar positioning, redraw, and focus#94
fix: correct split view tab bar positioning, redraw, and focus#94hybridmachine wants to merge 2 commits intomacos-portfrom
Conversation
Four bugs fixed in split_view.mm: - Tab bar coordinates used splitView-local origin instead of contentView coordinates, misaligning tabs when panels are visible - doUnsplit() never forced Scintilla to redraw after reparenting editorContainer, leaving the editor blank - Redundant layoutSplitTopTabBars() call in doUnsplit() ran before relayoutPanels() with stale frame data - Missing ScintillaBridge_focus() after unsplit left the editor without keyboard focus Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes split/unsplit UI correctness on macOS by ensuring tab bars are positioned in the correct coordinate space, and by restoring editor rendering/focus when collapsing back to a single view.
Changes:
- Compute split tab bar X positions using
splitView’s offset withincontentViewto avoid misalignment when side panels are visible. - Force a Scintilla re-colourise after unsplit reparenting to ensure editor content redraws.
- Remove a pre-
relayoutPanels()tab layout call and restore focus to the remaining Scintilla view after unsplitting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
macos/platform/split_view.mm
Outdated
| bindDocumentMapToActiveView(); | ||
| updateDocumentMapViewport(); | ||
| bindFunctionListToActiveView(); | ||
| ScintillaBridge_focus(ctx().scintillaView); |
There was a problem hiding this comment.
doUnsplit() now always calls ScintillaBridge_focus(ctx().scintillaView) at the end. If the incremental search bar is visible, this will steal keyboard focus from the search field (showIncrementalSearch explicitly makes the search field first responder, and document switching keeps that focus). Consider only focusing Scintilla when incremental search is not visible, or explicitly restoring focus to the search field when isIncrementalSearchVisible() is true (or when the previous first responder was the closing right-hand Scintilla view).
| ScintillaBridge_focus(ctx().scintillaView); | |
| if (!isIncrementalSearchVisible()) | |
| ScintillaBridge_focus(ctx().scintillaView); |
Prevent ScintillaBridge_focus from stealing keyboard focus from the incremental search field during unsplit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
SCI_COLOURISEafter unsplit reparenting so the editor content is displayedlayoutSplitTopTabBars()call that ran beforerelayoutPanels()with stale frame dataScintillaBridge_focus()after unsplit to restore keyboard focus to the remaining editorTest plan
🤖 Generated with Claude Code