-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Limit tag list to 500 items #31447
Limit tag list to 500 items #31447
Conversation
…ture/31218-limit-tags
This reverts commit 8e0ab70.
…ture/31218-limit-tags
…ture/31218-limit-tags
@dannymcclain @rushatgabhane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
/** | ||
* Calculates all exactly visible options of sections. | ||
*/ | ||
get allVisibleOptionsCount() { |
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.
get
This is new syntax. was there a discussion on it's usage?
We shouldn't use new code patterns without getting a buy-in from most of the team because it can reduce readability.
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.
Got you, I will update it to methods.
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.
Done - 059a302.
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.
Looks good, left a few questions. Thank you 🙇
get allVisibleOptionsCount() { | ||
let count = 0; | ||
|
||
_.forEach(this.sections, (section) => { |
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.
did you mean this.props.sections
?
i can't find sections
being defined anywhere in the class. Is it the get
syntax binding it to the class?
_.forEach(this.sections, (section) => { | |
_.forEach(this.props.sections, (section) => { |
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, it is the get
syntax. I will update it in order of removing the get
.
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.
Done - 059a302.
@@ -424,7 +472,7 @@ class BaseOptionsSelector extends Component { | |||
ref={(el) => (this.list = el)} | |||
optionHoveredStyle={this.props.optionHoveredStyle} | |||
onSelectRow={this.props.onSelectRow ? this.selectRow : undefined} | |||
sections={this.props.sections} | |||
sections={this.sections} |
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.
same here.
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.
Same - #31447 (comment).
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.
Done - 059a302.
@@ -23,6 +24,9 @@ const propTypes = { | |||
|
|||
/** Should show the selected option that is disabled? */ | |||
shouldShowDisabledAndSelectedOption: PropTypes.bool, | |||
|
|||
/** Safe area insets required for mobile devices margins */ |
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 we can modify this comment to explain why and how we should use this required prop.
I would have suggested something but I don't understand this prop 😅
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 is simple insets from safe area. It is a common RN feature. Anyway, I will try to describe comments.
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.
Done - 19ff8d8.
@rezkiy37 would you mind adding me to your 10,000-tag workspace? |
@dannymcclain, sure. Please send me your login (email). |
…ture/31218-limit-tags
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.
Please note that I am reviewing this from a design standpoint. Technical reviews should still be done by those qualified to do them (aka not me). It's looking good!
…ture/31218-limit-tags
@rushatgabhane, the PR is ready for re-review |
src/CONST.ts
Outdated
@@ -2890,6 +2890,8 @@ const CONST = { | |||
LEARN_MORE_LINK: 'https://help.expensify.com/articles/new-expensify/billing-and-plan-types/Referral-Program', | |||
LINK: 'https://join.my.expensify.com', | |||
}, | |||
|
|||
MAX_COUNT_OF_TAGS: 500, |
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 we should set this max for anything that uses this optionList component - categories, tags, etc. Not just tags.
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.
So, you mean to set this limit by default? Right now it works like a property we can pass.
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.
That's what I was thinking yeah. Though I'm not sure all the places this component is used, so it'd be good to sanity-check that it makes sense.
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 can find all places and will post it here.
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.
So, @puneetlath, the component is BaseOptionsSelector and being used for 8 cases: Category Picker, Tag Picker, Money Request participant, Split Bill participant, Search, Start Chat. Task Assign, Task Share.
Obviously, I've tried to test the limitation. Actually, I like how it works for all cases.
Note: for this video I've changed the limitation to 10 items per page. You can also set any value.
Example.mp4
Added a commit - b08423a.
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.
And it'll be nice that any field that uses the options selector in the future, will automatically have this "show more" button built in. I don't even think we need to make it a prop. We could just make it a feature of that component. If in the future someone wants to make it configurable, then they can add it as a prop.
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.
Exactly, agree.
So, updating... Thank you for quick feedback 😉
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.
Done - 96c23a4.
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 love the consistency in behavior across all these screens! 🙌
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.
Looks like we are all aligned, so waiting on the review. @rushatgabhane, your turn 😉
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeiOS: Native8e96d538-effc-4580-b637-3f81268d4c9d.mp4MacOS: Chrome / SafariScreen.Recording.2023-11-22.at.01.38.40.mov |
…ture/31218-limit-tags
…ture/31218-limit-tags
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 job with this! Just a handful of comments. Not so much about the code, but mostly about the comments and making the code more understandable.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.5-7 🚀
|
<View style={[styles.shortTermsHorizontalRule, styles.flex1, styles.ml0]} /> | ||
</View> | ||
<ShowMoreButton | ||
containerStyle={styles.mt1} |
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.
Bottom margin missed here which caused #33758
Details
The PR introduces a new feature for limiting a maximum count of tags. There is a requirement that a solution should be reusable.
Also, added periods to at the end of sentences - requirement.
Fixed Issues
$ #31218
PROPOSAL: N/A
Tests
Note: before testing you should have a workspace with 501 tags at least. I can add you to my own with 10k+ tags.
Long list of tags
Short (<= 500 and <= 8) list of tags
Offline tests
Same as "Tests".
QA Steps
Same as "Tests".
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android.mp4
Android: mWeb Chrome
Android.Chrome.mp4
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.Safari.mp4
MacOS: Chrome / Safari
Chrome.mp4
MacOS: Desktop
Desktop.mp4