Skip to content

Batch editor extension - #1632

Open
tschicke wants to merge 4 commits into
beancount:mainfrom
tschicke:extension_slice_editor
Open

Batch editor extension#1632
tschicke wants to merge 4 commits into
beancount:mainfrom
tschicke:extension_slice_editor

Conversation

@tschicke

@tschicke tschicke commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

This exposes the SliceEditor svelte component through svelte-custom-elements, which allows extensions to use the SliceEditor by using
<svelte-component type="slice-editor"><script type="application/json">{{ <json props>|tojson }}</script></svelte-component>

This also adds another built in extension, batch_edit, which uses the slice editor to provide an editor page where you can input (part of) a BQL query to limit to a set of entries, and get a slice editor for up to 20 of those entries one after the other, to allow you to view different sets of transactions/entries simultaneously while editing.

tschicke added 4 commits July 1, 2023 15:35
This allows extensions to use the SliceEditor in their template html.
This requires changing the json object that the components provide to
be the entire props object instead of just the data field.
@yagebu

yagebu commented Jul 8, 2023

Copy link
Copy Markdown
Member

I've been wanting to add some sort of batch editing functionality for a while :) I'd like for this to be a builtin feature. Do you need the slice editor for some other purpose?

@tschicke

tschicke commented Jul 9, 2023

Copy link
Copy Markdown
Contributor Author

Yeah I knew batch editing had been talked about before, and it wasn't too hard to put this together as an extension, so I figured I'd try it out since the built in feature doesn't exist yet.
No, I don't specifically need the slice editor for anything else. svelte-component seemed like a nice way to expose some higher level UI functionality that fava implements to extensions, since they can't directly use svelte, but it seemed pretty specific to ChartSwitcher since it requires the component to have only a data prop. So I figured I'd start with exposing the slice editor since I had the idea for the batch editor that could use it.
If you want to hold off on the batch editor extension for the built in feature (or I guess even if you want to merge it but replace it later with a built in feature), are there any details/discussion anywhere about what the builtin editor would look like and how it would work? If I get some time and have some idea of what it should look like, I may try to attempt that.

@paulsc

paulsc commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Hi all, is there still interest in adding batch editing?

I implemented a version, which gives an additional "Apply All" checkbox in the SliceEditor, to propagate a change being made to one transaction to all the transactions in the parent journal view. It uses the deepdiff library to generate a diff and applies it to a group of transactions, based on the filters applied to the ledger. Demo:

Screen.Recording.2025-07-07.at.10.45.06.AM.mp4

I thought I could clean up my branch and submit a PR if there is interest in merging this.

EDIT: I have released this as an extension

@BenjaminDebeerst

Copy link
Copy Markdown

@paulsc any chance you'd be willing to publish the patch/branch with the "apply all" button from your demo video? You extension is nice, but a lot less practical than the version shown here, since one needs to change to another view to reapply a change to the rest of the list.

No worries if this is a branch off of an old version of fava, I'd be happy to port it forward to keep it with the few other personal edits on my fork.

Thanks in advance!

@paulsc

paulsc commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@paulsc any chance you'd be willing to publish the patch/branch with the "apply all" button from your demo video? You extension is nice, but a lot less practical than the version shown here, since one needs to change to another view to reapply a change to the rest of the list.

No worries if this is a branch off of an old version of fava, I'd be happy to port it forward to keep it with the few other personal edits on my fork.

Thanks in advance!

Hi @BenjaminDebeerst, thanks for your interest! Unfortunately I don't seem to have that code anymore. It broke almost immediately due to changes upstream. I've tried the manual patch and fixing it when upstream changes come -strategy before, but it in the long run it was always too annoying and better to stick to the extension system with a fixed API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants