Skip to content

Conversation

@aaronjeline
Copy link
Contributor

Deleting taskspaces caused main UI thread to hang. This makes a bunch of stuff in that flow async, preventing this issue.

  • Made deleteTaskspace function async to prevent blocking main thread
  • Added executeProcessAsync() that runs git commands in detached tasks
  • Now waitUntilExit() runs off main thread completely
  • Wrapped git operations (worktree removal, branch deletion) in background task
  • Updated UI calls to use MainActor for thread-safe state updates
  • Prevents app hanging during delete operations
  • Replaced computed branchInfo property with cached state
  • Load branch info asynchronously on dialog appear
  • Prevents multiple git commands on every UI refresh

amzn-aeline and others added 3 commits October 3, 2025 14:47
- Made deleteTaskspace function async to prevent blocking main thread
- Wrapped git operations (worktree removal, branch deletion) in background task
- Updated UI calls to use MainActor for thread-safe state updates
- Prevents app hanging during delete operations

Co-authored-by: Claude <claude@anthropic.com>
- Added executeProcessAsync() that runs git commands in detached tasks
- Replaced synchronous executeProcess calls in deleteTaskspace
- Now waitUntilExit() runs off main thread completely
- Further improves UI responsiveness during delete operations

Co-authored-by: Claude <claude@anthropic.com>
- Replaced computed branchInfo property with cached state
- Load branch info asynchronously on dialog appear
- Prevents multiple git commands on every UI refresh
- Eliminates lag when clicking delete branch checkbox

Co-authored-by: Claude <claude@anthropic.com>
@aaronjeline aaronjeline force-pushed the fix/ui-delete-performance branch from 7f8c361 to fe291f9 Compare October 3, 2025 19:17
@aaronjeline aaronjeline closed this Oct 3, 2025
@aaronjeline aaronjeline reopened this Oct 3, 2025
@aaronjeline
Copy link
Contributor Author

I've added a cache for the git info, but it's only while the dialog is live, not the entire application window.

@aaronjeline aaronjeline marked this pull request as ready for review October 3, 2025 19:28
- Shows progress spinner and 'Checking branch status...' text
- Improves UX by indicating async operation in progress
- Hides loading state once branch info is cached

Co-authored-by: Claude <claude@anthropic.com>
@aaronjeline aaronjeline force-pushed the fix/ui-delete-performance branch from fe291f9 to 41cb416 Compare October 3, 2025 19:30
Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I had noticed that UI is very slow but hadn't read carefully into it.

}.value

// Set default deleteBranch toggle based on safety analysis
deleteBranch = (cachedBranchInfo.unmergedCommits == 0 && !cachedBranchInfo.hasUncommittedChanges)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what happens is that, initially, the cached branch name is empty, so the user sees no checkbox at all, but then it appears some time later once the git command has completed? I think it'd be nice if we displayed a message like "...determining github branch information..." to keep them up-to-date.

.multilineTextAlignment(.center)

if !cachedBranchInfo.branchName.isEmpty {
if isLoadingBranchInfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...lol, I guess you anticipated my request...

@nikomatsakis nikomatsakis merged commit a78c131 into symposium-dev:main Oct 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants