Summary
Quick Access drag-to-reorder currently persists the new favorite order by saving each binding one at a time.
Current behavior
The frontend computes the reordered favorite list, updates local state optimistically, then loops through every favorite and calls bindingsSave() separately with the new favorite_order.
If one of those writes fails after earlier writes succeeded, the frontend restores its previous in-memory order while the persisted bindings.json may already contain a partial reorder.
Expected outcome
Persist a Quick Access reorder as one backend operation and one durable store replacement.
Acceptance criteria
- expose a focused backend operation for reordering favorites (or equivalently saving the complete normalized order atomically)
- validate that all referenced binding IDs exist and that the requested favorite order is valid
- normalize favorite orders to a contiguous sequence
- write
bindings.json once using the existing temporary-file/replace path
- update the frontend to call the atomic reorder operation instead of saving favorites in a loop
- on failure, persisted and in-memory state remain consistent
- add regression coverage for reorder normalization and invalid/missing IDs
Constraints
- do not replace the existing safe binding-store write mechanism
- keep normal create/edit binding operations independent from reorder semantics
Likely files
crates/core/src/bindings.rs
apps/tauri/src-tauri/src/commands.rs
apps/tauri/src/api.ts
apps/tauri/src/main.ts
Summary
Quick Access drag-to-reorder currently persists the new favorite order by saving each binding one at a time.
Current behavior
The frontend computes the reordered favorite list, updates local state optimistically, then loops through every favorite and calls
bindingsSave()separately with the newfavorite_order.If one of those writes fails after earlier writes succeeded, the frontend restores its previous in-memory order while the persisted
bindings.jsonmay already contain a partial reorder.Expected outcome
Persist a Quick Access reorder as one backend operation and one durable store replacement.
Acceptance criteria
bindings.jsononce using the existing temporary-file/replace pathConstraints
Likely files
crates/core/src/bindings.rsapps/tauri/src-tauri/src/commands.rsapps/tauri/src/api.tsapps/tauri/src/main.ts