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

WebViews: Implement simple WebView state #472

Closed
5 tasks
tjcouch-sil opened this issue Sep 27, 2023 · 1 comment · Fixed by #545
Closed
5 tasks

WebViews: Implement simple WebView state #472

tjcouch-sil opened this issue Sep 27, 2023 · 1 comment · Fixed by #545
Assignees

Comments

@tjcouch-sil
Copy link
Member

tjcouch-sil commented Sep 27, 2023

As a user, I want my tabs to stay the same between refreshes and restarts so I can pick up where I left off anytime.

As an extension developer, I want the platform to keep track of a set of data that describes the state of each of my webviews so I can keep the webview the same between sessions and such. I want to be able to set this data when the platform asks for a new webview so I can pull up the webview in whatever state is appropriate for the situation.

As a user, I want to open the Resource Viewer (or other relevant tabs) to a specific project so I can see Scripture as I choose.


We should implement a simple intro webview state to get us going with webview state (so we can give the selected project ID to webviews in the tech demo most importantly):

  • web view service keeps track of state (literally just an object) for each webview
  • web view service sends the webview state to the webview provider (as part of the saved web view definition?) when it is getting the contents of the web view
  • web view provider can edit the state as desired and returns the state (as part of the web view definition?)
  • web view service has some more code in the html wrapper that defines get/set functions to interact with this web view state. In the React wrapper, maybe we provide a hook to use these in a useState-like interface or pass the state and an updater function as props.
  • When the webview state is set, the web view service needs to persist it somehow (localstorage is probably fine for now)

We should also get some TypeScript types working as well. Don't necessarily need super tight great types. At least Record<string, unknown> or Record<string, any> would be good at first, though. Maybe we could do a mapped type for the options and state.

Settings & State Design Doc

@tjcouch-sil tjcouch-sil converted this from a draft issue Sep 27, 2023
@tjcouch-sil tjcouch-sil moved this to Open in Paranext Sep 27, 2023
@tjcouch-sil tjcouch-sil added this to the Tech Demo milestone Sep 27, 2023
@GlennPruitt GlennPruitt moved this from Open to Product Backlog in Paranext Sep 27, 2023
@katherinejensen00
Copy link
Contributor

Needs to persist when app closes and reopens

@katherinejensen00 katherinejensen00 moved this from Product Backlog to 🔖 ToDo in Paranext Oct 4, 2023
@lyonsil lyonsil moved this from 🔖 ToDo to 🏗 In progress in Paranext Oct 6, 2023
@lyonsil lyonsil self-assigned this Oct 6, 2023
@lyonsil lyonsil linked a pull request Oct 11, 2023 that will close this issue
@lyonsil lyonsil moved this from 🏗 In progress to 👀 In review in Paranext Oct 11, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Paranext Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants