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

Persist Interaction State for tabs #3824

Merged
merged 12 commits into from
Jan 21, 2025
Merged

Persist Interaction State for tabs #3824

merged 12 commits into from
Jan 21, 2025

Conversation

dus7
Copy link
Contributor

@dus7 dus7 commented Jan 17, 2025

Task/Issue URL: https://app.asana.com/0/0/1208991633646641/f
Tech Design URL: https://app.asana.com/0/481882893211075/1208983861756006/f
CC:

Description:

Adds storage and automatically stores WKWebView's interaction state data for each tab. These are used to restore back/forward history and scroll position on next launch after app was terminated.

Steps to test this PR:

  1. Mark yourself as internal user to enable the feature. Restart is required for the flag to have an effect.
  2. Open a few tabs, navigate to various links so that navigating back/forward is possible. Scroll can be adjusted.
  3. Terminate the app.
  4. Verify last opened tab is visible and website is scrolled to (roughly) the same position on the screen.
  5. Verify navigation history is available and working properly.
  6. Use Fire button. Verify all cache files are being removed. You can check the directory by putting a breakpoint somewhere in TabInteractionStateDiskSource and printing interactionStateCacheLocation or use debug menu to see the list of cache files.
  7. Open a few tabs again, enable Automatic Data Clearing.
  8. Verify all interaction cache files are removed.

Definition of Done (Internal Only):


Internal references:

Software Engineering Expectations
Technical Design Template

@dus7 dus7 marked this pull request as ready for review January 17, 2025 16:18
@dus7 dus7 requested a review from brindy January 17, 2025 18:14
Copy link

github-actions bot commented Jan 20, 2025

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 1fabeb0

Copy link
Contributor

@brindy brindy left a comment

Choose a reason for hiding this comment

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

Nice work. We talked about a couple of things on MM (add feature flag, moving code to extensions) and that looks good too.

@dus7 dus7 merged commit c7f080e into main Jan 21, 2025
13 checks passed
@dus7 dus7 deleted the mariusz/persist-webview-state branch January 21, 2025 13:12
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