io-app
io-app copied to clipboard
chore(Cross): [IOAPPX-283] Add `IOScrollView` (next iteration of `GradientScroll`, now deprecated) + `IOScrollViewWithLargeHeader`
[!note] This PR is the result of the discussion we had in the PR below:
- https://github.com/pagopa/io-app-design-system/pull/243
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
IOScrollViewscreen component. Compared to the previousGradientScrollView:- Remove
GradientBottomActionsbecause it hasn't added any advantage - Add the new
snapOffsetprop to optionally configure the snap point - Add optional
headerConfigprop - Add optional
includeContentMarginsboolean value to remove content margins if needed - Manage everything inside
GradientScrollView(nowIOScrollView) - Refactor action related props by adding a single
actionsconfig object - Change opacity transition from discrete to continuous
- Apply the opacity transition just to the gradient, excluding safe background block
- Improve
debugModeso you can see the gradient area even when the end is reached
- Remove
-
Add the new
IOScrollViewWithLargeHeaderscreen component. Compared to the previousRNavScreenWithLargeHeader:- Remove
fixedBottomSlotbecause we already manage the actions at the bottom with theIOScrollViewcomponent - Simpler inner component logic
- Remove
Preview
| Three buttons | Debug section |
|---|---|
| New opacity transition | Dark mode |
|---|---|
As you can see from the video above, in the most extreme case you can see all kinds of buttons.
How to test
- Launch the app in the local environment
- Go to the Design System → Screens → IOScrollView… screens
Affected stories
- ⚙️ IOAPPX-283: Refactor di
GradientScrollViewper diverse combinazioni di pulsanti subtask of- ⚡ IOAPPX-32: Design System
Generated by :no_entry_sign: dangerJS against fb4f97ffe8d79ade17e9c80eb7dcac7475d1e0b0
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.
:exclamation: 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
@@ 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%) |
:arrow_up: |
| ts/features/design-system/navigation/navigator.tsx | 18.75% <ø> (-4.11%) |
:arrow_down: |
| 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 dataPowered by Codecov. Last update cb333d9...fb4f97f. Read the comment docs.
@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?
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.