From e2fce2ae04d4900a5b04dda0950ed4540d207e2f Mon Sep 17 00:00:00 2001 From: Tevin2119 <48298711+Tevin2119@users.noreply.github.com> Date: Sun, 22 Nov 2026 22:24:48 +0000 Subject: [PATCH 1/9] refactor(web): split the task view's parts and extract the sidebar row shell Step 1 of 5 of opening a board task as its native thread. TaskComposer, DecisionBar, Details (TaskDetails.tsx), Info (TaskInfo.tsx) and RunPanel move out of TaskWorkspace.tsx into files beside it, copied line for line. The time formatter and MobileHelp they share move to taskParts.tsx. TaskWorkspace keeps the log renderer and the wiring. SidebarRowShell holds the sidebar row's look: the surface for active, selected and hover, the slim title line, an optional dot and an indent level. Slim and folder rows render through it and card rows share its surface classes; the rendered rows are the same as before. CouncilSeat reads the engine's seat threadId, and seatConversation opens it in the task's environment when T3 has no child thread for the seat. Co-Authored-By: Claude Opus 5.5 --- .../src/components/delivery/DecisionBar.tsx | 69 + apps/web/src/components/delivery/RunPanel.tsx | 217 +++ .../components/delivery/TaskComposer.test.tsx | 2 +- .../src/components/delivery/TaskComposer.tsx | 366 ++++ .../src/components/delivery/TaskDetails.tsx | 253 +++ apps/web/src/components/delivery/TaskInfo.tsx | 619 +++++++ .../TaskTeamActivity.browser.test.tsx | 1 + .../delivery/TaskTeamActivity.test.tsx | 1 + .../src/components/delivery/TaskWorkspace.tsx | 1523 +---------------- .../web/src/components/delivery/taskParts.tsx | 45 + .../delivery/useTaskConversation.ts | 9 +- .../components/sidebar/SidebarThreadRow.tsx | 388 +++-- apps/web/src/lib/delivery.test.ts | 16 + apps/web/src/lib/delivery.ts | 4 + apps/web/src/lib/taskConversation.test.ts | 11 + apps/web/src/lib/taskConversation.ts | 18 +- 16 files changed, 1855 insertions(+), 1687 deletions(-) create mode 100644 apps/web/src/components/delivery/DecisionBar.tsx create mode 100644 apps/web/src/components/delivery/RunPanel.tsx create mode 100644 apps/web/src/components/delivery/TaskComposer.tsx create mode 100644 apps/web/src/components/delivery/TaskDetails.tsx create mode 100644 apps/web/src/components/delivery/TaskInfo.tsx diff --git a/apps/web/src/components/delivery/DecisionBar.tsx b/apps/web/src/components/delivery/DecisionBar.tsx new file mode 100644 index 0000000000000..f9508b6d5e17e --- /dev/null +++ b/apps/web/src/components/delivery/DecisionBar.tsx @@ -0,0 +1,69 @@ +import type { TaskView } from "../../lib/delivery"; +import { Button } from "../ui/button"; +import { actionHelp, actionLabel } from "./taskActions"; +import { MobileHelp } from "./taskParts"; + +/** + * The decisions a person makes on the task: approve what was tested, send it back with a + * reason, start or submit it. Kept apart from the composer, and below every tab, so that + * what is written is never taken for a decision and the buttons are in reach on a phone. + */ +export function DecisionBar(props: { + readonly task: TaskView; + readonly actions: ReadonlyArray; + readonly busy: boolean; + readonly onAction: (action: string) => void; +}) { + if (props.actions.length === 0) return null; + const deciding = props.actions.some((action) => action === "approve" || action === "reject"); + return ( +
+
+

+ {deciding ? "Your decision" : "What you can do next"} + {deciding ? ( + + {" "} + Messages never count as a decision. + + ) : null} +

+
+ {props.actions.map((action) => ( +
+ + + {actionHelp(action, props.task.card)} + +
+ ))} + + {deciding ?

Messages never count as a decision.

: null} + {props.actions.map((item) => ( +

+ {actionLabel(item, props.task.card)}: + {actionHelp(item, props.task.card)} +

+ ))} +
+
+
+
+ ); +} diff --git a/apps/web/src/components/delivery/RunPanel.tsx b/apps/web/src/components/delivery/RunPanel.tsx new file mode 100644 index 0000000000000..cc7875e1b66f9 --- /dev/null +++ b/apps/web/src/components/delivery/RunPanel.tsx @@ -0,0 +1,217 @@ +import type { EnvironmentId } from "@t3tools/contracts"; +import { useState } from "react"; + +import { repeatKeys, type TaskView } from "../../lib/delivery"; +import { harnessLabel } from "../../lib/deliverySeats"; +import { useDeliveryAct, useDeliveryRead, usePersonName } from "../../state/delivery"; +import ChatMarkdown from "../ChatMarkdown"; +import { Dialog, DialogHeader, DialogPanel, DialogPopup, DialogTitle } from "../ui/dialog"; +import { Button } from "../ui/button"; +import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select"; +import { Textarea } from "../ui/textarea"; + +const DOCUMENT_LABEL: Record = { + "PLAN.md": "Plan", + "REVIEW.md": "Review", + "PACK.md": "Evidence pack", +}; + +/** + * The run under way, for a person following it: the documents it wrote, to read here or have + * summarised, the instructions given to it, and a way to give one. An instruction reaches the + * seat at work it is for, which starts its step again with it; what is asked is changed by a + * change, which goes through triage, not here. + */ +export function RunPanel(props: { + readonly environmentId: EnvironmentId | null; + readonly task: TaskView; + readonly onChanged: () => void; +}) { + const { task } = props; + const council = task.council; + const person = usePersonName(); + const act = useDeliveryAct(props.environmentId, "run"); + const [reading, setReading] = useState(null); + const [text, setText] = useState(""); + const [seat, setSeat] = useState(""); + const [busy, setBusy] = useState(false); + const [said, setSaid] = useState(null); + if (!council) return null; + const steerable = ["running", "paused", "needs-decision"].includes(council.state); + const steerKeys = repeatKeys(council.steers.map((steer) => `${steer.at}:${steer.text}`)); + const give = async () => { + if (!text.trim() || busy) return; + setBusy(true); + const result = await act(`/api/tasks/${task.id}/steer`, { + text: text.trim(), + seat: seat || null, + by: person, + }); + setBusy(false); + if (result.ok) { + setText(""); + setSaid( + "Given. It is in the history; the step starts again with it once its seats have stopped.", + ); + } else setSaid(result.why); + props.onChanged(); + }; + const summarise = async (name: string) => { + setBusy(true); + const result = await act(`/api/tasks/${task.id}/messages`, { + kind: "message", + text: `Summarise the ${DOCUMENT_LABEL[name] ?? name} (${name}) of run ${council.run} for me in a few lines: what it says will be done, how it will be checked, and anything I should look at.`, + by: person, + }); + setBusy(false); + setSaid(result.ok ? "Asked the coordinator. The answer comes in the history." : result.why); + props.onChanged(); + }; + return ( +
+

Run {council.run}

+ {council.documents.length > 0 ? ( +
+ {council.documents.map((name) => ( +
+ + +
+ ))} +
+ ) : ( +

+ No plan, review or evidence written yet. Each shows here once the run writes it. +

+ )} + {council.steers.length > 0 ? ( +
    + {council.steers.map((steer, index) => ( +
  • + + {steer.by} to {steer.seat ?? "every seat"}:{" "} + + {steer.text} +
  • + ))} +
+ ) : null} + {steerable ? ( +
+ +