Refactor data editing to hit the API directly, use one form#1276
Refactor data editing to hit the API directly, use one form#1276
Conversation
…frontend into 1275-kv-refactor
✅ Deploy Preview for documentcloud-frontend-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Can you speak to the decision to make each row save individually, vs saving all changes when clicking "Done"? I imagine folks might make changes, not click save on each field, and then lose changes when dismissing the editing dialog. |
|
A couple reasons: This is how the API works. There's no bulk endpoint, unless you're replacing the entire data object. Everything happens at the level of a single key, so I want to hit that endpoint and return quickly. For single documents, it was sort of ok to just replace the whole object, but I didn't like that it worked differently for bulk edits. For bulk edits, we need to hit each key on each document, so that adds up to a lot of requests. I want to make those batches as small as I can. |
|
Made another update: We can now track how many unsaved changes there are in the form and tell the user, so they can save. I also made the icons bigger, just to make things more obvious. |
|
One other thing I'm considering: These two forms now operate the same way, except for how many documents they operate on. |
|
This is looking really good. The larger buttons make a difference! A few last pieces of feedback:
|
|
I think I got everything. Try it out and let me know how it feels. |
|
Looking great! Two last things:
|
|
I can't actually fix 1 from within this component. The modal has its own |
|
Got 2 done now. Misread it as something else (which was also a problem that is now fixed). |

Closes #1275
lib/api/kv.tsmodule to handle common operations, plus testsKeyValue.svelteinput uses updated event handling to send and receive data<form>anymore)This PR will not handle optimistic updates for bulk tagging (#1207). That's going to probably happen as part of #1271.