Skip to content
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

[IOPID-1899] NumberPad optimization #284

Merged
merged 12 commits into from
Jun 13, 2024

Conversation

ChrisMattew
Copy link
Collaborator

Short description

Improved NumberPad component performance, avoiding unnecessary renders

List of changes proposed in this pull request

  • Performance improvements
  • Add unitary tests for NumberPad component
  • Add documentation in NumberPad and NumberButton components
  • BREAKING CHANGE: update NumberPad APIs and logic**

Important

** The pin concatenation is not handled by NumberPad anymore. This kind of logic will need to be handled directly where the component will be used.

How to test

Run the ExampleApp, navigate in the Components > NumberPad section and start typing.

@ChrisMattew ChrisMattew self-assigned this Jun 7, 2024
@ChrisMattew ChrisMattew added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 7, 2024
@ChrisMattew ChrisMattew marked this pull request as ready for review June 7, 2024 14:26
@ChrisMattew ChrisMattew requested review from dmnplb and a team as code owners June 7, 2024 14:26
@dmnplb dmnplb changed the title [IOPID-1899] NumberPad optimization [IOPID-1899] NumberPad optimization Jun 10, 2024
@shadowsheep1 shadowsheep1 merged commit 037f501 into main Jun 13, 2024
6 checks passed
@shadowsheep1 shadowsheep1 deleted the IOPID-1899-ds-app-ottimizzazione-number-pad branch June 13, 2024 10:02
shadowsheep1 added a commit to pagopa/io-app that referenced this pull request Jun 13, 2024
> [!warning]
> This PR depends on
pagopa/io-app-design-system#284

## Short description
Upgraded DS lib and adapted all components that use `NumberPad`
component.

## List of changes proposed in this pull request
- Upgraded DS lib.
- Adapted all those components<sup>*</sup> that use the `NumberPad`
component to its new implementation derived from this DS update.
- Some performance improvements in the `PinCreation` components,
replaced the `pinMode` state with the `pinModeRef` to avoid renders on
pin mode change.

>[!Note]
><sup>*</sup> The affected components are: `IdentificationNumberPad`,
`PinCreation` and `DSNumberPad`

## E2E Tests
>[!Tip]
>[![Run e2e
tests](https://github.com/pagopa/io-app/actions/workflows/test-e2e.yml/badge.svg?branch=feature%2Fupgrade-design-system)](https://github.com/pagopa/io-app/actions/workflows/test-e2e.yml)
## Screens

<details><summary>iOS</summary>

<p>

|Identification Modal|Pin Creation|DS NumberPad|
|-|-|-|
|<video
src="https://github.com/pagopa/io-app/assets/94987118/ceaaa7fa-842e-41ae-b0e3-f8881c7c4035"
/>|<video
src="https://github.com/pagopa/io-app/assets/94987118/33e1edd8-8f0b-42f2-a5f3-0ed7820d8044"
/>|<video
src="https://github.com/pagopa/io-app/assets/94987118/1bd5d7e9-3070-4ef7-8cec-5becd6413362"
/>|

</p>
</details>

<details><summary>Android</summary>

<p>

|Identification Modal|Pin Creation|DS NumberPad|
|-|-|-|
|<video
src="https://github.com/pagopa/io-app/assets/94987118/9f43922a-c403-41f1-8197-2bb9ebee4fa5"
/>|<video
src="https://github.com/pagopa/io-app/assets/94987118/556bae2b-b482-42e4-a8d9-0bee24a9083a"
/>|<video
src="https://github.com/pagopa/io-app/assets/94987118/738c8061-cb34-4bdd-ad25-cb9701404eb1"
/>|

</p>
</details>

## How to test
Since there are three components affected by this changes, there are
just as many tests:
- **DSNumberPad**: Navigate to `Profile > Design System` and under
Screens section tap on `NumberPad` list item.
- **IdentificationNumberPad**: This component belongs to
`IdentificationModal` component so it can be tested doing any operation
that requires identification.
- **PinCreation**: Follow the *How to test* section in this
[PR](#5737)

---------

Co-authored-by: Fabio Bombardi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation don't merge ✋ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants