-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
fix: refactor labels #1145
Conversation
|
✅ Deploy Preview for harness-design ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for harness-xd-review ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
apps/gitness/src/pages-v2/pull-request/pull-request-compare.tsx
Outdated
Show resolved
Hide resolved
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.
i'm not sure I follow why this file/hook exists in the first place.
cc @cjlee01 @sans-harness can we discuss once?
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.
For sure
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.
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.
apps/gitness/src/pages-v2/project/labels/hooks/use-get-project-label-and-values-data.ts
Outdated
Show resolved
Hide resolved
apps/gitness/src/pages-v2/project/labels/project-labels-list-container.tsx
Outdated
Show resolved
Hide resolved
apps/gitness/src/pages-v2/project/labels/project-labels-list-container.tsx
Outdated
Show resolved
Hide resolved
apps/gitness/src/pages-v2/repo/labels/hooks/use-full-fill-label-store.ts
Outdated
Show resolved
Hide resolved
packages/ui/src/components/icon.tsx
Outdated
width={width || size} | ||
height={height || size} | ||
className={className} | ||
style={{ minWidth: `${width || size}px`, minHeight: `${height || size}px` }} |
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.
Just curious why this was needed?
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.
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} |
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.
I assume this means that counting from 0
is not allowed?
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.
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} /> |
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.
This is going to annoy everyone who's not on a Mac.
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.
@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?
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.
Yeah, totally, just an observation when we were in the area
packages/ui/src/views/labels/components/label-form-color-and-name-group.tsx
Outdated
Show resolved
Hide resolved
packages/ui/src/views/labels/components/label-form-color-and-name-group.tsx
Outdated
Show resolved
Hide resolved
504ac7e
to
b9f6a26
Compare
apps/gitness/src/pages-v2/pull-request/pull-request-conversation.tsx
Outdated
Show resolved
Hide resolved
apps/gitness/src/pages-v2/repo/labels/hooks/use-full-fill-label-store.ts
Outdated
Show resolved
Hide resolved
packages/ui/src/views/repo/pull-request/components/labels/pull-request-labels-header.tsx
Outdated
Show resolved
Hide resolved
b1529dc
to
8c93bab
Compare
8c93bab
to
087c6f6
Compare
Adjusted multiple components to the design
Added missing functionalities:
Fixed the Icon component size: in flex containers, it could shrink
Design changes (before/after):