Fix reviewer icons horizontal misalignment in pull request view#8013
Fix reviewer icons horizontal misalignment in pull request view#8013
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Fixed in commit 2c5d21d. Added |
There was a problem hiding this comment.
@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>
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;
}
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;
} |


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: centerandjustify-content: flex-endto the.reviewer-iconsflexbox container, and hidden the aria alert div from the layout to prevent it from taking up space. These changes inwebviews/common/common.cssensure proper vertical centering and horizontal alignment of icons across all reviewer rows.Technical Details
The
.reviewer-iconscontainer uses flexbox layout and holds multiple child elements:.icon-buttonfor the re-request review action (only shown for non-bot reviewers who have already reviewed).section-iconfor 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: centerensures 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: centerfor 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.