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 experimental support for the Origin Private File System #459

Merged
merged 109 commits into from
Oct 5, 2023

Conversation

Jaifroid
Copy link
Member

Fixes #349 experimentally. The idea is to experiment with the capabilities with the eventual aim of backporting upstream.

@Jaifroid Jaifroid added enhancement upstream Should be worked on in kiwix-js experimental Experimental features labels Sep 17, 2023
@Jaifroid Jaifroid added this to the Release 2.7.0 milestone Sep 17, 2023
@Jaifroid Jaifroid self-assigned this Sep 17, 2023
@Jaifroid Jaifroid changed the title Add the UI and explanation (not functional) Add experimental support for the Origin Private File System Sep 17, 2023
@Jaifroid Jaifroid marked this pull request as ready for review September 19, 2023 13:43
@Jaifroid
Copy link
Member Author

Although archives can be picked from the options list on mobile, it is fiddly, and often results in the previously selected archive being loaded anyway. This may have to be fixed simply by offering a simple list of archive links, although presentation would be slightly degraded on desktop.

@Jaifroid
Copy link
Member Author

Jaifroid commented Sep 19, 2023

Some things needed to complete this PR:

  • Need to sync OPFS before selecting file to delete or export
  • Test or disable in Electron and NWJS
  • Test that it's already disabled in UWP app
  • Change "Please choose a different folder" message to "Please add some files to the OPFS." if user has selected OPFS
  • Disable folder picker on mobile and also if OPFS is supported but no folder-picking methods
  • Handle the archiveList onclick event so that it is possible to select an archive even if there is only one in the list
  • Disable API if StorageManager.estimate() method is unavailable (currently affects iOS Safari)
  • Display OPFS option isn't hidden in IE11
  • Avoid unneeded extra clicks if legacy file-picker is used
  • Fix glitches in Firefox probably due to webkitdirectory code interfering with OPFS
  • Test and fix refresh archiveList button for all possible uses (webkitdirectory, File System Access API, directory, single file, File API)
  • Do not auto-open any filepicker on app launch
  • Update storage quota after delete / resync
  • When adding archives to OPFS, show name of archive being added
  • Handle cancellation of file picker dialogue when importing OPFS
  • Warn user if picked files are larger than the remaining quota
  • Do not display Configuration when autoloading archive / article (sometimes fails to display article even though loaded)
  • Fix drag-and-drop so it acts in exactly the same way as the File(s) picker
  • If possible, work out how to run two copies of the app at same time sharing same Service Worker. If easy, include here. If complicated, make separate issue. It's becoming an increasing problem with different ways of loading the app (in sidebar, as a PWA, in a browser page)... Not working well currently if there is another instance. See Support multiple instances of the PWA #462
  • Fix displaying a folder in UWP app -- it reverts to single-file display when clicking on a file in a folder
  • Allow Android to use ft-search by default for archives in OPFS
  • Add ability to download an archive directly into the OPFS if supported
  • Fix iOS glitch when loading single archive: display returns to Config even though landing page is loaded
  • When selecting to use OPFS, even if there are files already loaded into the OPFS, keep file selectors open
  • A few more tests (Android, Firefox)
  • Dogfeed for a while

@Jaifroid Jaifroid force-pushed the Add-experimental-support-for-OPFS branch from 14a1562 to 3064bd4 Compare October 5, 2023 06:45
@Jaifroid Jaifroid merged commit ad375c1 into main Oct 5, 2023
1 check passed
@Jaifroid Jaifroid deleted the Add-experimental-support-for-OPFS branch October 5, 2023 18:20
@Jaifroid Jaifroid modified the milestones: Release 2.7.2, Release 2.8.0 Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement experimental Experimental features upstream Should be worked on in kiwix-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PWA] Support Origin Private File System for opening of archives without file picking
1 participant