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

feat(points): Add error banner on failure fetching subsequent points history pages #5362

Merged
merged 14 commits into from
May 1, 2024

Conversation

jophish
Copy link
Contributor

@jophish jophish commented Apr 29, 2024

Description

Adds in an inline notification error when there's a failure fetching subsequent points history page.s See designs here.

Test plan

Unit and manual tested. See video below.

error-page-state-2024-04-29_12.08.40.mp4

Related issues

  • Fixes #[issue number here]

Backwards compatibility

Yes.

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

@jophish jophish changed the base branch from main to jophish/no-history April 29, 2024 20:18
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.06%. Comparing base (13d98f8) to head (27308cb).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5362   +/-   ##
=======================================
  Coverage   86.06%   86.06%           
=======================================
  Files         735      735           
  Lines       29952    29962   +10     
  Branches     5125     5128    +3     
=======================================
+ Hits        25778    25787    +9     
- Misses       3947     3948    +1     
  Partials      227      227           
Files Coverage Δ
src/analytics/Properties.tsx 100.00% <ø> (ø)
src/points/PointsHistoryBottomSheet.tsx 98.66% <100.00%> (+0.20%) ⬆️

... and 1 file 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 13d98f8...27308cb. Read the comment docs.

Copy link
Collaborator

@kathaypacific kathaypacific left a comment

Choose a reason for hiding this comment

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

LGTM, would be great to address my comments before merging!

src/points/PointsHistoryBottomSheet.tsx Outdated Show resolved Hide resolved
src/points/PointsHistoryBottomSheet.tsx Outdated Show resolved Hide resolved
ctaLabel={t('points.history.pageError.refresh')}
onPressCta={onPressRefresh}
withBorder={true}
style={styles.errorBanner}
Copy link
Collaborator

Choose a reason for hiding this comment

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

you'll also need to add something like { paddingBottom: Math.max(insets.bottom, Spacing.Thick24) } here, otherwise this content collides with the bottom bar.

Simulator Screenshot - iPhone 14 Pro - 2024-04-30 at 09 49 55

Copy link
Collaborator

Choose a reason for hiding this comment

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

i didn't notice this before, but it seems like the section headers are sticky? is that expected? the homefeed doesn't do this and i guess it doesn't matter so much but in my screenshot above you can see some clipped content which was unexpected for me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, this actually isn't something I've ever experienced on Android -- I wonder if this is a platform-specific thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

I ran into this on a different screen. https://reactnative.dev/docs/sectionlist#stickysectionheadersenabled - defaults to true on iOS

@@ -92,6 +96,16 @@ function PointsHistoryBottomSheet({ forwardedRef }: Props) {
forwardedRef.current?.close()
}

const onPressRefresh = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const onPressRefresh = () => {
const onPressRefreshNextPage = () => {

actually i wonder if you want to consider combining this with onPressTryAgain? they're doing the same thing and could probably just take a getNextPage as input. we could also consider having the same analytics event with a property for getNextPage (since it's the same user action, to retry the fetch?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, good callout, combined them into a single fn that shares an analytics event.

Copy link
Member

@jeanregisser jeanregisser left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines 204 to 206
errorBanner: {
marginHorizontal: Spacing.Regular16,
},
Copy link
Member

Choose a reason for hiding this comment

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

I suggest we use absolute positioning (over the content) toward the bottom for this one.
So it doesn't abruptly push the content up when it appears.

Base automatically changed from jophish/no-history to main April 30, 2024 22:51
@jophish jophish added this pull request to the merge queue May 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 1, 2024
@jophish jophish added this pull request to the merge queue May 1, 2024
Merged via the queue into main with commit d2230ca May 1, 2024
16 checks passed
@jophish jophish deleted the jophish/error-new-page branch May 1, 2024 23:00
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
…history pages (valora-inc#5362)

### Description

Adds in an inline notification error when there's a failure fetching
subsequent points history page.s See designs
[here](https://www.figma.com/file/rXBDplfMHHqYmuu6EkgMEo/Gamification-experiments?type=design&node-id=1486-6438&mode=design&t=gVtyIzOM0LmxJaDy-4).

### Test plan

Unit and manual tested. See video below.


https://github.com/valora-inc/wallet/assets/569401/c5cb9fc4-50a3-424c-84f6-dab6fb10f981

### Related issues

- Fixes #[issue number here]

### Backwards compatibility

Yes.

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants