fix(terminal): refine workflow summary layout#224
Conversation
📝 WalkthroughWalkthroughAdds bulk workflow-agent task retrieval and exposes it through the workflow service. Introduces a terminal workflows panel with progress details, navigation, inline summary expansion, cancellation, refresh handling, slash-command access, and expanded test coverage. ChangesWorkflow data access
Terminal workflow experience
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TerminalApp
participant WorkflowService
participant WorkflowRepository
User->>TerminalApp: Run /workflows
TerminalApp->>WorkflowService: Load workflow runs
WorkflowService->>WorkflowRepository: Load linked agent task details
WorkflowRepository-->>WorkflowService: Return workflow/task details
WorkflowService-->>TerminalApp: Return workflow data
TerminalApp-->>User: Render workflow panel
User->>TerminalApp: Select run or press Ctrl+C
TerminalApp->>WorkflowService: Open detail or cancel workflow
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
- Coverage 84.83% 84.72% -0.11%
==========================================
Files 313 314 +1
Lines 28745 29106 +361
==========================================
+ Hits 24386 24661 +275
- Misses 2995 3051 +56
- Partials 1364 1394 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
internal/database/workflow_repository_test.go (1)
81-127: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer table-driven retrieval scenarios.
Represent the populated and empty-input cases as named test cases so future ordering, missing-link, and multi-step regressions can be added consistently.
As per coding guidelines, prefer table-driven tests for core behavior.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/database/workflow_repository_test.go` around lines 81 - 127, Refactor TestWorkflowRepositoryListAgentTaskDetails into named table-driven cases covering the populated and nil-input scenarios. Move each case’s setup, ListAgentTaskDetails invocation, and assertions into the table-driven test flow, preserving current expectations and leaving room for future ordering, missing-link, and multi-step cases.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/terminal/agent_task_summary.go`:
- Around line 38-56: Guard the confirm handling in the agentTaskSummaryFocused
flow so it does not select an active workflow when workflowSummaryRunID is
already set. Update the branch around selectedAgentTaskSummaryTaskID and the
activeWorkflows index check to require the collapsed state before assigning
workflowSummaryRunID, while preserving normal confirmation behavior when no
workflow is expanded.
In `@internal/terminal/workflow_test_helpers_internal_test.go`:
- Around line 62-65: Add a detailsErr error field to workflowInspectorStub and
update AgentTaskDetails to return stub.detailsErr instead of stub.agentTasksErr,
keeping AgentTasks controlled by its existing error field.
In `@internal/terminal/workflows.go`:
- Around line 55-66: Update refreshWorkflowsPanel’s detail-view branch around
openWorkflowDetail to capture the currently selected detail item before
refreshing and restore that selection after the new panel is created, mirroring
the list-view SelectedValue()/SetSelectedIndex preservation. Ensure the
restoration handles the item no longer existing by retaining the panel’s valid
default selection.
---
Nitpick comments:
In `@internal/database/workflow_repository_test.go`:
- Around line 81-127: Refactor TestWorkflowRepositoryListAgentTaskDetails into
named table-driven cases covering the populated and nil-input scenarios. Move
each case’s setup, ListAgentTaskDetails invocation, and assertions into the
table-driven test flow, preserving current expectations and leaving room for
future ordering, missing-link, and multi-step cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d5f8cd34-bb1e-4f6e-8920-444e9deb92b7
📒 Files selected for processing (19)
internal/database/agent_task_repository.gointernal/database/workflow_repository.gointernal/database/workflow_repository_test.gointernal/terminal/agent_task_summary.gointernal/terminal/agent_tasks.gointernal/terminal/agent_tasks_behavior_internal_test.gointernal/terminal/app.gointernal/terminal/autocomplete.gointernal/terminal/autocomplete_internal_test.gointernal/terminal/commands.gointernal/terminal/input.gointernal/terminal/panel_actions.gointernal/terminal/transcript_list_internal_test.gointernal/terminal/workflow_summary_internal_test.gointernal/terminal/workflow_test_helpers_internal_test.gointernal/terminal/workflows.gointernal/terminal/workflows_internal_test.gointernal/workflow/service.gointernal/workflow/service_internal_test.go
4a99afa to
8205da4
Compare
|



Summary
Validation