-
Notifications
You must be signed in to change notification settings - Fork 81
Reactions: Fix avatar display bugs #1835
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
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.
Pull Request Overview
This PR resolves avatar display issues by refining element selection and adjusting spacing between reaction elements. Key changes include filtering reaction groups by reaction type in the JS view, updating CSS gap and margin rules to ensure consistent spacing, and adding a data-reaction-type attribute in the PHP render for consistency.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/reactions/view.js | Filters reaction-group elements based on reactionType attribute. |
src/reactions/style.scss | Adjusts spacing (gap and margin rules) to ensure proper avatar layout. |
src/reactions/render.php | Introduces data-reaction-type attribute to match JS element filtering. |
build/* | Builds updated assets to reflect source code changes. |
Comments suppressed due to low confidence (1)
src/reactions/style.scss:47
- Verify that the use of the ':has' pseudo-class is fully supported by all target browsers, as its performance and compatibility could affect the proper removal of margin on avatars without a hidden sibling.
&:not([hidden]):not(:has(~ li:not([hidden]))) {
@@ -87,7 +87,7 @@ const { callbacks, state } = store( 'activitypub/reactions', { | |||
} | |||
|
|||
getElement() | |||
.ref.querySelectorAll( '.reaction-group' ) | |||
.ref.querySelectorAll( `.reaction-group[data-reaction-type="${ reactionType }"]` ) |
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.
do these quotation marks work properly 😳
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.
In my testing they did. What's the concern?
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.
that they won't work 😂
(simply haven't seen them in use for JS, CSS or HTML)
Fixes margins between avatars and details button, when there are hidden avatars:
Fixes hidden avatars when there are fewer Likes than reposts:
Proposed changes:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
The amount of avatars shown in the Reactions block no longer depends on the amount of likes, but is comment type agnostic.