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.
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.
Got you, I will update it to methods.
rushatgabhane
left a comment
There was a problem hiding this comment.
Looks good, left a few questions. Thank you 🙇
| get allVisibleOptionsCount() { | ||
| let count = 0; | ||
|
|
||
| _.forEach(this.sections, (section) => { |
There was a problem hiding this comment.
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.
Yes, it is the get syntax. I will update it in order of removing the get.
| optionHoveredStyle={this.props.optionHoveredStyle} | ||
| onSelectRow={this.props.onSelectRow ? this.selectRow : undefined} | ||
| sections={this.props.sections} | ||
| sections={this.sections} |
| /** 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.
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.
It is simple insets from safe area. It is a common RN feature. Anyway, I will try to describe comments.
|
@rezkiy37 would you mind adding me to your 10,000-tag workspace? |
|
@dannymcclain, sure. Please send me your login (email). |
…ture/31218-limit-tags
dannymcclain
left a comment
There was a problem hiding this comment.
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
| LINK: 'https://join.my.expensify.com', | ||
| }, | ||
|
|
||
| MAX_COUNT_OF_TAGS: 500, |
There was a problem hiding this comment.
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.
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.
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.
I can find all places and will post it here.
There was a problem hiding this comment.
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.
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.
Exactly, agree.
So, updating... Thank you for quick feedback 😉
There was a problem hiding this comment.
I love the consistency in behavior across all these screens! 🙌
There was a problem hiding this comment.
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
puneetlath
left a comment
There was a problem hiding this comment.
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} |











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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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