refactor: simplify PackInstallButton isInstalling state management

- Remove isInstalling prop from PackInstallButton component
- Use internal computed property with comfyManagerStore.isPackInstalling()
- Remove redundant isInstalling computations from parent components
- Fix test mocks for useConflictDetection and es-toolkit/compat
- Clean up unused imports and inject dependencies

This centralizes the installation state management in the store,
reducing code duplication and complexity across components.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jin Yi
2025-08-27 23:00:42 +09:00
parent a5153cd4b9
commit 267e07e26d
8 changed files with 23 additions and 51 deletions

View File

@@ -21,6 +21,12 @@ vi.mock('@/stores/dialogStore')
vi.mock('@/stores/settingStore')
vi.mock('@/stores/commandStore')
vi.mock('@/services/comfyManagerService')
vi.mock('@/composables/useConflictDetection', () => ({
useConflictDetection: vi.fn(() => ({
conflictedPackages: { value: [] },
performConflictDetection: vi.fn().mockResolvedValue(undefined)
}))
}))
// Mock useEventListener to capture the event handler
let reconnectHandler: (() => void) | null = null