-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Rename TextInputFocusable to Composer
⌨️ & add Stories For TextInputs and fix bugs
#7984
Conversation
Composer
⌨️ & add StoriesComposer
⌨️ & add Stories
a4e7316
to
3efd5e2
Compare
Found one issue. MaxLength Counter is not incrementing automatically when a user types the value in the Story. The reason is that when we don't bound the value prop to state on the parent component, TextInput never renders on the new value as it does not use state. We have to move the value property to state so that increments properly. But this issue is not linked with this PR and thus I request another milestone on the current contract to fix this. |
@parasharrajat this is ready for review yeah? let's remove the hold then |
I will update the screenshots and then remove the hold. |
Leaving a note so that I can fix those into the same milestone #7984 (comment) |
@rushatgabhane Do you want me to fix above-mentioned issues in the current PR or create a new PR? |
@parasharrajat let's create a new PR, it'll be easier to read if someone comes back to it later. |
Then it's good on hold. This is supposed to be final PR. |
Issue: Autogrow does not work for unbound inputs. |
I think it makes sense to keep them here as they won't make sense without stories. |
Composer
⌨️ & add StoriesComposer
⌨️ & add Stories For TextInputs and fix bugs
Cool, I'll review this tomorrow |
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
@parasharrajat idk how to comment on files that aren't modified
Yeah. Missed that. |
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.
@parasharrajat compose box disappears when editing comment.
This isn't present on main
Screen.Recording.2022-03-09.at.7.09.44.PM.mov
This is on main. And I don't see how this is related to changes on this PR. |
You're right. Sorry, I was mistaken |
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.
@NikkiWines 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.
Couple small comments. I think since this is changing so much your test and QA steps need to be more robust @parasharrajat
src/stories/TextInput.stories.js
Outdated
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...args} | ||
onChangeText={(value) => { | ||
if (value && value.toLowerCase() === 'damn!') { |
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.
Why damn!
? 😄
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 an example. 🤣 It fits into Damn! there is an error.
hint messages.
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 it's probably better to use something like Oops! Looks like there's an error.
Updated. |
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.
Sorry noticed while running through the test steps that we're getting fairly inconsistent in TextInput.stories.js - let's try to have standard conventions there.
Also, I would update the QA steps to identify how to get to Stories
const AutoGrow = Template.bind({}); | ||
AutoGrow.storyName = 'Autogrow input'; | ||
AutoGrow.args = { | ||
label: 'Autogrow input', |
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.
Let's standardize the case-convention for the labels: AutoGrow Input
since the other labels seem to capitalize everything.
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 seems older ones have first as only capital letter so I am going with that following the page titles in the app.
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 looks like there are still two main conventions for labels:
Input with xyz
- e.g.Input with default value
xyz input
- e.g.Prefixed input
I'm fine with either options but i do think we should pick one
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.
Updated most of them. Left few whose name makes more sense. But I would say it does not matter much. The main perspective should be that they should clearly show the proper example of that component/varient
src/stories/TextInput.stories.js
Outdated
/> | ||
); | ||
}; | ||
HintErrorInput.storyName = 'Input with hint & error'; |
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.
HintAndError Input
?
Updated. I don't remember the exact URL to open the stories on staging. Could you please let me know so that I can update that in QA steps? |
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.
Couple of other comments, but since you've updated the ones you added I'm happy to make another PR to handle standardizing some of the older inputs.
I'll approve but will re-review if you want to implement the suggested changes
const AutoGrow = Template.bind({}); | ||
AutoGrow.storyName = 'Autogrow input'; | ||
AutoGrow.args = { | ||
label: 'Autogrow input', |
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 looks like there are still two main conventions for labels:
Input with xyz
- e.g.Input with default value
xyz input
- e.g.Prefixed input
I'm fine with either options but i do think we should pick one
yeah! the URL is https://staging.new.expensify.com/docs/index.html |
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.
👍 Thanks for updating those
Gonna merge as @rushatgabhane already approved earlier |
✋ 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 staging by @NikkiWines in version: 1.1.43-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.43-2 🚀
|
I am tagging this PR to highlight an issue fixed here. All conditions in ternary expressions or left-hand operands on conditional renders, should be boolean. This PR is one of the PRs that uses conditional render with string operands, hence I am tagging it here for the contributors to check. We've also updated the item in the checklist with this PR to avoid this issue in the future. |
Details
Fixed Issues
$ #6584
Tests
PR Review Checklist
Contributor (PR Author) Checklist
main
before submitting my PR for review### Fixed Issues
section abovesrc/languages/*
files (if applicable)Styling.md
) for all style edits I madePR Reviewer Checklist
main
before submitting the PR### Fixed Issues
section abovesrc/languages/*
files (if applicable)QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android