bjsi/incremental-writing

Add a command for bulk adding search results

linduxed opened this issue · 0 comments

Currently the search results can be added to a queue by clicking the button that is added to the search sidebar section.

The code can be found here:

async addSearchResultsToQueue() {
const files = await this.getSearchResults();
const pairs = files.map((file) =>
this.links.createAbsoluteLink(normalizePath(file.path), "")
);
if (pairs && pairs.length > 0) {
new BulkAdderModal(
this,
this.queue.queuePath,
"Bulk Add Search Results",
pairs
).open();
} else {
LogTo.Console("No files to add.", true);
}
}

Currently this functionality is not available, as this has not been added as a "command", like this:

this.addCommand({
id: "create-new-iw-queue",
name: "Create and load a new queue.",
callback: () => new CreateQueueModal(this).open(),
hotkeys: [],
});

Is this something that would be interesting to add?