Task and attempt relationships (#1083)
* Display parent task attempt (vibe-kanban 13d990e8) If there is a parent task attempt, display a box with summary info about it and allow the user to navigate to that frontend/src/components/panels/TaskPanel.tsx * If parent task attempt, show icon in kanban card (vibe-kanban 806790be) If task has a parent task attempt, it should be visible and also easy to navigate to the parent from the kanban card Let's place an arrow-up icon to the left of the burger menu icon, when there is a parent task attempt. Clicking this should navigate to the task attempt frontend/src/components/tasks/TaskKanbanBoard.tsx * Popup to view related tasks for the task attempt (vibe-kanban b77eeb33) frontend/src/components/panels/AttemptHeaderActions.tsx Should be possible to view tasks that have parent_task_attempt set to this task. Similar to frontend/src/components/dialogs/tasks/ViewProcessesDialog.tsx * i18n * Improve related tasks (vibe-kanban) (#1166) * Excellent! All checks are passing. Let me create a quick summary of what was changed: ## Summary I've successfully fixed the related tasks list to show both parent and child tasks. Here's what was changed: ### Changes Made 1. **`frontend/src/hooks/useTaskChildren.ts`** - Renamed `useTaskChildren` to `useTaskRelationships` (kept old export for backwards compatibility) - Changed return type from `Task[]` to `TaskRelationships` - Now returns the full relationships object including `parent_task`, `current_attempt`, and `children` - Updated query keys from `taskChildren` to `taskRelationships` 2. **`frontend/src/components/dialogs/tasks/ViewRelatedTasksDialog.tsx`** - Updated to use `useTaskRelationships` hook - Combines parent and children into a single `relatedTasks` array - Now displays both parent and child tasks in the dialog 3. **`frontend/src/hooks/useTaskMutations.ts`** - Updated imports to use `taskRelationshipsKeys` - Updated cache invalidation comments to reflect "relationships" instead of "children" ### How It Works The backend endpoint `/api/task-attempts/:id/children` already returns the full `TaskRelationships` object containing: - `parent_task: Option<Task>` - The parent task (if any) - `current_attempt: TaskAttempt` - The current attempt being viewed - `children: Vec<Task>` - Child tasks created by this attempt The hook now correctly exposes this full object, allowing the UI to display both parent and child tasks as "related tasks". All TypeScript types check, linting passes, and formatting is correct! * Perfect! All tasks are complete. Let me create a summary of the final changes: ## Summary I've successfully fixed the related tasks feature to show both parent and child tasks. Here are the final changes: ### Changes Made 1. **Renamed `frontend/src/hooks/useTaskChildren.ts` → `frontend/src/hooks/useTaskRelationships.ts`** - Removed all backwards compatibility aliases - Changed return type from `Task[]` to `TaskRelationships` - Returns the full relationships object including `parent_task`, `current_attempt`, and `children` - Updated query keys from `taskChildren` to `taskRelationships` 2. **Updated `frontend/src/components/dialogs/tasks/ViewRelatedTasksDialog.tsx`** - Updated import to use `useTaskRelationships` from the renamed file - Combines parent and children into a single `relatedTasks` array - Now displays both parent and child tasks in the dialog 3. **Updated `frontend/src/hooks/useTaskMutations.ts`** - Updated import path to `@/hooks/useTaskRelationships` - Uses `taskRelationshipsKeys` for cache invalidation ### How It Works The backend endpoint `/api/task-attempts/:id/children` returns a `TaskRelationships` object containing: - `parent_task: Option<Task>` - The parent task (if exists) - `current_attempt: TaskAttempt` - The current attempt being viewed - `children: Vec<Task>` - Child tasks created by this attempt The hook now correctly returns this full object, allowing the UI to display both parent and children as "related tasks" in the ViewRelatedTasksDialog. All checks pass: - ✅ TypeScript compilation - ✅ ESLint (101 pre-existing warnings, no new ones) - ✅ Prettier formatting * Excellent! The change is complete and passes linting. ## Summary I've updated the navigation behavior for related tasks. When clicking on a related task (parent or child) from the ViewRelatedTasksDialog, the app now navigates to `/attempts/latest` instead of just the task page. This ensures users are taken directly to the latest task attempt, which is the expected behavior throughout the application. **Changed file:** - `frontend/src/components/ui/ActionsDropdown.tsx:80` - Updated navigation URL to include `/attempts/latest` --------- Co-authored-by: Alex Netsch <alex@bloop.ai>
This commit is contained in:
committed by
GitHub
parent
99f7d9a4bc
commit
103f55621c
@@ -238,14 +238,27 @@
|
||||
"viewProcessesDialog": {
|
||||
"title": "Execution processes"
|
||||
},
|
||||
"viewRelatedTasksDialog": {
|
||||
"title": "Related tasks",
|
||||
"empty": "No related tasks for this attempt",
|
||||
"error": "Failed to load related tasks",
|
||||
"tasksCount": "Tasks ({{count}})",
|
||||
"columns": {
|
||||
"title": "Title",
|
||||
"description": "Description",
|
||||
"status": "Status"
|
||||
}
|
||||
},
|
||||
"attemptHeaderActions": {
|
||||
"preview": "Preview",
|
||||
"diffs": "Diffs"
|
||||
"diffs": "Diffs",
|
||||
"relatedTasks": "Related tasks"
|
||||
},
|
||||
"actionsMenu": {
|
||||
"attempt": "Attempt",
|
||||
"openInIde": "Open attempt in IDE",
|
||||
"viewProcesses": "View processes",
|
||||
"viewRelatedTasks": "View related tasks",
|
||||
"createNewAttempt": "Create new attempt",
|
||||
"createSubtask": "Create subtask",
|
||||
"gitActions": "Git actions",
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"gitActions": "Acciones de Git",
|
||||
"openInIde": "Open attempt in IDE",
|
||||
"task": "Task",
|
||||
"viewProcesses": "View processes"
|
||||
"viewProcesses": "View processes",
|
||||
"viewRelatedTasks": "View related tasks"
|
||||
},
|
||||
"attempt": {
|
||||
"actions": {
|
||||
@@ -48,7 +49,8 @@
|
||||
},
|
||||
"attemptHeaderActions": {
|
||||
"diffs": "Diffs",
|
||||
"preview": "Preview"
|
||||
"preview": "Preview",
|
||||
"relatedTasks": "Related tasks"
|
||||
},
|
||||
"branches": {
|
||||
"changeTarget": {
|
||||
@@ -252,6 +254,17 @@
|
||||
"viewProcessesDialog": {
|
||||
"title": "Execution processes"
|
||||
},
|
||||
"viewRelatedTasksDialog": {
|
||||
"title": "Related tasks",
|
||||
"empty": "No related tasks for this attempt",
|
||||
"error": "Failed to load related tasks",
|
||||
"tasksCount": "Tasks ({{count}})",
|
||||
"columns": {
|
||||
"title": "Title",
|
||||
"description": "Description",
|
||||
"status": "Status"
|
||||
}
|
||||
},
|
||||
"showcases": {
|
||||
"taskPanel": {
|
||||
"companion": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"gitActions": "Gitアクション",
|
||||
"openInIde": "Open attempt in IDE",
|
||||
"task": "Task",
|
||||
"viewProcesses": "View processes"
|
||||
"viewProcesses": "View processes",
|
||||
"viewRelatedTasks": "View related tasks"
|
||||
},
|
||||
"attempt": {
|
||||
"actions": {
|
||||
@@ -48,7 +49,8 @@
|
||||
},
|
||||
"attemptHeaderActions": {
|
||||
"diffs": "Diffs",
|
||||
"preview": "Preview"
|
||||
"preview": "Preview",
|
||||
"relatedTasks": "Related tasks"
|
||||
},
|
||||
"branches": {
|
||||
"changeTarget": {
|
||||
@@ -252,6 +254,17 @@
|
||||
"viewProcessesDialog": {
|
||||
"title": "Execution processes"
|
||||
},
|
||||
"viewRelatedTasksDialog": {
|
||||
"title": "Related tasks",
|
||||
"empty": "No related tasks for this attempt",
|
||||
"error": "Failed to load related tasks",
|
||||
"tasksCount": "Tasks ({{count}})",
|
||||
"columns": {
|
||||
"title": "Title",
|
||||
"description": "Description",
|
||||
"status": "Status"
|
||||
}
|
||||
},
|
||||
"showcases": {
|
||||
"taskPanel": {
|
||||
"companion": {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"gitActions": "Git 작업",
|
||||
"openInIde": "Open attempt in IDE",
|
||||
"task": "Task",
|
||||
"viewProcesses": "View processes"
|
||||
"viewProcesses": "View processes",
|
||||
"viewRelatedTasks": "View related tasks"
|
||||
},
|
||||
"attempt": {
|
||||
"actions": {
|
||||
@@ -48,7 +49,8 @@
|
||||
},
|
||||
"attemptHeaderActions": {
|
||||
"diffs": "Diffs",
|
||||
"preview": "Preview"
|
||||
"preview": "Preview",
|
||||
"relatedTasks": "Related tasks"
|
||||
},
|
||||
"branches": {
|
||||
"changeTarget": {
|
||||
@@ -252,6 +254,17 @@
|
||||
"viewProcessesDialog": {
|
||||
"title": "Execution processes"
|
||||
},
|
||||
"viewRelatedTasksDialog": {
|
||||
"title": "Related tasks",
|
||||
"empty": "No related tasks for this attempt",
|
||||
"error": "Failed to load related tasks",
|
||||
"tasksCount": "Tasks ({{count}})",
|
||||
"columns": {
|
||||
"title": "Title",
|
||||
"description": "Description",
|
||||
"status": "Status"
|
||||
}
|
||||
},
|
||||
"showcases": {
|
||||
"taskPanel": {
|
||||
"companion": {
|
||||
|
||||
Reference in New Issue
Block a user