Skip to content

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

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

fix(inspector): prevent window overflow on inspector pane toggle#1463
J2TeamNNL wants to merge 13 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 👍 / 👎.

@datlechin datlechin force-pushed the fix/inspector branch 2 times, most recently from dacabe2 to 07370b7 Compare June 4, 2026 17:47
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: 07370b753b

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

func showInspector() {
materializeInspectorIfNeeded()
inspectorSplitItem?.animator().isCollapsed = false
setCollapsed(false, for: inspectorSplitItem)
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 Keep the window minimum in sync when expanding panes

When the sidebar is visible, opening the inspector requires about 280 + 400 + 270 points plus dividers, but TabWindowController still leaves the window minSize at 720×480. collapseBehavior can grow the window for this uncollapse, but it does not raise the window's minimum size, so users can immediately drag the same window back down to 720pt with both panes visible and reproduce the squeezed/overflowing split view this change is meant to prevent. Please keep a dynamic content minimum while the extra panes are visible, without deriving it from the already-mutated minimum.

Useful? React with 👍 / 👎.

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: 5aa43889a5

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

inspectorSplitItem.canCollapse = true
inspectorSplitItem.minimumThickness = 270
inspectorSplitItem.maximumThickness = 400
inspectorSplitItem.collapseBehavior = .preferResizingSplitViewWithFixedSiblings
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 Resize when restoring an already-visible inspector

This only helps when AppKit performs an uncollapse transition; it does not cover the startup path where inspectorPresented is restored and viewDidLoad sets inspectorSplitItem.isCollapsed = false before the window is visible. I checked TabWindowController: it restores and saves MainEditorWindow frames, so a previously saved narrow frame can reopen with the inspector already visible and no collapse animation to trigger this behavior, leaving the same squeezed/overflowing panes until the user toggles the inspector again. Please also handle the initially visible inspector after the window/frame is restored.

Useful? React with 👍 / 👎.

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: 96dfe45b5d

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +137
if let remainingStdout = try? stdoutPipe.fileHandleForReading.readToEnd(), !remainingStdout.isEmpty {
stdoutCollector.append(remainingStdout)
}
if let remainingStderr = try? stderrPipe.fileHandleForReading.readToEnd(), !remainingStderr.isEmpty {
stderrCollector.append(remainingStderr)
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 Avoid blocking indefinitely when draining inherited pipes

If a password command exits after starting a background process that inherits stdout or stderr (for example a shell helper that daemonizes), process.waitUntilExit() returns and the timeout task is canceled, but these readToEnd() calls still wait for EOF on the inherited pipe. That can hang password resolution well past the 30-second timeout even though the command process has already exited; the final drain needs to be non-blocking or still covered by a timeout/closed descriptors.

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.

2 participants