Skip to content

Feat/number input 2 #2333

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

Merged
merged 24 commits into from
Dec 12, 2022
Merged

Feat/number input 2 #2333

merged 24 commits into from
Dec 12, 2022

Conversation

M-i-k-e-l
Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l commented Nov 20, 2022

Description

NumberInput - a new take on the component
Update the UI in onBlur
Removed tests from the npm package

WOAUILIB-2640

Changelog

NumberInput - new component (⚠️ also removed tests from the npm package)

@M-i-k-e-l M-i-k-e-l requested a review from lidord-wix November 21, 2022 11:39
@M-i-k-e-l M-i-k-e-l added the Important for Next Release PR that must be included in the release version label Nov 21, 2022
@M-i-k-e-l M-i-k-e-l marked this pull request as ready for review November 21, 2022 11:39
Copy link
Contributor

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@M-i-k-e-l
Just before I'll review the code:

  1. Looks very good!
  2. When entering a large number the NumberInput stretches its width to the screen width (and more) and in the guidelines they ask to keep an s5 margin from each side.
  3. Just to make it easier to review - how different is this PR's implementation from the previous one? should I review all the files? is there something I should focus on more?

@M-i-k-e-l
Copy link
Collaborator Author

@M-i-k-e-l Just before I'll review the code:

Please ping me in another way if you think you are blocked from reviewing because when I get an email with a comment I assume you've already reviewed it and I may not immediately look at the comments themselves, this delays the release on the component...

  1. Looks very good!
  2. When entering a large number the NumberInput stretches its width to the screen width (and more) and in the guidelines they ask to keep an s5 margin from each side.
  3. Just to make it easier to review - how different is this PR's implementation from the previous one? should I review all the files? is there something I should focus on more?
  1. 10x!
  2. Fixed (partly in the component and partly in the screen); there's still a bug with a long text where the trailingAccessory is pushed, this is a bug in TextField see here.
  3. Very different.

@M-i-k-e-l M-i-k-e-l requested a review from lidord-wix December 5, 2022 14:25
Copy link
Contributor

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote some comments on the code (it looks like a lot but many of them are about naming and small stuff), and more general comments:

  1. I still see an issue with a long input - you can't see the last char you typed (it's cut), you can also see that the left margin is kept when the right one is not.
  2. If you do keep the two example screens, consider adding another file for all the shared code (processInput, onChangeNumber, validation functions, and so on).
  3. If doing changes as I suggested, don't forget to update the relevant API files.
  4. BTW, I already wrote some of the comments I added here in the previous PR.. that's why I asked about the diffs before I did the review :)

@M-i-k-e-l
Copy link
Collaborator Author

M-i-k-e-l commented Dec 7, 2022

I wrote some comments on the code (it looks like a lot but many of them are about naming and small stuff), and more general comments:

  1. I still see an issue with a long input - you can't see the last char you typed (it's cut), you can also see that the left margin is kept when the right one is not.

Yes, I wrote about this in the previous section (number 2 here)

  1. If you do keep the two example screens, consider adding another file for all the shared code (processInput, onChangeNumber, validation functions, and so on).

I think we want to change the screens, but I am not sure about shared code in screens, it can make the example less clear which might be more important.

  1. If doing changes as I suggested, don't forget to update the relevant API files.

ok

  1. BTW, I already wrote some of the comments I added here in the previous PR.. that's why I asked about the diffs before I did the review :)

ok

@M-i-k-e-l M-i-k-e-l requested a review from lidord-wix December 7, 2022 08:36
@M-i-k-e-l
Copy link
Collaborator Author

@lidord-wix - I've changed the screen according to the requests

@ethanshar - could you please take a look at these two commits 🙏
They add a little support for function component in our ExampleScreenPresenter (is there a better way to do it?) and support centered for TextField's validationMessage, add some memoization and fix typescript

@lidord-wix
Copy link
Contributor

I wrote some comments on the code (it looks like a lot but many of them are about naming and small stuff), and more general comments:

  1. I still see an issue with a long input - you can't see the last char you typed (it's cut), you can also see that the left margin is kept when the right one is not.

Yes, I wrote about this in the previous section (number 2 here)

Oh I thought you only wrote about the case with a trailingAccessory

  1. If you do keep the two example screens, consider adding another file for all the shared code (processInput, onChangeNumber, validation functions, and so on).

I think we want to change the screens, but I am not sure about shared code in screens, it can make the example less clear which might be more important.

  1. If doing changes as I suggested, don't forget to update the relevant API files.

ok

you forgot :)

  1. BTW, I already wrote some of the comments I added here in the previous PR.. that's why I asked about the diffs before I did the review :)

ok

@lidord-wix
Copy link
Contributor

@M-i-k-e-l
I think you missed some of my comments, please take a look again :)

@@ -35,6 +35,46 @@ export function renderHeader(title: string, others?: TextProps) {
);
}

// eslint-disable-next-line max-params
export function renderBooleanOptionForFunction(title: string,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising another option here..
What if instead of creating the same methods for function components, you'll add options object for state, setState.
if the user pass them, you will use them, otherwise you'll use this.state, this.setState

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@M-i-k-e-l M-i-k-e-l requested a review from lidord-wix December 11, 2022 16:30
Copy link
Contributor

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, see my last two comments :)

@M-i-k-e-l M-i-k-e-l enabled auto-merge (squash) December 12, 2022 09:13
@M-i-k-e-l M-i-k-e-l merged commit 766f43c into master Dec 12, 2022
@M-i-k-e-l M-i-k-e-l deleted the feat/number-input-2 branch December 12, 2022 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important for Next Release PR that must be included in the release version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants