Skip to content

Fix shutdown clearing active worktree/tab from wrong layer#44

Merged
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/shutdown-delete-issue
Mar 23, 2026
Merged

Fix shutdown clearing active worktree/tab from wrong layer#44
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/shutdown-delete-issue

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • Move activeWorktreeId/activeTabId clearing out of shutdownWorktreeTerminals (a terminal-focused store action) into the UI component (WorktreeContextMenu) that triggers shutdown
  • The delete flow already handles clearing active state independently in worktrees.ts, so the store action was doing double duty incorrectly
  • Remove unused tabIds variable from shutdownWorktreeTerminals
  • Fix pre-existing lint issues in both files (interface→type, curly braces, prefer-ternary, prefer-at)
  • Extract terminal helper functions to terminal-helpers.ts to stay under max-lines limit

Test plan

  • Shutdown a worktree via context menu → verify active worktree is cleared
  • Shutdown a non-active worktree → verify active worktree is unchanged
  • Delete a worktree → verify active state is still cleared correctly
  • Verify no regressions in terminal tab management

🤖 Generated with Claude Code

Move activeWorktreeId/activeTabId clearing out of shutdownWorktreeTerminals
(a terminal-focused store action) and into the UI component that triggers
shutdown. The delete flow already handles this independently in worktrees.ts.

Also fix pre-existing lint issues and extract terminal helpers to separate file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AmethystLiang AmethystLiang merged commit 415ae35 into main Mar 23, 2026
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.

1 participant