You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database mutations (add row, delete row, update cell value, add/delete property) currently wait for the Supabase round-trip before updating the UI. This creates noticeable lag, especially on slower connections. The database domain had 30+ bug fixes in the past week, many related to mutation flows and error handling — the error capture and retry infrastructure is now solid (see #797, #731, #686), making this a good time to layer in optimistic updates.
Optimistic updates would immediately reflect changes in the local state and roll back on failure, using the existing error toast + retry pattern from #797.
Approval Required
This is a HIGH risk enhancement:
Changes mutation behavior across all database views (table, board, list, calendar, gallery)
Modifies the use-database-rows, use-database-properties, and use-database-views hooks
Rollback logic must handle concurrent mutations correctly
Incorrect optimistic state could cause data loss perception (user thinks save succeeded when it didn't)
Comment "approved" to release this to the automation queue.
Acceptance Criteria
useAddRow optimistically inserts a row into the local cache before the Supabase call resolves
useDeleteRow optimistically removes the row from the local cache
useUpdateRowValue optimistically updates the cell value in the local cache
useAddProperty and useDeleteProperty optimistically update the property list
Description
Database mutations (add row, delete row, update cell value, add/delete property) currently wait for the Supabase round-trip before updating the UI. This creates noticeable lag, especially on slower connections. The database domain had 30+ bug fixes in the past week, many related to mutation flows and error handling — the error capture and retry infrastructure is now solid (see #797, #731, #686), making this a good time to layer in optimistic updates.
Optimistic updates would immediately reflect changes in the local state and roll back on failure, using the existing error toast + retry pattern from #797.
Approval Required
This is a HIGH risk enhancement:
use-database-rows,use-database-properties, anduse-database-viewshooksComment "approved" to release this to the automation queue.
Acceptance Criteria
useAddRowoptimistically inserts a row into the local cache before the Supabase call resolvesuseDeleteRowoptimistically removes the row from the local cacheuseUpdateRowValueoptimistically updates the cell value in the local cacheuseAddPropertyanduseDeletePropertyoptimistically update the property listpnpm lint && pnpm typecheck && pnpm testpassDependencies
None
Technical Notes
src/lib/supabase/use-database-rows.ts,use-database-properties.ts,use-database-views.ts.useOptimisticor a manual pattern withuseState+ rollback callback.toast.errorwith an action button that re-invokes the mutation..agents/conventions.mdfor the Supabase mutation patterns.