Skip to content

Mark layout dirty before layoutSubtreeIfNeeded#1604

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Jul 23, 2026
Merged

Mark layout dirty before layoutSubtreeIfNeeded#1604
cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures AppKit views are marked as needing layout before calling layoutSubtreeIfNeeded(), so that subsequent fittingSize/geometry reads reflect an up-to-date layout pass.

Changes:

  • Mark relaunchController.view as needsLayout before measuring fittingSize.height for the relaunch info bar.
  • Mark tableView as needsLayout before forcing layout during category scrolling to ensure accurate row geometry.
  • Mark a temporary NSHostingController’s view as needsLayout before measuring a SwiftUI View’s fittingSize in the text completion module.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
MarkEditMac/Sources/Extension/ExtensionsViewController.swift Ensures relaunch bar height measurement and scroll-to-row geometry are based on a freshly-dirtied layout pass.
MarkEditMac/Modules/Sources/TextCompletion/Extensions/View+Extension.swift Ensures SwiftUI view size measurement runs a layout pass by marking the hosting view dirty before measuring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cyanzhong
cyanzhong merged commit 48fe295 into main Jul 23, 2026
2 checks 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.

2 participants