feat(ux): optimistic detail edits + seed-from-cache (perceived speed)#137
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()thenawait fetchRecord()— a full round-trip plus a refetch before the UI moved. Now:setRecordbefore the network call)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 authoritativedata.getruns. The skeleton shows only when nothing is cached.Verification
tsc --noEmitcleaneslintcleanPressables 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