fix(inspector): prevent window overflow on inspector pane toggle#1463
fix(inspector): prevent window overflow on inspector pane toggle#1463J2TeamNNL wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9b71d17e7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ) { | ||
| guard let window = view.window else { return } | ||
|
|
||
| let baseWindowContentMinSize = window.contentRect(forFrameRect: NSRect(origin: .zero, size: window.minSize)).size |
There was a problem hiding this comment.
Preserve the original minimum when recomputing
Because this derives the base from window.minSize after previous calls may have assigned window.contentMinSize, the computed floor can only grow. For example, showing the inspector widens contentMinSize to the pane sum; when hideInspector() calls recomputeWindowMinimumSize(inspectorCollapsed: true), window.minSize already reflects that widened value, so the base remains the larger width and the window never relaxes back to the original 720pt minimum. This keeps narrow editor windows stuck oversized after toggling the inspector once; keep a separate baseline/default content minimum instead of using the current mutable minSize.
Useful? React with 👍 / 👎.
Summary
recomputeWindowMinimumSizenow runs insplitViewDidResizeSubviewsso manual divider drags also update the floorhideInspectorpre-narrows the window minimum before animation starts, matching the pre-widening pattern inshowInspectorTest plan
MainSplitViewControllerWindowMinimumSizeTestsall pass