Skip to content

Fix matrix layout and export cropping#16

Merged
byemaxx merged 19 commits intomainfrom
staging
Jan 9, 2026
Merged

Fix matrix layout and export cropping#16
byemaxx merged 19 commits intomainfrom
staging

Conversation

@byemaxx
Copy link
Copy Markdown
Owner

@byemaxx byemaxx commented Jan 7, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a 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 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

Comment thread js/utils/export-tools.js Outdated
Comment thread js/utils/export-tools.js Outdated
Comment thread js/utils/export-tools.js Outdated
Comment thread js/renderers/comparison-renderer.js Outdated
Comment thread js/renderers/comparison-renderer.js Outdated
Comment thread js/renderers/comparison-renderer.js Outdated
Comment thread css/comparison.css Outdated
Copy link
Copy Markdown

Copilot AI commented Jan 7, 2026

@byemaxx I've opened a new pull request, #17, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Copilot AI commented Jan 7, 2026

@byemaxx I've opened a new pull request, #18, to work on those changes. Once the pull request is ready, I'll request review from you.

byemaxx and others added 3 commits January 6, 2026 19:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Jan 7, 2026

@byemaxx I've opened a new pull request, #19, to work on those changes. Once the pull request is ready, I'll request review from you.

byemaxx and others added 2 commits January 6, 2026 19:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Jan 7, 2026

@byemaxx I've opened a new pull request, #20, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 9 commits January 7, 2026 00:17
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
@byemaxx
Copy link
Copy Markdown
Owner Author

byemaxx commented Jan 7, 2026

@copilot review again

Copy link
Copy Markdown

Copilot AI commented Jan 7, 2026

@byemaxx I've opened a new pull request, #21, to work on those changes. Once the pull request is ready, I'll request review from you.

Code review: matrix layout and export cropping fixes
@byemaxx byemaxx merged commit b486656 into main Jan 9, 2026
@byemaxx byemaxx deleted the staging branch January 9, 2026 17:29
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.

3 participants