-
Notifications
You must be signed in to change notification settings - Fork 79
More markdowntextblock improvements #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 improves the MarkdownTextBlock image handling by replacing fixed Width/Height sizing with a MaxWidth/MaxHeight constraint-based approach, preventing images from being stretched beyond their parent container. It also includes XAML formatting improvements for the theme options pane and updates to sample documentation.
- Changed image sizing from fixed dimensions to flexible MaxWidth/MaxHeight constraints to prevent stretching
- Simplified constraint application logic by directly using MaxWidth/MaxHeight instead of complex scaling calculations
- Reformatted XAML file with consistent indentation and attribute placement
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| MyImage.cs | Refactored image sizing logic to use MaxWidth/MaxHeight constraints instead of fixed dimensions, allowing images to scale properly within their containers |
| ThemeOptionsPane.xaml | Applied consistent code formatting with proper indentation and line breaks |
| MarkdownTextBlockCustomThemeSample.xaml.cs | Added documentation about image corner radius feature and included additional sample image |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/samples/MarkdownTextBlockCustomThemeSample.xaml.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Tests that theme constraints should not enlarge images smaller than the constraint - Tests that precedent dimensions from markdown syntax should be respected - Tests that theme constraints properly limit larger images - Reveals current bugs where constraints are always applied regardless of context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surfaced a few regressions:
- This should be fixed in this PR before closing. Failing tests have been pushed to demonstrate the issue.
- The missing image corner radius bit should be handled in a new PR.
The remaining review comments from Copilot are either trivial and already merged or false positives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
components/MarkdownTextBlock/samples/MarkdownTextBlockImageProviderSample.xaml.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/tests/ImageProviderConstraintTest.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/samples/MarkdownTextBlockImageProviderSample.xaml.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/samples/MarkdownTextBlockImageProviderSample.xaml.cs
Outdated
Show resolved
Hide resolved
components/MarkdownTextBlock/samples/MarkdownTextBlockImageProviderSample.xaml.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…unityToolkit/Labs-Windows into niels9001/mdtb-improvements
Uh oh!
There was an error while loading. Please reload this page.