gitify icon indicating copy to clipboard operation
gitify copied to clipboard

refactor: adopt primer design system ui components

Open setchy opened this issue 1 year ago โ€ข 7 comments
trafficstars

Still WIP - raising early for visibility

Closes: #1541

Adopts the excellent GitHub Primer Design System Component Library - https://primer.style/components to replace our custom components and provide a level-up on user experience and visual consistency.

This PR, though sizeable, focuses on replacing the following components

  • Icons
  • Buttons
  • Layout via Stack

I have also replaced most tests to use data-testid and getByTestId so that they're more resilient to UI changes

Items found during testing that should be resolved

  • [ ] Horizontal scroll bar showing on notification animation (mark as read, etc)
  • [ ] Different uses of colors (tailwind vs design token), eg: green color
  • [ ] position of repository title tooltip gets cut off

setchy avatar Oct 12 '24 22:10 setchy

I have also replaced most tests to use data-testid and getByTestId so that they're more resilient to UI changes

Lovely, nice touch.

bmulholland avatar Oct 14 '24 14:10 bmulholland

@afonsojramos @bmulholland - I'm pretty happy with the completeness of this initial uplift to use the GitHub Primer UI Components.

I plan to update this issue later with before/after screenshots, but while that's pending, if you do happen to have a few minutes I'd appreciate your feedback by running this branch locally ๐Ÿ™

setchy avatar Oct 14 '24 22:10 setchy

Sure, testing this locally now :)

bmulholland avatar Oct 17 '24 17:10 bmulholland

A minor nitpick: there's now two different versions of green. The Gitify logo in the tray, when there's notifs, is one -- I think the same as open PR green? The sidebar icons are another, along with the sub-icons for a notification.

bmulholland avatar Oct 18 '24 08:10 bmulholland

A minor nitpick: there's now two different versions of green. The Gitify logo in the tray, when there's notifs, is one -- I think the same as open PR green? The sidebar icons are another, along with the sub-icons for a notification.

Good feedback.

The sidebar icons are now using the GitHub design tokens (colors), while the others (notification type icon and tray icons) are unchanged.

Post this PR I do intend to use the GitHub design token colors more extensively and reduce the amount of tailwind colors we're using

setchy avatar Oct 21 '24 16:10 setchy

Yeah I think temporary mismatches are fine, too.

bmulholland avatar Oct 22 '24 08:10 bmulholland

During further testing, noticed that when a notification row is animating out (mark as read, etc) a horizontal scroll bar is being shown temporarily. Added as an open task to the OP

setchy avatar Oct 23 '24 15:10 setchy

I think open in background is broken on this branch

bmulholland avatar Oct 28 '24 16:10 bmulholland

I think open in background is broken on this branch

Just tested and it's working for me...

setchy avatar Oct 28 '24 16:10 setchy

Will do some more testing

bmulholland avatar Oct 28 '24 16:10 bmulholland

How has the testing been going @bmulholland ? For me it's been really stable.

Once this is merged I plan to (finally) move forward with https://github.com/gitify-app/gitify/issues/985 - I have configured this on the atlassify codebase so should be an easy port across

setchy avatar Oct 31 '24 10:10 setchy

Yeah it's been working well for me :)

bmulholland avatar Oct 31 '24 18:10 bmulholland

@afonsojramos - I know you're a busy man atm, but if you do happen to have time to shake this down would love your feedback, too

setchy avatar Oct 31 '24 18:10 setchy

Giving it a try! ๐Ÿ‘€

afonsojramos avatar Nov 02 '24 19:11 afonsojramos

Wow, this has been a huge amount of work! Everything looks great!

However, I've found a couple of visual issues:

  1. Input component hover border is red by default? image

  2. Spacing in some icons under accounts seems too tight. I imagine my name is too long ๐Ÿ˜… If it was my full name it would be even worse ๐Ÿงจ image

  3. This weird hover in this text and icons under Accounts. image

And got a few questions regarding implementation on some things. I know that to add primer/react we needed to add styled-components, but I don't think we should mix and match both styled-components and tailwind. So I'd probably change those sx's.

I'm also (sometimes) seeing some errors on the console, but I think that is related to this: https://styled-components.com/docs/faqs#shouldforwardprop-is-no-longer-provided-by-default image

afonsojramos avatar Nov 03 '24 22:11 afonsojramos

Appreciate the kind words @afonsojramos and the feedback on some visual inconsistencies. I'll address them shortly ๐Ÿ‘จโ€๐Ÿ’ป

setchy avatar Nov 07 '24 12:11 setchy

However, I've found a couple of visual issues:

Apologies this took a while to get back to. Items 1, 2 and 3 have been addressed

I think we're getting quite close to this being merged. 6.x.x milestone perhaps?

setchy avatar Dec 03 '24 04:12 setchy

@setchy do you want some help in the replacement of the sxs?

afonsojramos avatar Dec 06 '24 00:12 afonsojramos

@setchy do you want some help in the replacement of the sxs?

Absolutely! Always welcome a friendly hand.

I haven't attempted to remove the style components used with primer components... I'm not sure how feasible that will be, but if possible I'm keen

setchy avatar Dec 06 '24 00:12 setchy

Seems like it is not possible ๐Ÿ˜… We need to override the component's defaults... Oh well ๐Ÿคท It's annoying, but isn't much of a problem.

afonsojramos avatar Dec 06 '24 00:12 afonsojramos

Thanks for taking a look ๐Ÿ™

setchy avatar Dec 06 '24 01:12 setchy

@bmulholland @afonsojramos - I've resolved all merge conflicts and done some final refactoring to our tailwind colors.

I think I'm ready for final review from you both if you have some time ๐Ÿ™

There is one niggling issue remaining whereby the user-selected theme is not correctly loading on startup...

setchy avatar Jan 17 '25 18:01 setchy

There is one niggling issue remaining whereby the user-selected theme is not correctly loading on startup...

This is now resolved. Left a few TODO comments for future us to clean up some of the legacy theming code

setchy avatar Jan 17 '25 22:01 setchy

I'm going to merge this to main and it's getting tricky to work on other PRs with this large changeset pending.

We can always adjust any minor things as we go

setchy avatar Jan 20 '25 12:01 setchy