-
Notifications
You must be signed in to change notification settings - Fork 670
Fix reviewer icons horizontal misalignment in pull request view #8013
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
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
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.
@copilot they're misalligned horizontally. There are several lines of reviewers. The icons on the first light are misaligned horizontally with the subsequent lines.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
@copilot they're misalligned horizontally. There are several lines of reviewers. The icons on the first light are misaligned horizontally with the subsequent lines.
Fixed in commit 2c5d21d. Added justify-content: flex-end
to right-align the icons, ensuring the rightmost icons (status icons) align at the same horizontal position across all reviewer rows.
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.
@copilot Not quite. It's happening when the review is added becuase of the div we add for an aria announcement:
vscode-pull-request-github/webviews/components/reviewer.tsx
Lines 33 to 34 in 2c5d21d
Make sure that that div is not taking up space.
@copilot Not quite. It's happening when the review is added becuase of the div we add for an aria announcement:
vscode-pull-request-github/webviews/components/reviewer.tsx
Lines 33 to 34 in 2c5d21d
Make sure that that div is not taking up space.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
@copilot Not quite. It's happening when the review is added becuase of the div we add for an aria announcement: https://github.com/microsoft/vscode-pull-request-github/blob/2c5d21d5b17789b3233b329cfab...
Fixed in commit bc9b17b. Added CSS to hide the aria alert div from the layout while keeping it accessible to screen readers:
.reviewer-icons [role='alert'] { position: absolute; width: 0; height: 0; overflow: hidden; }
@copilot Not quite. It's happening when the review is added becuase of the div we add for an aria announcement: https://github.com/microsoft/vscode-pull-request-github/blob/2c5d21d5b17789b3233b329cfab...
Fixed in commit bc9b17b. Added CSS to hide the aria alert div from the layout while keeping it accessible to screen readers:
.reviewer-icons [role='alert'] { position: absolute; width: 0; height: 0; overflow: hidden; }
Uh oh!
There was an error while loading. Please reload this page.
Problem
The icons and commands displayed next to reviewer names in the pull request view were misaligned horizontally across multiple reviewer rows, as shown in the screenshot below:
When some reviewers had both the re-request review button (sync icon) and a status icon, while others had only a status icon (like bot accounts), the rightmost icons (checkmarks, comment icons, etc.) did not align at the same horizontal position across rows. This created an inconsistent and unprofessional appearance.
Solution
Added
align-items: center
andjustify-content: flex-end
to the.reviewer-icons
flexbox container, and hidden the aria alert div from the layout to prevent it from taking up space. These changes inwebviews/common/common.css
ensure proper vertical centering and horizontal alignment of icons across all reviewer rows.Technical Details
The
.reviewer-icons
container uses flexbox layout and holds multiple child elements:.icon-button
for the re-request review action (only shown for non-bot reviewers who have already reviewed).section-icon
for the review state (approved, changes requested, commented, etc.)div[role='alert']
for accessibility announcements when reviews are addedThe key issues were:
By adding
justify-content: flex-end
, the icons are right-aligned within the container, ensuring the rightmost icon (status icon) always appears at the same horizontal position regardless of whether the sync button is present. The aria alert div is now positioned absolutely with zero dimensions, removing it from the layout flow while maintaining accessibility for screen readers.The
align-items: center
ensures proper vertical centering of icons of different sizes within the container.This change follows the same pattern used throughout the codebase in similar components like
.section-item
,.avatar-with-author
, and.section-icon
, all of which usealign-items: center
for proper alignment.Fixes #7998
Original prompt
Fixes #7998
💬 Share your feedback on Copilot coding agent for the chance to win a 200ドル gift card! Click here to start the survey.