fix(ui): improve React Query hooks and fix edge cases

- Update query keys to include all relevant parameters (branches, agents)
- Fix use-branches to pass includeRemote parameter to query key
- Fix use-settings to include sources in agents query key
- Update running-agents-view to use correct query key structure
- Update use-spec-loading to properly use spec query hooks
- Add missing queryClient invalidation in auto-mode mutations
- Add missing cache invalidation in spec mutations after creation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-15 19:11:25 +01:00
parent 3170e22383
commit 361cb06bf0
11 changed files with 57 additions and 25 deletions

View File

@@ -34,8 +34,8 @@ export function RunningAgentsView() {
}, [refetch]);
const handleStopAgent = useCallback(
(featureId: string) => {
stopFeature.mutate(featureId);
(featureId: string, projectPath: string) => {
stopFeature.mutate({ featureId, projectPath });
},
[stopFeature]
);
@@ -168,7 +168,7 @@ export function RunningAgentsView() {
<Button
variant="destructive"
size="sm"
onClick={() => handleStopAgent(agent.featureId)}
onClick={() => handleStopAgent(agent.featureId, agent.projectPath)}
disabled={stopFeature.isPending}
>
<Square className="h-3.5 w-3.5 mr-1.5" />