Select, Unselect Tiddlers on Import

Importing a large number of tiddlers into an existing TiddlyWiki can indeed be frustrating, especially when you have to manually unselect existing tiddlers. This issue has been recognized by the community, and there are discussions about improving the import tool to make it more user-friendly. Hopefully, future updates will address these concerns and enhance the basic functionality of the import tool.

Here is a short and simple solution for the time being! It uses a viewtemplate and add few checkboxed ( buttons in the old version) to $:/Import tiddler on the fly.

NOTE i: Based on the Eric comment the code updated.

To give a try, import some tiddlers from another wiki and see how it works.

NOTE ii: Test on an empty TiddlyWiki and make sure to take a backup before testing on your TiddlyWiki with important data.

The original idea of unselecting existing tiddlers is credited to @EricShulman.

Screenshot

msedge_img_239_20240714


References

3 Likes

Note that the existing TWCore $:/Import interface already does “select all” and “unselect all” via the checkbox at the top of the “select” column.

Note that the existing TWCore $:/Import interface already does “select all” and “unselect all” via the checkbox at the top of the “select” column.

Ah, that is true!
I forgot it :slight_smile:

Based on Eric hint, I updated the code. It now handles system, shadow, and ordinary tiddlers.
To be fully consistent with Import interface, one need to touch the core tiddler: $:/core/ui/ImportListing but for the time being I preferred to not overwrite TW tiddlers. This is the new interface.

1 Like

For importing really large number of tiddlers (like a few thousands tiddlers), I find displaying the selection list of every import tiddlers slows things down, compared to the actual importing.

One way to reduce the number of tiddlers displayed during import review is to show only a default limit of perhaps 100 entries and have an edit-field to change this limit. The selection boxes (all, system, shadow, ordinary etc) should apply to all the tiddlers to be imported rather than just the shown tiddlers. Just a suggestion. No idea how feasible this is with the current import implementation.

1 Like

This looks fantastic, @Mohammad — Many thanks for putting time into this!

My dream modifications are perhaps not possible… but given your work here it seems this is a good moment to ask:

  • Could there be a “batch rename” applied to existing/conflicting tiddlers (to import with suffix, etc.) so that the import would avoid replacing any existing tiddlers? (Then I would use a tool like Commander on the imported batch to decide what to delete and what to retain and rename based on complex criteria.)

  • Even more ambitious: Could there be a filter condition that specifies what to include/exclude from import?

Background: I’m often importing from JSON sources over which I don’t have direct control, and I might want to import, say, exactly those tiddlers that do include a certain field, or just the tiddlers with modification date after 20240101xxxx, etc. Often I’m importing a batch that overlaps with prior import, and I’ve done important edits on some existing tiddlers, while other existing tiddlers will need to be replaced.

The only workaround I’ve found so far is to drop the whole JSON on a different wiki, use your Commander tool to sift through the batch, and then to import the more carefully selected batch to their final destination. Would be lovely to have an import tool that includes such power!

Pagination is possible, but this needs overwriting the core tiddlers. I would suggest to submit your suggestion here:

1 Like

Well, all of these are possible, but we need to have a more complex UI.
I will add another section with a textbox to accept a subfilter. This subfilter cannot have selection constructor, so it can modify the import by adding prefix/suffix or apply more filtering!

Hi @Springer
See the original post and download the new version with bulk renaming capability. Of course, it can further tined to have a better UI and better handling of buttons.
This new version has an input box accept a subfilter like [addprefix[New-]] or [addsuffix[-]addsuffix<now "hh-mm-ss">] to rename existing! The cancel button reverts the renaming!

You can add more button for example to add suffix/prefix to all inputs!

I would recommend further manipulation performed using Commander.

Wow, excellent! I don’t have time to work with it today, but I look forward to checking it out. Being able to bring a conflicting batch in with a custom suffix (or prefix) will allow me to use Commander (plus some other custom actions) to merge incoming JSON data in a highly flexible way!

I have tried the latest version of ‘Select Unselect on Import. json’, which is very efficient for regular use, but it seems to be ineffective for the ‘TidlyWiki Upgrade Wizard’ and ‘TidlyWiki Uglifier’. It still requires manual removal of existing items