-
Notifications
You must be signed in to change notification settings - Fork 28
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
Three-state labels #282
Three-state labels #282
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.
Great working implementation of three-state labels! 👏
Just minor comments about code quality and a missed bug but overall a great job!
src/app/shared/filter-bar/label-filter-bar/label-filter-bar.component.ts
Outdated
Show resolved
Hide resolved
class="flexbox-container" | ||
(click)="changeLabelState(label)" | ||
[class.hidden]="filter(input.value, label.name)" | ||
[style]="{ border: '2px solid ' + getBorderColor(label) }" |
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.
Would it be better to use the full return of a function instead of appending to the '2px solid '
string?
An axample would be labelService.setLabelStyle
which returns the full style object
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 believe there is no difference in which one is a better code design, but I would prefer not putting style-related code into ts files. Also, I believe it is clearer to have a function that attaches each state of a label to a color.
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 see where you are coming from and I would do the same as you.
My concern is following the coding style already established in this project as shown from labelService.setLabelStyle
.
We should wait for other's opinion @CATcher-org/active-devs.
src/app/shared/filter-bar/label-filter-bar/label-filter-bar.component.css
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.
Found a bug where removing all labels using the Remove All button gives the following error.
This is because in label-filter-bar.component.ts::removeAllSelection
references matSelectionList
which no longer exists.
The button functionality is therefore completely disabled.
Please refactor this function in accordance with the new implementation.
Other possibilities: using |
With regards to the indication of label states, I have thought about the solution of making the background color. However, remember that Github labels can be of any color, so red tags and green tags might blend in with the background. I would still prefer sticking with the border color, but incorporate strike through for deselected state. Please see updated screenshot in the PR description. With regards to the color, I have picked from Material Design color system. The bug on |
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 like the changes made and everything is in working order. LGTM!
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!
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!
Summary:
Fixes part of #240.
Type of change:
Changes Made:
Made the filter labels a three-state button.
Each filter label has the following 3 possible states:
Additionally, each label has the following state rotation: default -> selected -> deselected.
The old checkbox for two-state is removed. Labels are manually added to the set of selected/deselected label names.
Finally, the set of deselected label names are used in the filter to apply them to the issues/PRs displayed.
There is one case that I need to highlight. That is, if an issue/PR has 2 labels, one is in selected state, and one is in deselected state. Currently, the filter with deselected state takes precedence, so an issue/PR with deselected labels will be filtered out, regardless of whether any other of its labels are being selected. Consider #251 with labels
category.Feature
andcategory.Enhancement
, currently being assigned to me:It is being filtered out.
Screenshots:
Proposed Commit Message:
Checklist: