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: refactor labels #1145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: refactor labels #1145

wants to merge 1 commit into from

Conversation

3em
Copy link
Collaborator

@3em 3em commented Feb 21, 2025

Adjusted multiple components to the design
Added missing functionalities:

  • remove label at PR page
  • navigate to edit labels from the label dropdown
    Fixed the Icon component size: in flex containers, it could shrink

Design changes (before/after):

image

image

image

image

image

image

image

@3em 3em requested a review from knagurski as a code owner February 21, 2025 11:42
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for harness-design ready!

Name Link
🔨 Latest commit 087c6f6
🔍 Latest deploy log https://app.netlify.com/sites/harness-design/deploys/67c730ee64de8d00087f979a
😎 Deploy Preview https://deploy-preview-1145--harness-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for harness-xd-review ready!

Name Link
🔨 Latest commit 087c6f6
🔍 Latest deploy log https://app.netlify.com/sites/harness-xd-review/deploys/67c730ee7e399c00080f1868
😎 Deploy Preview https://deploy-preview-1145--harness-xd-review.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm not sure I follow why this file/hook exists in the first place.
cc @cjlee01 @sans-harness can we discuss once?

Copy link
Contributor

Choose a reason for hiding this comment

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

For sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This hook was created to populate data in the store (useLabelsStore). It's used on the labels list page and on the repository label details page. Essentially, it's just isolated code moved into a hook to fill the store, avoiding repetitive code.

width={width || size}
height={height || size}
className={className}
style={{ minWidth: `${width || size}px`, minHeight: `${height || size}px` }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious why this was needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Icon component is often used in layouts in a way that unintentionally reduces its width (e.g., due to flex), which is incorrect behavior. This code ensures that the icon maintains its width in any layout.

>
{!!value && <span className="max-w-full truncate">{value}</span>}

{!!counter && counter}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume this means that counting from 0 is not allowed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes you are right, 0 not allowed

)}

{hasShortcut && !!shortcutLetter && (
<div className="absolute right-1.5 top-1/2 flex h-5 -translate-y-1/2 cursor-pointer items-center gap-0.5 rounded-sm border bg-background-3 px-1 text-foreground-2 duration-100 ease-in-out">
<Icon name="apple-shortcut" size={12} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is going to annoy everyone who's not on a Mac.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@knagurski that's a fair point :) But I think it'd be better to move this to a separate task, if you don't mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, totally, just an observation when we were in the area

@andrewgolovanov andrewgolovanov force-pushed the labels-review branch 2 times, most recently from b1529dc to 8c93bab Compare March 3, 2025 17:06
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.

6 participants