Fix/scenarios list refresh - #8
Open
92Infinitus92 wants to merge 4 commits into
Open
Conversation
Dispatch scenarioUpdated only after the PATCH resolves, defer the list refresh while the editor pane is open, and flush it once on close. Show the full-screen loader only on the first load so create and post-edit refreshes update the list in the background instead of blanking the page.
Optimistically remove a scenario card on delete and restore it on failure, and surface a small notice when a background refresh fails so the list is not silently stale. Adds tests for the refresh state machine.
…olls back Roll back optimistic delete and update against the current list via functional state updates, so a create or delete that lands mid-request survives the rollback instead of being clobbered by a stale snapshot. Adds unit tests for the reinsert helper.
92Infinitus92
force-pushed
the
fix/scenarios-list-refresh
branch
from
August 14, 2026 21:52
13546c4 to
9f11e5f
Compare
Collaborator
Author
There was a problem hiding this comment.
92Infinitus92 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
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.
Greptile Summary
The PR adds background scenario-list refreshes, immediate optimistic deletion, concurrency-aware list operations, and visible retryable refresh errors.
Confidence Score: 4/5
The PR is not yet safe to merge because failed deletion can still replace a concurrently updated scenario with its stale pre-delete snapshot.
The rollback helper preserves a newer scenario only if that ID is already present locally; while the detail pane is open, update-triggered refreshes are deferred, so a failed DELETE can reinsert the captured stale object before the newer server state reaches the list.
Files Needing Attention: apps/studio/src/components/svm/scenarios-bento.tsx, apps/studio/src/lib/scenarios-list-ops.ts
Important Files Changed
Sequence Diagram
sequenceDiagram participant Editor participant Page participant List participant API Editor->>API: PATCH scenario List->>List: Optimistically remove scenario List->>API: DELETE scenario API-->>Editor: PATCH succeeds Editor->>Page: scenarioUpdated Page->>Page: Defer refresh while pane is open API-->>List: DELETE fails List->>List: Reinsert captured pre-delete snapshot Note over List: Newer server fields remain absent until a successful refreshReviews (2): Last reviewed commit: "test(studio): preserve refreshed scenari..." | Re-trigger Greptile