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

chore(Cross): [IOAPPX-283] Add IOScrollView (next iteration of GradientScroll, now deprecated) + IOScrollViewWithLargeHeader #5704

Merged

Conversation

dmnplb
Copy link
Contributor

@dmnplb dmnplb commented Apr 18, 2024

Note

This PR is the result of the discussion we had in the PR below:

Short description

This PR add the new IOScrollView, next iteration of the GradientScrollView (now officially deprecated):

  • Simpler UI logic without unnecessary calculations
  • Option to add a tertiary button
  • Dark mode support

It also adds the new IOScrollViewWithLargeHeader screen component that should replace RNavScreenWithLargeHeader.

List of changes proposed in this pull request

  • Add the new IOScrollView screen component. Compared to the previous GradientScrollView:

    • Remove GradientBottomActions because it hasn't added any advantage
    • Add the new snapOffset prop to optionally configure the snap point
    • Add optional headerConfig prop
    • Add optional includeContentMargins boolean value to remove content margins if needed
    • Manage everything inside GradientScrollView (now IOScrollView)
    • Refactor action related props by adding a single actions config object
    • Change opacity transition from discrete to continuous
    • Apply the opacity transition just to the gradient, excluding safe background block
    • Improve debugMode so you can see the gradient area even when the end is reached
  • Add the new IOScrollViewWithLargeHeader screen component. Compared to the previous RNavScreenWithLargeHeader:

    • Remove fixedBottomSlot because we already manage the actions at the bottom with the IOScrollView component
    • Simpler inner component logic

Preview

Three buttons Debug section
three-buttons.mp4
ioscrollview.mp4
New opacity transition Dark mode
new-opacity-transition.mp4
gradient-scroll-dark-mode.mp4

As you can see from the video above, in the most extreme case you can see all kinds of buttons.

How to test

  1. Launch the app in the local environment
  2. Go to the Design System → Screens → IOScrollView… screens

@dmnplb dmnplb added Design System New visual language and reduction of previous UI clutter Dark mode 🌝 labels Apr 18, 2024
@pagopa-github-bot pagopa-github-bot changed the title [IOAPPX-283] Add IOScrollView (next iteration of GradientScroll, now deprecated) + IOScrollViewWithLargeHeader chore(Cross): [IOAPPX-283] Add IOScrollView (next iteration of GradientScroll, now deprecated) + IOScrollViewWithLargeHeader Apr 18, 2024
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Apr 18, 2024

Affected stories

  • ⚙️ IOAPPX-283: Refactor di GradientScrollView per diverse combinazioni di pulsanti
    subtask of

Generated by 🚫 dangerJS against fb4f97f

@dmnplb dmnplb marked this pull request as ready for review April 18, 2024 16:00
@dmnplb dmnplb requested a review from a team as a code owner April 18, 2024 16:00
ts/components/ui/IOScrollView.tsx Outdated Show resolved Hide resolved
@CrisTofani CrisTofani requested a review from a team April 19, 2024 15:10
Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 10.43478% with 103 lines in your changes are missing coverage. Please review.

Project coverage is 49.40%. Comparing base (4f204b4) to head (763d43d).
Report is 85 commits behind head on master.

Current head 763d43d differs from pull request most recent head fb4f97f

Please upload reports for the commit fb4f97f to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5704      +/-   ##
==========================================
+ Coverage   48.42%   49.40%   +0.97%     
==========================================
  Files        1488     1608     +120     
  Lines       31617    31988     +371     
  Branches     7669     7744      +75     
==========================================
+ Hits        15311    15804     +493     
+ Misses      16238    16121     -117     
+ Partials       68       63       -5     
Files Coverage Δ
ts/components/ui/RNavScreenWithLargeHeader.tsx 80.76% <ø> (+3.84%) ⬆️
ts/features/design-system/navigation/navigator.tsx 18.75% <ø> (-4.11%) ⬇️
ts/features/design-system/navigation/routes.ts 100.00% <ø> (ø)
...esign-system/core/DSIOScrollViewWithoutActions.tsx 25.00% <25.00%> (ø)
...sign-system/core/DSIOScrollViewWithLargeHeader.tsx 20.00% <20.00%> (ø)
ts/features/design-system/core/DSIOScrollView.tsx 11.11% <11.11%> (ø)
ts/components/ui/IOScrollViewWithLargeHeader.tsx 5.26% <5.26%> (ø)
ts/components/ui/IOScrollView.tsx 10.25% <10.25%> (ø)

... and 442 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb333d9...fb4f97f. Read the comment docs.

@dmnplb
Copy link
Contributor Author

dmnplb commented May 17, 2024

@CrisTofani Let's merge this iteration for now, unless we have something else to add. Then we can easily iterate from the first release by adding what's needed. What do you think?

Copy link
Contributor

@CrisTofani CrisTofani left a comment

Choose a reason for hiding this comment

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

what about merging pagopa/io-app-design-system#243 , and upgrade it in this PR before merging this one?

@dmnplb
Copy link
Contributor Author

dmnplb commented May 17, 2024

what about merging pagopa/io-app-design-system#243 , and upgrade it in this PR before merging this one?

@CrisTofani We need to release a new version for the @giuseppedipinto's PR about ServiceCards, so it seems a good idea for me.

dmnplb added a commit to pagopa/io-app-design-system that referenced this pull request May 17, 2024
> [!caution]
> This PR depends on:
> * pagopa/io-app#5704

## Short description
This PR deprecates the `GradientScroll` and `GradientBottomActions`
components.

> [!important]
> This PR was added as part of the refactoring of the `GradientScroll`
component, but we preferred to move the screen component to the main
repo for easier maintenance.
> To learn more about the new `IOScrollView` component, please refer to:
> * pagopa/io-app#5704

## List of changes proposed in this pull request
- Add deprecation note to the `GradientScroll` and
`GradientBottomActions` components

## How to test
N/A

---------

Co-authored-by: Cristiano Tofani <cri.tofani@gmail.com>
Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
Co-authored-by: Alice Di Rico <83651704+Ladirico@users.noreply.github.com>
Copy link
Contributor

@CrisTofani CrisTofani left a comment

Choose a reason for hiding this comment

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

LGTM

@dmnplb dmnplb merged commit b4f2762 into master May 17, 2024
11 checks passed
@dmnplb dmnplb deleted the IOAPPX-283-add-ioscrollview-next-iteration-of-gradientscroll branch May 17, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cross Dark mode 🌝 Design System New visual language and reduction of previous UI clutter
Development

Successfully merging this pull request may close these issues.

None yet

5 participants