Fix UI freezes with large workspaces - #536
Merged
Merged
Conversation
gschier
commented
Aug 14, 2026
Member
- Batch `model_write` events into a single `model_writes` event per poller drain — importing 3000+ requests no longer freezes the app afterward
- Bulk-delete workspace children with one statement per table, emitting a single workspace delete event; the model store prunes the subtree (documented on `ModelChangeEvent`)
- Run `models_delete` off the main thread
- Only auto-select newly created sidebar items for same-window writes (imports no longer move selection)
- Dev-only: spawn `yaaknode` from the source vendored dir — in-place resource copies invalidate the macOS code signature and the runtime dies with SIGKILL
- Add Import Data to the New Workspace menu
Greptile SummaryThe PR batches model-change notifications and moves large deletion work away from the UI thread to prevent freezes in large workspaces. It also makes workspace cascades transactional and adds deferred response-body cleanup.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/yaak-models/src/queries/workspaces.rs | Replaces recursive workspace deletion with an atomic bulk cascade and performs external response-body cleanup only after relational deletion succeeds. |
| crates/yaak-models/src/queries/http_responses.rs | Adds startup garbage collection for blob chunks and response files whose owning response rows no longer exist. |
| crates-tauri/yaak-app-client/src/models_ext.rs | Batches model notifications, runs deletion on a blocking worker, and schedules startup response-body garbage collection. |
| apps/yaak-client/components/Sidebar.tsx | Consumes batched model events and only selects newly created sidebar items originating from the current window. |
| crates/yaak-models/src/client_db.rs | Adds an untracked bulk-delete primitive used where a parent workspace deletion represents the removed subtree. |
Sequence Diagram
sequenceDiagram
participant Caller
participant DB as SQLite model DB
participant Blob as Blob DB / response files
participant UI as Model event consumers
Caller->>DB: SAVEPOINT delete_workspace
Caller->>DB: Bulk-delete workspace children
Caller->>DB: Delete workspace and record parent event
alt relational deletion succeeds
Caller->>DB: RELEASE savepoint
Caller->>Blob: Best-effort response-body cleanup
DB-->>UI: Batched model_writes event
else relational deletion fails
Caller->>DB: ROLLBACK TO and RELEASE savepoint
DB-->>Caller: Return error without body cleanup
end
Note over DB,Blob: Startup GC retries orphaned body cleanup
Reviews (5): Last reviewed commit: "Make workspace delete cascade atomic on ..." | Re-trigger Greptile
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.