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

Eric/app 745 handle custom feed failure cases #1783

Closed

Conversation

estrattonbailey
Copy link
Member

@estrattonbailey estrattonbailey commented Oct 31, 2023

Adds an "inner" header to custom feeds that showcases the author and provides a context menu in places there wasn't one before. Also revises how errors are rendered in these cases.

Screen.Recording.2023-10-31.at.1.42.16.PM-1.mov
Screenshot 2023-10-31 at 1 50 38 PM Screenshot 2023-10-31 at 1 56 25 PM Screenshot 2023-10-31 at 1 56 41 PM Screenshot 2023-10-31 at 1 57 47 PM

Comment on lines +10 to +16
try {
const res = await store.agent.app.bsky.feed.getFeedGenerator({
feed: uri,
})
const view = res.data.view
return view
} catch (e) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was throwing an uncaught error

Comment on lines +25 to +26
str.includes('Failed to fetch') ||
str.includes('NetworkError when attempting to fetch resource')
Copy link
Member Author

Choose a reason for hiding this comment

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

Just want to catch this case too

@@ -47,6 +52,7 @@ export class PostsFeedModel {
isBlockedBy = false
error = ''
loadMoreError = ''
cleanError?: PostsFeedModelError = undefined
Copy link
Member Author

Choose a reason for hiding this comment

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

One idea for attaching more info to the error so we know more about what happened

Copy link
Member Author

Choose a reason for hiding this comment

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

This whole file is lifted from CustomFeed screen, no functional changes.

Comment on lines +79 to +83
if (isCustomFeed) {
feedItems.push(FEED_INNER_HEADER)
}
if (feed.hasError && !isCustomFeed) {
// applies to our internal algo feeds only
Copy link
Member Author

Choose a reason for hiding this comment

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

If it's a custom feed, the error message will show within the "inner" header component, which this PR introduces. If it's not a custom feed, we show a similar looking error message outside the header as we have been.

message={feed.error}
onPressTryAgain={onPressTryAgain}
<FeedInnerHeader
showContextMenu={showFeedHeaderContextMenu}
Copy link
Member Author

Choose a reason for hiding this comment

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

This prop is for use on the CustomFeed screen, which already uses this context menu.

Comment on lines +196 to +198
? isCustomFeed
? [FEED_INNER_HEADER_LOADING, LOADING_ITEM]
: [LOADING_ITEM]
Copy link
Member Author

Choose a reason for hiding this comment

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

If custom feed, show an additional skeleton UI component for the inner header

</View>
</CustomFeedContextMenu>
) : (
<View style={{height: 24}} />
Copy link
Member Author

Choose a reason for hiding this comment

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

Here to prevent layout shift when loaded

@pfrazee pfrazee self-assigned this Nov 2, 2023
@pfrazee
Copy link
Collaborator

pfrazee commented Nov 2, 2023

I like the premise of what you’re going for with the bottom bar, but I think we need a design in the tabs bar that specifically accommodates this

@pfrazee
Copy link
Collaborator

pfrazee commented Nov 3, 2023

Superseded by #1798

@pfrazee pfrazee closed this Nov 3, 2023
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.

2 participants