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

Add persistent settings and preferences capability to Web driver #2734

Closed
Tracked by #1646
Bluebugs opened this issue Jan 14, 2022 · 9 comments
Closed
Tracked by #1646

Add persistent settings and preferences capability to Web driver #2734

Bluebugs opened this issue Jan 14, 2022 · 9 comments
Assignees
Labels
Bounty Tickets with this label rewards core contributors for completion Driver:web Issues related to web driver specifically

Comments

@Bluebugs
Copy link
Contributor

Is your feature request related to a problem? Please describe:

The web driver in work does not currently have the ability to remember settings between run. It would be nice to have this feature working also in the web.

Is it possible to construct a solution with the existing API?

This will enable the settings API to be supported on the web, no new API should be necessary.

Describe the solution you'd like to see:

I think that the web local storage API should work for this use:

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

@Jacalz Jacalz added the Driver:web Issues related to web driver specifically label Jan 16, 2022
@andydotxyz
Copy link
Member

We need to ensure this applies to a fully operational preferences API too

@andydotxyz
Copy link
Member

$500 is currently allocated for eligible contributors completing this work (see Contributing: Membership).

Completed work will mean full storage and preferences work using local storage.

@andydotxyz andydotxyz added the Bounty Tickets with this label rewards core contributors for completion label Feb 8, 2024
@dweymouth
Copy link
Contributor

Does settings storage need to apply to all Fyne web apps? If so, that will probably need to use cookies instead of local storage, as local storage is per-origin.

@andydotxyz
Copy link
Member

Ah, this was written up as a little ambiguous. As I see it the important settings are communicated to the browser and we will use those internally. So the outstanding ticket is really:

  • Add support for storage APIs (file persistence etc)
  • Preference storage (for apps to store data that will be picked up next load)

I don't think any of this should be communicated out to other apps - so no cookies needed.

@dweymouth
Copy link
Contributor

Ah, I think storage APIs should be a separate ticket. Fyne settings and app preferences can both use local storage (as long as we're OK with saved Fyne settings applying per-webapp instead of system-wide like desktop and mobile).

The storage API (ie general file persistence) has to use something else since local storage is limited to 10 MiB per app I think. And I guess each one should have half the original bounty? ;)

@andydotxyz
Copy link
Member

You may have a point there. Happy to split the bounty as you suggest

@dweymouth dweymouth changed the title Add settings storage capability to Web driver Add persistent settings and preferences capability to Web driver Feb 12, 2024
@dweymouth dweymouth self-assigned this Feb 12, 2024
@andydotxyz
Copy link
Member

As discussed, this ticket is now $250 bounty, split with #4634

@kkoreilly
Copy link

kkoreilly commented Feb 12, 2024

I have the package https://github.com/cogentcore/core/tree/main/system/driver/web/jsfs, which I use in Cogent Core on the web platform to implement persistent settings and a full, Go stdlib compatible file system capable of storing any data using Indexed DB. You are free to adopt this code to fyne, or I can move it into a separate repository if you want to import it.

@dweymouth
Copy link
Contributor

Fixed on develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bounty Tickets with this label rewards core contributors for completion Driver:web Issues related to web driver specifically
Projects
None yet
Development

No branches or pull requests

5 participants