Skip to content

fix: Restore the user's reading position under all circumstances - #133

Merged
nikclayton merged 1 commit into
pachli:mainfrom
nikclayton:53-remember-position2
Sep 29, 2023
Merged

nikclayton merged 1 commit into
pachli:mainfrom
nikclayton:53-remember-position2

Conversation

@nikclayton

Copy link
Copy Markdown
Contributor

The previous code did not always work when the user returned to the app after a lengthy absence (e.g., overnight).

Instead of restoring by scrolling in TimelineFragment, restore by working with the platform.

Determine the initial page to fetch by looking half a page ahead of the saved saved status ID, and fetch that status and the page immediately prior. This seems to match the view's expectations about what will be immediately available.

Set jumpThreshold and enablePlaceholders in the PagingConfig so the paging system will jump to the saved status.

Remove the restoration code in TimelineFragment.

Fixes #53

The previous code did not always work when the user returned to the
app after a lengthy absence (e.g., overnight).

Instead of restoring by scrolling in `TimelineFragment`,
restore by working with the platform.

Determine the initial page to fetch by looking half a page ahead of the
saved saved status ID, and fetch that status and the page immediately
prior. This seems to match the view's expectations about what will be
immediately available.

Set `jumpThreshold` and `enablePlaceholders` in the `PagingConfig` so
the paging system will jump to the saved status.

Remove the restoration code in `TimelineFragment`.

Fixes pachli#53
@nikclayton
nikclayton merged commit 6fedfe5 into pachli:main Sep 29, 2023
@nikclayton
nikclayton deleted the 53-remember-position2 branch September 29, 2023 17:45
@nikclayton nikclayton added this to the 1.2 milestone Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Remember previous position in timeline when reopening app

1 participant