--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/92d16d9f-002e-4417-a1fa-42e869d7c143n%40googlegroups.com.
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:464 Saving with method 'autosave'
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:77 Input saver style [] is not recognized, using default of SingleFile.
$:/core/modules/utils/logger.js:52 saver-handler: Saving wiki with method autosave through saver slaymaker1907/browser-nativesaver
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:379 No previous known hash to compare against
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:413 Creating writable...
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:415 Created writable
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:418 Wrote data successfully
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:422 Closed writable
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:485 Successfully saved to file system
$:/plugins/slaymaker1907/browser-nativesaver/saver.js:495 Reseting file saver...$:/plugins/slaymaker1907/browser-nativesaver/saver.js:506 Reset file save location.
The modal is required even if using IndexedDB. We need a button click both to show the choose file/folder dialogue as well as getting write/read permission if using IndexedDB. If you have a wiki mostly for reading, you can click the "close" modal button to exit without setting up the file save location/file permissions.
Thank you very much for finding the bug with the consistency check! I rewrote a chunk of that recently when adding the save trail. I have fixed this and pushed the fix to GitHub and the example wiki (plugin version 0.6.2). I tested it out by opening the example wiki in two tabs and it was able to detect when the file had changed unexpectedly.
On Saturday, February 5, 2022 at 7:09:35 AM UTC-8 brian....@gmail.com wrote:
Also, when I click the "Reset file save location" button, nothing in the indexdb gets deleted. The button doesn't seem to have any effect in spite of the log messages:$:/plugins/slaymaker1907/browser-nativesaver/saver.js:495 Reseting file saver...$:/plugins/slaymaker1907/browser-nativesaver/saver.js:506 Reset file save location.
On Saturday, February 5, 2022 at 7:09:35 AM UTC-8 brian....@gmail.com wrote:[...]Also, when I click the "Reset file save location" button, nothing in the indexdb gets deleted. The button doesn't seem to have any effect in spite of the log messages:$:/plugins/slaymaker1907/browser-nativesaver/saver.js:495 Reseting file saver...$:/plugins/slaymaker1907/browser-nativesaver/saver.js:506 Reset file save location.Does the reset button work for you? The only way I've been able to get the save location to reset is to use developer tools to clear out the indexdb.
to this:window.indexedDB.deleteDatabase(UNIQUE_PLUGIN_ID);
window.indexedDB.deleteDatabase(DB_NAME);
Now with the indexdb entry re-populated, the sequence looks like this:
- Reload the TW page
- Click the + button to create a new tiddler
- Click the checkmark to save the tiddler
- A dialog box asks me if I want to let the site edit the file. I click the "edit file" button
- The file saves
So it is working for me even without the settings modal. Do you see this same behavior?
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/ihoCXMIkz9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6ee85fa3-f495-4a11-874d-01aa02db7a52n%40googlegroups.com.
As inspiration, this seems to be a decent implementation of native file storage API: https://bangle.io
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAAY2DnOq8LXuyC_4YJR6Q7KTU7%2Bek%3Ds_ZhGbYG_qa4PMEpir1A%40mail.gmail.com.
I seem to recall https://tiddlywiki.fission.app/ implements such a launcher,
but currently that page has an endlessly spinning "Authorizing with fission" message and the console has an "Uncaught (in promise) Error: Improperly formatted header value: skeleton" in webnative.js, so I couldn't confirm my memory.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAO5X8CzqmcQes5UTs%3DUDh_KDkSqp18_fpZc_ekvGF-iMeQ3SYQ%40mail.gmail.com.
In terms of stressing if you picked the right file, assuming you used the modal button, you don't need to stress out too much since the consistency check should catch that.
On Saturday, February 19, 2022 at 5:45:06 AM UTC-8 brian....@gmail.com wrote:On Fri, Feb 18, 2022 at 8:16 PM Frédéric Demers <fred....@gmail.com> wrote:As inspiration, this seems to be a decent implementation of native file storage API: https://bangle.ioThis does look pretty good. Another example is https://app.diagrams.net/.These two apps have a webpage at a well-known url which holds the javascript functionality. The data files are loaded in separately. Compare this to tiddlywiki in which the functionality and the data is combined together into a single file.I think to implement the same workflow in tiddlywiki, you'd have to have a "launcher" instance of tiddlywiki which would read a tiddlywiki instance from disk as the "data file".I seem to recall https://tiddlywiki.fission.app/ implements such a launcher, but currently that page has an endlessly spinning "Authorizing with fission" message and the console has an "Uncaught (in promise) Error: Improperly formatted header value: skeleton" in webnative.js, so I couldn't confirm my memory.I think the workflow implemented by the above two apps is "safer" than what I saw in the TW chromium native file saver. With the TW native saver the workflow looks like this:
- Load my native saver enabled TW using some url (possibly a file:// url)
- Click the Save button in HTML Native File System Saver modal
- From the file dialog select the same file I'm already editing
- Dialog box "a file with this name already exists, do you want to replace it?"
- Start sweating a little bit...if I've chosen the wrong file here, I might be overwriting something important
- Sweat a little bit more especially if I've loaded it from a web url where it isn't as easy to tell that I've selected the matching file or not
- Cross my fingers, click the "replace" button and hope for the best
The bangle and diagrams.net applications don't have the same room for user error since you are prompted for what file to read and then it automatically saves back to that same file. I find that workflow to be less nerve-wracking.Maybe with tiddlywiki's unique structure there is an even better workflow to be had, I don't know. And maybe the TW nativesaver can already be used with a better workflow and I just missed it.
I believe I can add a lot here but there remains a slight technical barrier for me.
What I want to see is to minimize user interaction including between reloads, and when forced interaction is necessary, improve and guide the user for minimum complexity. Here are a few techniques that may help overcome the barriers.
- Copy path to clipboard: If we want to save a tiddlywiki to an existing location, as may be forced when reloading the wiki or browser, we already have the full path and filename available in the browser, it just needs to be available to the save as dialogue.
- Custom Target/tab: If we want to protect against opening the same wiki in a tab, one trick is after the first save (knowing the full path and filename) we can construct a html link with an appropriate target attribute, then navigate to that (if possible closing the original tab), thus the wiki is now running in a tab with a named target.
- This should help given the global file:// issues
- Bookmarklet: Perhaps extending the value of Custom Target/tab and because there is value using it, we can consider the use of a bookmarklet both with a target and a payload if necessary.
- An example may be so if the user returned to the source site, published on the internet the bookmarklette can recall you already have a local copy and with a click. When saving from the source URL for the first time we could prompt the user to use their saved bookmark if they want to access their local copy, to not create a new one, or override and existing one.
- Copy path to clipboard: If we want to save a tiddlywiki to an existing location, as may be forced when reloading the wiki or browser, we already have the full path and filename available in the browser, it just needs to be available to the save as dialogue.
Does this one have any technical barrier for you? Sounds like you have it figured out. Sounds like a useful approach as long as the tiddlywiki is loaded from a file url.
[...]
- Custom Target/tab: If we want to protect against opening the same wiki in a tab, one trick is after the first save (knowing the full path and filename) we can construct a html link with an appropriate target attribute, then navigate to that (if possible closing the original tab), thus the wiki is now running in a tab with a named target.
What needs to know the full path and filename here? The user will know and the browser will know, but the functionality running in the web page (i.e. the tiddlywiki instance) will not know. It only has access to the filename minus the directory location. The directory location is hidden from it.
The user has the information required to construct the html link you mention, but the tiddlywiki page does not.[...]
- This should help given the global file:// issues
I'm not sure what you mean here.
- Bookmarklet: Perhaps extending the value of Custom Target/tab and because there is value using it, we can consider the use of a bookmarklet both with a target and a payload if necessary.
What do you mean by "payload"? Could you give an example?
- An example may be so if the user returned to the source site, published on the internet the bookmarklette can recall you already have a local copy and with a click. When saving from the source URL for the first time we could prompt the user to use their saved bookmark if they want to access their local copy, to not create a new one, or override and existing one.
I'm not sure how the bookmarklet would know you already have a local copy
- Copy path to clipboard: That's a good idea and should be possible when loaded as file://. UI design is a consideration here to make it clear to users when copying the path.
- Custom Target/tab: Do you mean something like Open Links in a New Tab, Or Re-Use Already Existing Tab (usefulangle.com)? I think this only works when clicking on links from a common page.
- Local storage: Not really all that safe since we can't guarantee that changes will be flushed to disk before leaving the browser
- If going with that kind of approach, I would rather just use a JS lock which can work with tabs in the same browser window.
- File Associations: Might work, though that requires some platform specific code such as an installer to setup the associations.
For Timimi, there is obviously the solution of disabling the saver via a setting, but that obviously sucks if you have multiple people using the wiki. It'd be nice if there was a way to specify a priority for savers, but I don't think there is one right now. I don't want to add a bunch of custom logic to this saver for other specific savers. I could add in some special field containing JS that can be modified for determining whether to enable this saver or not, but that seems like a lot of complexity for users.
...
It'd be nice if there was a way to specify a priority for savers, but I don't think there is one right now.