Plan 4: Replace manual revision optimistic updates with TanStack DB actions
Refactor revision mutation helpers to use TanStack DB createOptimisticAction transactions for edit/new/abandon/describe/squash/rebase flows while preserving the existing public @/db API.
Details:
- Keep the preallocated change-id pool for instant jj new rows.
- Move optimistic row edits/deletes/inserts into synchronous action onMutate handlers.
- Refetch the revisions collection before transaction persistence completes so optimistic state can be safely reconciled with authoritative jj data.
- Continue tracking in-flight mutation IDs so repository watcher events do not stomp optimistic state.
- Reconcile returned jj operation IDs with the first-class operations collection and preserve undo toasts.
- Keep compatibility with existing lightweight mutation tests while production collections use native TanStack DB transaction methods.
Validation:
- cd apps/desktop && bun run typecheck
- cd apps/desktop && bun run lint
- cd apps/desktop && bun run test
- cd apps/desktop && bun run build