Files
TX/artifacts/tx-os
riyadhafraa 85105faf16 tx-os #317: optimistic-cache saves for all inline editors
Extends the optimistic React Query cache pattern (proven in #316 for the
schedule time cell) to every other inline editor on executive-meetings.tsx,
fixing the "تأخير في الاستجابة وأحياناً ما يحفظ" regression where typed
edits felt sluggish or appeared to silently drop.

executive-meetings.tsx
  * New `applyMeetingPatch(meetingId, patch)` helper: snapshots the day's
    DayResponse, applies a per-meeting patch via setQueryData, and returns
    a rollback closure that re-sets the snapshot on PATCH failure.
  * `saveTitle`, `saveAttendeeName`, `saveMerge`, and `setRowColor` now
    write the optimistic value before awaiting the network call and
    rollback() in their catch branches. Re-throw behaviour preserved
    where present so EditableCell still resets its draft on failure.

editable-cell.tsx
  * Hardened blur-commit: the cell now stashes the latest `saveEdit`
    in a ref and an unmount cleanup flushes any pending blurTimerRef
    fire-and-forget. Without this, a row remount that lands during the
    100 ms blur window (e.g. Tab into the next cell triggering an
    optimistic refetch) tore down the editor before saveEdit could run
    and silently dropped the typed change. Optimistic cache writes in
    the parent make the fire-and-forget safe.

tests/executive-meetings-keyboard-editing.spec.mjs (+3 tests)
  * Title repaint <300 ms with PATCH delayed 1500 ms.
  * Title PATCH 500 rolls back to original; DB unchanged.
  * Attendee-name PUT delayed 1500 ms repaints in <300 ms (uses
    captured testid so the locator survives the rename).

Architect review: APPROVED, no concerns. All 3 new + 3 #316 time-editor
tests green. Out-of-scope pre-existing failures in the `test` workflow
(notifications/postpone-race/row-color) untouched per plan.
2026-05-03 07:31:28 +00:00
..