Skip to content

Conversation

zhongjiahao-M
Copy link

  • Add contentView initialization and container constraints for macOS
  • Fix layout issues with the dev loading view on macOS platform
  • Ensure proper positioning and sizing of the loading message window

Fixes #2706

Summary:

Test Plan:

…g view

- Add contentView initialization and container constraints for macOS
- Fix layout issues with the dev loading view on macOS platform
- Ensure proper positioning and sizing of the loading message window

Fixes microsoft#2706
@zhongjiahao-M zhongjiahao-M requested a review from a team as a code owner September 27, 2025 17:03
@zhongjiahao-M
Copy link
Author

@microsoft-github-policy-service agree [company="{didi}"]

@zhongjiahao-M
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@zhongjiahao-M
Copy link
Author

@microsoft-github-policy-service agree

@zhongjiahao-M
Copy link
Author

This is the effect after the repair.
ScreenRecording2025-09-28 01 09 02

@zhongjiahao-M
Copy link
Author

zhongjiahao-M commented Sep 27, 2025

This is the effect after the repair. ScreenRecording2025-09-28 01 09 02
The issues before the repair are shown in the following gif:
ScreenRecording

Comment on lines 178 to 179
self->_window.contentView = [[NSView alloc] init];
[self->_window.contentView addSubview:self->_container];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't this invalidate line 152? Should we doing it there instead?

Copy link
Author

Choose a reason for hiding this comment

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

I have completed the modifications according to your suggestions.

Comment on lines 181 to 192
[NSLayoutConstraint activateConstraints:@[
[self->_container.topAnchor constraintEqualToAnchor:self->_window.contentView.topAnchor],
[self->_container.leadingAnchor constraintEqualToAnchor:self->_window.contentView.leadingAnchor],
[self->_container.trailingAnchor constraintEqualToAnchor:self->_window.contentView.trailingAnchor],
[self->_container.bottomAnchor constraintEqualToAnchor:self->_window.contentView.bottomAnchor],

// Label constraints
[self->_label.centerXAnchor constraintEqualToAnchor:self->_container.centerXAnchor],
[self->_label.centerYAnchor constraintEqualToAnchor:self->_container.centerYAnchor],
[self->_label.leadingAnchor constraintGreaterThanOrEqualToAnchor:self->_container.leadingAnchor constant:10],
[self->_label.trailingAnchor constraintLessThanOrEqualToAnchor:self->_container.trailingAnchor constant:-10],
]];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any chance we can share a bunch of these constraints with the iOS block?

Copy link
Author

Choose a reason for hiding this comment

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

I have completed the modifications according to your suggestions.

- Replace contentViewController.view with contentView for proper view hierarchy
- Unify constraint logic across iOS and macOS platforms
- Use shared constraint array for better code organization
- Fix container constraints to properly fill parent view on macOS
- Maintain platform-specific label positioning (bottom on iOS, center on macOS)

Fixes issue microsoft#2706
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.

Describe the problem
2 participants