Skip to content

fix(app): optimistic UI updates for session archive, delete, rename, and question reply#27913

Open
BYK wants to merge 1 commit into
anomalyco:devfrom
BYK:fix/optimistic-ui-updates
Open

fix(app): optimistic UI updates for session archive, delete, rename, and question reply#27913
BYK wants to merge 1 commit into
anomalyco:devfrom
BYK:fix/optimistic-ui-updates

Conversation

@BYK
Copy link
Copy Markdown
Contributor

@BYK BYK commented May 16, 2026

Issue for this PR

Closes #27911

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Makes session management operations feel instant by updating the UI optimistically:

  • Session archive: immediately removes from sidebar and navigates away. On API error, re-inserts the session at its sorted position.
  • Session delete: immediately removes the session and its children from the sidebar. On API error, re-inserts all removed sessions.
  • Session rename: updates the title via onMutate and restores the previous title on error.
  • Question reply/reject: switches from mutateAsync to mutate (fire-and-forget), since onMutate already dismisses the dock.

All rollback paths restore the exact previous state using Binary.search for correct sorted insertion.

How did you verify your code works?

Tested locally by archiving, deleting, and renaming sessions in the web UI. Verified the sidebar updates immediately. Simulated API errors to verify rollback behavior re-inserts sessions correctly.

Screenshots / recordings

N/A — latency improvement, no visual changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…and question reply

Session archive/delete: immediately remove from sidebar and navigate,
rollback on API error by re-inserting at sorted position.
Session rename: update title in onMutate, restore previous on error.
Question reply/reject: fire-and-forget (onMutate already dismisses dock).

These changes eliminate perceived latency on all session management
operations by updating the UI optimistically and rolling back on failure.
@BYK BYK requested a review from adamdotdevin as a code owner May 16, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session archive, delete, rename, and question reply block on API response

1 participant