fix(app): optimistic UI updates for session archive, delete, rename, and question reply#27913
Open
BYK wants to merge 1 commit into
Open
fix(app): optimistic UI updates for session archive, delete, rename, and question reply#27913BYK wants to merge 1 commit into
BYK wants to merge 1 commit into
Conversation
…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.
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.
Issue for this PR
Closes #27911
Type of change
What does this PR do?
Makes session management operations feel instant by updating the UI optimistically:
onMutateand restores the previous title on error.mutateAsynctomutate(fire-and-forget), sinceonMutatealready dismisses the dock.All rollback paths restore the exact previous state using
Binary.searchfor 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