ubiquitous-invention/plans/Plan-agent-coordination/Epic-task-as-runnable-unit/Task-workflow-prompt-task-detail-ui.md

51 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

---
kind: task
slug: workflow-prompt-task-detail-ui
title: Backlog-item detail panel — render and edit workflow_prompt
plan_slug: agent-coordination
epic_slug: task-as-runnable-unit
status: draft
priority: P2
tenant_id: global
owner: unassigned
cursor_todo_id: null
updated_at: "2026-06-02"
---
# Task summary
The data layer for per-item workflow prompts shipped in `Task-add-workflow-prompt-to-backlog-items`. This task adds the UI surface that uses it.
Deferred from the parent task because `apps/web` does not yet have a backlog-item detail panel — `apps/web/components/panels/object-detail.tsx` is for the `objects` table, not `markdown_backlog_items`. Adding a new panel surface (state, edit affordance, draft handling) is a substantive UI task on its own.
## Description
Add a "Workflow prompt" section to wherever a single backlog item is rendered for read/edit. Likely surfaces:
1. A dedicated route like `/[workspaceSlug]/plans/[planSlug]/[epicSlug]/[taskSlug]` if a Plans browser ever exists.
2. A drawer or sheet opened from the Plans tree (if/when that ships).
3. The agent runs view (`/settings/runs`) — click a run to expand task context including the effective prompt.
For v1 of THIS task, pick the smallest surface that lets an operator actually use the data:
- **Effective prompt** — read-only display from `api.backlog.getWorkflowPrompt({ backlogItemId })`. Show the source level as a small badge ("From this task" / "Inherited from epic: X" / "Inherited from plan: Y" / "Built-in default").
- **Override** — a textarea bound to `ownOverride`. Empty = inherit. Save calls `api.backlog.updateWorkflowPrompt`.
## Subtasks
- [ ] Decide on the rendering surface (see options above).
- [ ] Build the section component with effective-prompt preview + override textarea.
- [ ] Owner/admin gate matches the procedure (the procedure refuses non-managers, but the UI should hide the save button rather than let the click fail).
- [ ] Show "clear override" affordance when an override is set.
## Acceptance criteria
- [ ] Saving an override flips the source badge to "From this task."
- [ ] Clearing an override re-shows the inherited source.
- [ ] Non-managers see the prompt but cannot edit it.
## Links
- Parent: `./Task-add-workflow-prompt-to-backlog-items.md`
- Epic: `./Epic-task-as-runnable-unit.md`