Skip to content
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

chore(comments): add support for comments layout avatar config #5944

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

pedrobonamin
Copy link
Contributor

Description

Adds support for avatar config in comments layout.

{
    parentCommentAvatar: boolean
    threadCommentsAvatar: boolean
    replyAvatar: boolean
    avatarSize: AvatarSize
  }

Supports building the UI needed for tasks.
Notice how the avatar size is reduced and also removed from the parent comment.

Screenshot 2024-03-11 at 10 18 27

What to review

Testing

Notes for release

@pedrobonamin pedrobonamin requested review from a team, skogsmaskin and hermanwikner and removed request for a team March 11, 2024 09:19
Copy link

vercel bot commented Mar 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 11, 2024 11:26am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2024 11:26am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2024 11:26am

Copy link
Contributor

github-actions bot commented Mar 11, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 11, 2024

Component Testing Report Updated Mar 11, 2024 11:30 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 5s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 2s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 24s 8 0 1

@pedrobonamin pedrobonamin force-pushed the edx-1142 branch 5 times, most recently from 398a1bf to 1e96825 Compare March 11, 2024 10:32
@@ -325,7 +344,7 @@ export function CommentsListItemLayout(props: CommentsListItemLayoutProps) {
>
<InnerStack space={1} data-muted={displayError}>
<Flex align="center" gap={FLEX_GAP} flex={1}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the parent comment does not have an avatar, the spacing between the author name and the comment message is a bit off (see image). To address this, I suggest creating a styled component of this Flex – like HeaderFlex – which has a min height of 25px.

const HeaderFlex = styled(Flex)`
  min-height: ${AVATAR_HEIGHT};
`  

Before and after:

Screenshot 2024-03-11 at 11 49 10

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated it to use the avatar size prop.
The height of the avatar will be variable, e.g. if size is 0 it will be 19px.
Screenshot 2024-03-11 at 12 15 47

Copy link
Member

@hermanwikner hermanwikner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pedrobonamin!

@pedrobonamin pedrobonamin added this pull request to the merge queue Mar 11, 2024
Merged via the queue into next with commit f42ea79 Mar 11, 2024
37 checks passed
@pedrobonamin pedrobonamin deleted the edx-1142 branch March 11, 2024 12:17
ninaandal pushed a commit that referenced this pull request Mar 12, 2024
* chore(comments): add support for comments layout avatar config

* chore(comments): remove show prop from SpacerAvatar

* fix(comments):  nitpicks

* fix(comments): add min height to the comment list item header
juice49 pushed a commit that referenced this pull request Mar 13, 2024
* chore(comments): add support for comments layout avatar config

* chore(comments): remove show prop from SpacerAvatar

* fix(comments):  nitpicks

* fix(comments): add min height to the comment list item header
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.

2 participants