-
Notifications
You must be signed in to change notification settings - Fork 167
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
Make Label Cursor Hoverable #3332
Make Label Cursor Hoverable #3332
Conversation
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 think the label should only be hoverable for "Unavailable" and any other labels where we are showing a popover. There are no actions for "Available" and "Progressing" AFAIR - so no use making it hoverable(and confusing the users). Also, I think it's a bad practice to use void 0
(makes it inaccessible for screen readers- reference link) Can we use a button instead? - I think button is hoverable by default.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3332 +/- ##
==========================================
+ Coverage 84.80% 85.08% +0.28%
==========================================
Files 1315 1326 +11
Lines 29491 29707 +216
Branches 8056 8132 +76
==========================================
+ Hits 25009 25277 +268
+ Misses 4482 4430 -52
... and 87 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@manaswinidas Made it hoverable only for the 2 needed statuses. Kept it as Label because of the color prop vs button. addressed the void 0 issue as well |
<Label | ||
{...(isClickable | ||
? { | ||
onClick: () => { |
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.
not sure if we should prefer this over style={{ cursor: 'pointer' }}
🤔
(inspiration from #3344 - let me know if this works though.)
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.
It's already looks like the hand pointer, just like in the video. Or is it a different way we want it to look like?
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.
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 think maybe the suggestion was to avoid the noop function, but I think it's probably fine either way - inline styles are also not great 🤷
@YuliaKrimerman can you just add more detail to the comment in that noop function, something like "Click event is handled by the Popover parent, this prop enables clickable styles in the PatternFly Label"?
<Label | ||
{...(isClickable | ||
? { | ||
onClick: () => { |
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 think maybe the suggestion was to avoid the noop function, but I think it's probably fine either way - inline styles are also not great 🤷
@YuliaKrimerman can you just add more detail to the comment in that noop function, something like "Click event is handled by the Popover parent, this prop enables clickable styles in the PatternFly Label"?
@@ -118,8 +117,24 @@ export const ModelRegistryTableRowStatus: React.FC<ModelRegistryTableRowStatusPr | |||
} | |||
} | |||
|
|||
const isClickable = |
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 think you can have this logic based on whether there's a popover instead of based on status.
const isClickable = popoverTitle && popoverMessages.length;
@manaswinidas regarding the Also I think using just the cursor:pointer style wouldn't be good enough because the |
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.
LGTM - @manaswinidas if you disagree with the approval let's follow up
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mturley The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Comments addressed - may require followup conversation but shouldn't block the PR
https://issues.redhat.com/browse/RHOAIENG-13047
Description
Made the labels indicate they are hoverable in Settings page
Screen.Recording.2024-10-14.at.3.47.21.PM.mov
How Has This Been Tested?
On the UI
Test Impact
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main