Skip to content

fix(inspector): prevent window overflow on inspector pane toggle#1463

Open
J2TeamNNL wants to merge 8 commits into
TableProApp:mainfrom
J2TeamNNL:fix/inspector
Open

fix(inspector): prevent window overflow on inspector pane toggle#1463
J2TeamNNL wants to merge 8 commits into
TableProApp:mainfrom
J2TeamNNL:fix/inspector

Conversation

@J2TeamNNL
Copy link
Copy Markdown
Contributor

Summary

  • Inspector pane toggle no longer causes content overflow in narrow windows
  • recomputeWindowMinimumSize now runs in splitViewDidResizeSubviews so manual divider drags also update the floor
  • Base content min size is re-derived on every call instead of being captured once at startup
  • hideInspector pre-narrows the window minimum before animation starts, matching the pre-widening pattern in showInspector
  • Added test covering the case where detail + inspector sum exceeds the 720pt base floor

Test plan

  • Open connection, resize window to ~720pt, toggle inspector on → window grows to fit, no overflow
  • Toggle inspector off → window shrinks minimum, content intact
  • Drag divider narrow, toggle inspector → window auto-expands
  • Rapid toggle (on/off/on) → minimum size stays correct throughout
  • MainSplitViewControllerWindowMinimumSizeTests all pass

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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