-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Implement hierarchical task history with parent-child relationships #3689
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
base: main
Are you sure you want to change the base?
Conversation
…hips This change adds support for tracking parent-child relationships between tasks in the task history, particularly for tasks created using the new_task tool. Key changes: - Add parent_task_id field to HistoryItem schema - Modify Task class to store parent task ID - Update taskMetadata to include parent task ID in history items - Enhance History UI components to display hierarchical relationships - Add visual indicators for tasks with children - Add green styling for completed tasks Fixes: cline#3688 Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
|
Implement hierarchical display for tasks in the history view, allowing parent tasks to be expanded to show child tasks. - Add `parent_task_id` to `HistoryItem` schema to establish parent-child relationships. - Update frontend to render tasks hierarchically, with child tasks indented and collapsible under their parents. Introduce a `completed` status for tasks: - Add `completed` boolean flag to `HistoryItem` schema. - Backend logic in `Task.ts` now sets `completed: true` when an `attempt_completion` is processed (e.g., `ask: "completion_result"` or `say: "completion_result"` messages) and `completed: false` if new messages are added to a completed task. - Frontend history view now displays completed tasks with a distinct text color (`var(--vscode-testing-iconPassed)`). Enhance UI for child tasks in history: - Child task entries are now more compact, with reduced padding. - Token and cost information is omitted for child tasks to save space. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
- Modifies task saving logic to prioritize an existing `parent_task_id` from storage, preventing it from being overwritten. A new `parent_task_id` is set only if none exists in the stored `HistoryItem`. - Resolves an issue where new tasks were not appearing in history. The `getTaskWithId` method would throw a "Task not found" error for new tasks, halting the save process. This error is now handled gracefully, allowing new tasks to be correctly added to history. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit introduces several enhancements to the task history UI: - Refactored the task item display into a reusable `TaskItemHeader` component for consistent rendering of task metadata and action buttons. - Standardized the appearance of action icons (Copy, Export, Delete, Expand/Collapse All) for size, color, and opacity. - Implemented a toggle button (`codicon-list-tree`) to recursively expand and collapse all child tasks within a parent task. - Adjusted spacing and layout for a more compact and visually consistent header. - Ensured task size (using `prettyBytes`) is displayed for all tasks in the header. - Removed parentheses from metadata displays (tokens, cost, cache) for a cleaner look. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit implements several key improvements to the task history view: - Hoisted task item expansion state (`expandedItems`, `bulkExpandedRootItems`) and control logic into the `useTaskSearch` hook. This resolves issues with `react-virtuoso` where item expansion state was lost upon scrolling and unmounting/remounting of virtualized items. - `TaskDisplayItem` now receives its expansion state and toggle handlers as props, simplifying its internal logic. - Refactored the task item display into a reusable `TaskItemHeader` component for consistent rendering of task metadata and action buttons. - Standardized the appearance of action icons (Copy, Export, Delete, Expand/Collapse All) for size, color, and opacity. - Implemented a toggle button (`codicon-list-tree`) to recursively expand and collapse all child tasks within a parent task, with state managed by the hoisted logic. - Adjusted spacing and layout for a more compact and visually consistent header. - Ensured task size (using `prettyBytes`) is displayed for all tasks. - Removed parentheses from metadata displays (tokens, cost, cache). - Corrected ESLint `exhaustive-deps` warnings in `useTaskSearch`. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Adjusted padding and margins in the HistoryView component to create a more compact display of task items. - Standardized vertical padding for all task items. - Minimized space between task headers and their content. - Removed extraneous padding within the task item header. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
- Increased horizontal gap between metadata items in the task header. - Set action buttons in the task header to 50% opacity, transitioning to 100% on hover. - Updated CopyButton and ExportButton components to accept and apply a className prop, resolving TypeScript errors. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
4e5d3d2
to
5a9e4b5
Compare
When a task is deleted, ensure its child tasks are correctly reparented to the deleted task's own parent. This change also consolidates the task history update into a single operation. This addresses an issue where the UI update for reparenting and deletion could appear delayed by ensuring all modifications to the task list are processed together before the UI is refreshed. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
When a parent task in the history view is bulk-expanded, newly added child tasks will now automatically inherit this expanded state. This ensures that the visibility of new sub-tasks aligns with the user's current view settings for the parent, providing a more consistent and intuitive user experience when navigating hierarchical task histories. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Refactors state update logic to ensure that when task history is modified (e.g., a new task is created or status changes), all active ClineProvider instances (sidebar and editor tabs) receive the updated state and refresh their UI. The `postStateToWebview()` call is removed from `Task.addToClineMessages()` and is now handled within `ClineProvider.updateTaskHistory()`, which iterates over all active instances to broadcast the new state. This guarantees timely UI updates across all open views. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
…ively When a new child task (or any of its descendants) is added to the history view, its initial expansion state will now correctly respect the 'bulk-expanded' status of its parent or any higher ancestor. If an ancestor is bulk-expanded, the new task and its own children will also be expanded automatically. This ensures a consistent and intuitive user experience when navigating hierarchical task histories, particularly when new sub-tasks are created under an already expanded parent tree. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Context
This PR implements a hierarchical task history feature that tracks parent-child relationships between tasks, particularly for tasks created using the
new_task
tool.Implementation
parent_task_id
field toHistoryItem
schemaTask
class to store parent task IDtaskMetadata
to include parent task ID in history itemsattempt_completion
)Screenshots
In the history UI in the right, green means it completed, gray means in-progress, or it had completed and I said something to the model there, and it will turn green again upon
<attempt_completion>
. This PR allows you to watch the completion status live in a second Roo instance:How to Test
It generates a tree:
See also
#1123
Get in Touch
Discord: KJ7LNW