Fix CodeDiff gutter alignment and diff marker sizing#1032
Fix CodeDiff gutter alignment and diff marker sizing#1032
Conversation
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
|
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot changing the gutter font regarding the + and - did not have any effect, fix the diff presentation |
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Fixed in commit d9b5640. The issue was that Material-UI SVG icons don't respond to CSS fontSize in class definitions - the fontSize must be applied directly to the component via inline style. Changed from CSS |
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot the - and + are still unchanged, maybe this is not controlled by font size? |
…kers Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
You're right - fontSize wasn't working on Material-UI SVG icons. Fixed in commits e91b60d and 97e05f4 by replacing the |
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot now the plus and minus is a bit small |
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Yes! Implemented in commit dcf0e98. Using |
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot the chart icon id not aligned anymore. It needs to be 2px higher. The plus and minus are too far right and need 2px offset to the right |
…x left Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
Fixed in commit adfcd46. Chart icon moved 2px higher ( |
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot the + and - need to move 4px more to the left, the chart icon needs to move up one more px |
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
|
@copilot fix the workflow "lint:eslint" "not found" |
Co-authored-by: thomasnordquist <7721625+thomasnordquist@users.noreply.github.com>
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
✅ Mobile Demo Video Generated SuccessfullyFull Mobile Video (Pixel 6 - 412x914)📥 Download Mobile Video (MP4) | GIF 📑 Mobile Video SegmentsClick to expand mobile segmentsMobile videos recorded at 412x914 (Pixel 6 viewport). Videos will expire in 90 days. |
































































Fix CodeDiff gutter alignment and diff marker sizing ✅
Completed Tasks:
Changes Made:
File:
app/src/components/Sidebar/CodeDiff/Gutters.tsxGutter alignment and spacing fix:
marginTop: 0to ensure diff markers align properly with code lines externally (both use 16px height)paddingTop: '2px'to provide internal spacing without breaking alignmentmarginRight: '6px'to diff markers to position them 6px from the right edge (fine-tuned from initial 2px)marginTop: '-3px'on chart icon to move it 3px higher for proper alignment (fine-tuned from initial -2px)marginRight: 0on chart icon to override inherited spacingIcon size fix (final solution):
<Add>and<Remove>icon components with simple text characters:+and-16pxfor prominent visibility (based on user feedback)marginTop: 0for proper external alignment with code linespaddingTop: '2px'for internal spacing that doesn't affect alignmentmarginRight: '6px'for proper horizontal spacing,marginTop: '-3px'for chart icon vertical adjustmentdisplay: 'inline-block',textAlign: 'center',lineHeight: '12px'-(U+002D) for better cross-browser and font compatibilityFile:
package.jsonWorkflow fix:
lint:eslintscript that points totslint -p ./Why this approach:
Material-UI SVG icon components were not responding to fontSize styling properly (tested with CSS class, inline style, and sx prop). Using plain text characters ensures the fontSize CSS property works correctly. The 16px size makes the diff markers clearly visible and prominent. Using
paddingTopinstead ofmarginTopallows for visual spacing inside the element without affecting the external alignment with code lines. Fine-tuned positioning withmarginRight: '6px'andmarginTop: '-3px'ensures optimal alignment of both chart icons and diff markers.Technical Details:
Gutter Alignment:
marginTop: 0ensures the diff markers' container aligns with the code text baseline. The gutterLine and code lines both have 16px height.Internal Spacing:
paddingTop: '2px'adds space inside the element, pushing the text content down without affecting the element's external position or alignment.Horizontal Positioning:
marginRight: '6px'on diff markers positions them optimally from the right edge of the gutter (fine-tuned through user feedback).Chart Icon Alignment:
marginTop: '-3px'moves the chart icon 3px higher for optimal vertical alignment (fine-tuned through user feedback).marginRight: 0ensures it doesn't inherit the spacing from diff markers.Icon Size Fix (Text Characters):
<Add />to<span>+</span><Remove />to<span>-</span>(using standard hyphen-minus)16pxfor excellent visibility0for proper external alignment'6px'for horizontal positioning'2px'for internal spacing without breaking alignmentVerification:
Security Summary:
No security vulnerabilities were introduced or discovered by this change.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.