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

Fix reactions style #17869

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Fix reactions style #17869

wants to merge 10 commits into from

Conversation

toy
Copy link
Contributor

@toy toy commented Feb 7, 2025

Ticket

Related to OP#40437

What are you trying to accomplish?

Make icons square, a bit increase icon/font size, use visual counter for number of reactions and reduce distance between icons.

Screenshots

Was:
image
Before decreasing distance:
image
Before correcting sizes:
image
Now:
image

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@toy toy requested review from HDinger, akabiru and marcalcobe February 7, 2025 16:24
@marcalcobe
Copy link
Contributor

Hi @toy, these were never my designs. @psatyal worked on this, so I suppose is it better if he does the review on this.

@marcalcobe marcalcobe requested a review from psatyal February 10, 2025 09:03
@toy toy removed the request for review from marcalcobe February 10, 2025 11:04
@toy
Copy link
Contributor Author

toy commented Feb 10, 2025

@marcalcobe Certainly, thank you!

@github-actions github-actions bot temporarily deployed to gh-6899875-pr-17869 February 10, 2025 14:42 Inactive
Copy link
Member

@akabiru akabiru left a comment

Choose a reason for hiding this comment

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

Nice one Ivan, I like the improvements 🎨 - I left some questions on using primer specific font sizes. It would also be good to link to a ticket as this does change the UI (original FEATURE#40437)

Copy link
Member

@akabiru akabiru left a comment

Choose a reason for hiding this comment

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

Top work, again- love the new design! 🥇

@@ -1,6 +1,9 @@
.op-emoji-reactions--gap
row-gap: var(--base-size-4, 4px)

.op-reactions-button .Button-label
Copy link
Member

Choose a reason for hiding this comment

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

🟢 One thing to watch out for is breaking changes from primer changing class names- I reckon the odds are low but IIRC we try to avoid styling against primer internal class names for this reason.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd strongly vote against this whole block. As @akabiru said before, if Primer changes the class name, this will break without us noticing it. Further, what is even more important to me: You are overwriting the Primer default behaviour here which in itself is something that we should avoid. There are defined styles for the gap between the label and the trailing content. We should stick with that.

@akabiru
Copy link
Member

akabiru commented Feb 10, 2025

Top work, again- love the new design! 🥇

@toy I like the font size adjustment but I'm having second thoughts about the rounded emoji counters- one point @psatyal made earlier in the design was avoid drawing attention to emojis reactions - the rounded nature calls them out visually more than I'd like and they can be perceived as notifications as that's what we use for the notification center- add the tab counters and it seems like too much visual noise.

Screenshot 2025-02-10 at 10 24 52 PM

@psatyal
Copy link
Contributor

psatyal commented Feb 10, 2025

Hi @toy,

These are very interesting suggestions for improvement. Thank you.

Could I ask you what triggered this work? I don't see a work package for this feature, so I don't have context on what motivated it or why we are priotising this. Generally, we don't make direct changes to the design without first writing a feature with acceptance criteria. Having a work packge for work we're doing is important so so we can:

  • prioritise them in relation to other features and optimisations
  • document the changes we make inn OpenProject
  • have properly defined specs for testing/QA
  • notify relevant people (marketing who does screenshots/documentation)

As for the changes themselves, I think the reduced padding is definitely an improvement.

  • Is this implementation using the trailing counter on invisible buttons for the number? I'm not sure the extra visual complexity introduced by the badges is an improvement, especially for emojis of other people, which are of the 'invisible' variety (without a border).
  • What was the reason for the larger font size?

emoji-design-changes-user-and-outside

Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

Hi @toy

I appreaciate your proactiveness 👍 I agree with @psatyal, it is hard to evaluate that change without a ticket assigned to it which is specified and accepted. Of course we can all give our two scents to it, but in the end we have a product team whose task it is to think about a consistent and thourough UI. We should not simply skip that.
I added some remarks to the code but would like to wait for the feedback of the product team.

@@ -1,6 +1,9 @@
.op-emoji-reactions--gap
row-gap: var(--base-size-4, 4px)

.op-reactions-button .Button-label
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd strongly vote against this whole block. As @akabiru said before, if Primer changes the class name, this will break without us noticing it. Further, what is even more important to me: You are overwriting the Primer default behaviour here which in itself is something that we should avoid. There are defined styles for the gap between the label and the trailing content. We should stick with that.

},
aria: { label: aria_label_text(reaction, data[:users]) },
disabled: current_user_cannot_react?,
classes: %w[op-reactions-button f4 px-2]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use these classes directly. Instead use the system_arguments of Primer. Thus, we can be sure that the code works even if they change the class names in the future

text: number_of_user_reactions_text(data[:users]),
test_selector: "reaction-tooltip-#{reaction}"
)
button.with_trailing_visual_counter(count: data[:count])
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that we are using the default Primer slot here now 👍

@psatyal
Copy link
Contributor

psatyal commented Feb 11, 2025

I created a new work package for this:
https://community.openproject.org/projects/communicator-stream/work_packages/61402/activity

@toy: I can think you can address my points in the work package (I've copied my comment over) Henriette's ones here since they are more code-related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants