Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes layout and export issues with the comparison matrix visualization. The changes address two main problems: (1) centering/overflow handling for the matrix layout, and (2) excessive empty margins when exporting matrix visualizations.
- Introduces a "shrink-to-content" export strategy to avoid capturing empty margins around centered content
- Implements adaptive alignment logic that switches the matrix between centered and left-aligned based on available space
- Refactors the matrix DOM structure to use a wrapper/container pattern for better layout control
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| js/utils/export-tools.js | Adds widthStrategy option to buildSnapshot() with "shrink-to-content" mode for matrix exports; updates buildVizContainerSnapshot() to detect matrix mode and export the matrix element directly |
| js/renderers/comparison-renderer.js | Introduces matrix wrapper element with ResizeObserver-based adaptive alignment logic; fixes indentation inconsistencies |
| css/comparison.css | Adds wrapper styles with breakout layout and flex-based centering; updates container to use fit-content width; minor formatting fixes |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: byemaxx <44231502+byemaxx@users.noreply.github.com>
Co-authored-by: byemaxx <44231502+byemaxx@users.noreply.github.com>
Co-authored-by: byemaxx <44231502+byemaxx@users.noreply.github.com>
Co-authored-by: byemaxx <44231502+byemaxx@users.noreply.github.com>
Extract magic number to named constant with documentation
Fix baseWidth fallback cascade in export width measurement
Fix ResizeObserver memory leak in matrix view
Eliminate duplicate condition check in buildSnapshot
Owner
Author
|
@copilot review again |
Code review: matrix layout and export cropping fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.