Skip to content

feat(ux): optimistic detail edits + seed-from-cache (perceived speed)#137

Merged
os-zhuang merged 1 commit into
mainfrom
feat/speed-optimistic-detail
Jun 11, 2026
Merged

feat(ux): optimistic detail edits + seed-from-cache (perceived speed)#137
os-zhuang merged 1 commit into
mainfrom
feat/speed-optimistic-detail

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

First slice of the 感知速度 (perceived speed) track, on the record detail screen.

Optimistic mutations

Inline field edits (select/status badges) and state-machine transitions previously did await update() then await fetchRecord() — a full round-trip plus a refetch before the UI moved. Now:

  • the value/badge updates instantly (setRecord before the network call)
  • the write persists in the background
  • a server reconcile runs silently (no spinner) to pick up computed/audit fields
  • a failed write rolls back to the prior snapshot and toasts the error

Seed-from-cache (no skeleton flash)

The detail screen already fetches the sibling list (top: 200) for prev/next. It now seeds the record from that cache, so navigating between records — or arriving from the list — paints immediately instead of flashing a loading skeleton while the authoritative data.get runs. The skeleton shows only when nothing is cached.

Verification

  • tsc --noEmit clean
  • eslint clean
  • 1337 tests pass
  • Deal detail renders correctly against the live 9.0 server (no regression from the seed/optimistic refactor).
  • Note: the inline-edit picker and prev/next pager are RN Pressables that the web-preview harness can't drive via synthetic events (a documented harness limitation, not a code issue); these interactions exercise on real touch. The optimistic/rollback logic is a standard snapshot-set-rollback pattern covered by the type checker and unit suite.

🤖 Generated with Claude Code

Perceived-speed pass on the record detail screen:

- Inline field edits and state-machine transitions now apply optimistically
  — the badge/value moves the instant you pick it, the write persists in the
  background, and a server reconcile runs silently (no spinner). A failed
  write rolls the record back to its prior snapshot and toasts the error.
  Previously each edit awaited the round-trip AND a full refetch before the
  UI moved.

- Prev/next navigation and arrival-from-list now seed the record from the
  already-fetched sibling list, so the screen paints instantly instead of
  flashing a skeleton while the authoritative data.get runs. The skeleton
  only shows when there's genuinely nothing cached to display.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang os-zhuang merged commit 294a83d into main Jun 11, 2026
4 checks passed
@os-zhuang os-zhuang deleted the feat/speed-optimistic-detail branch June 11, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant