-
Notifications
You must be signed in to change notification settings - Fork 975
Task and attempt relationships #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
stunningpixels
commented
Oct 22, 2025
- View parent tasks, related to a task attempt
- In kanban identify tasks which have a parent attempt
- On task panel view parent task attempt
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 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
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
d659269 to
3e33c5f
Compare
* 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`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.