From ae3bc57de7a240c3c8ab15080b405e8ea3e16ccb Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 5 Mar 2026 23:25:40 +0000 Subject: WIP: heartbeat checkpoint --- .../frontend/src/components/orders/OrderDetail.tsx | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'makima/frontend/src/components/orders') diff --git a/makima/frontend/src/components/orders/OrderDetail.tsx b/makima/frontend/src/components/orders/OrderDetail.tsx index 9c3ac97..4267725 100644 --- a/makima/frontend/src/components/orders/OrderDetail.tsx +++ b/makima/frontend/src/components/orders/OrderDetail.tsx @@ -6,6 +6,7 @@ import type { OrderType, UpdateOrderRequest, DirectiveSummary, + DirectiveOrderGroup, } from "../../lib/api"; const STATUS_BADGE: Record = { @@ -37,6 +38,7 @@ const STATUS_OPTIONS: OrderStatus[] = ["open", "in_progress", "under_review", "d interface OrderDetailProps { order: Order; directives: DirectiveSummary[]; + dogs: DirectiveOrderGroup[]; onUpdate: (req: UpdateOrderRequest) => Promise; onDelete: () => void; onLinkDirective: (directiveId: string) => Promise; @@ -47,6 +49,7 @@ interface OrderDetailProps { export function OrderDetail({ order, directives, + dogs, onUpdate, onDelete, onLinkDirective, @@ -61,6 +64,7 @@ export function OrderDetail({ const [labelsText, setLabelsText] = useState(order.labels.join(", ")); const [showLinkDirective, setShowLinkDirective] = useState(false); const [directiveSearch, setDirectiveSearch] = useState(""); + const [showDogSelector, setShowDogSelector] = useState(false); const badge = STATUS_BADGE[order.status] || STATUS_BADGE.open; const currentPriority = PRIORITY_OPTIONS.find((p) => p.value === order.priority) || PRIORITY_OPTIONS[4]; @@ -192,6 +196,18 @@ export function OrderDetail({ Step: {order.directiveStepId.slice(0, 8)}... )} + {order.directiveId && ( +
+ DOG:{" "} + {order.dogId ? ( + + {dogs.find((d) => d.id === order.dogId)?.name || order.dogId.slice(0, 8) + "..."} + + ) : ( + None + )} +
+ )} {/* Controls */}
@@ -501,6 +517,81 @@ export function OrderDetail({ )}
+ {/* Assign to DOG */} + {order.directiveId && ( +
+
+ + {order.dogId && ( + + )} +
+ {showDogSelector && ( +
+
+ {dogs.length === 0 ? ( +
+ No DOGs available for this directive +
+ ) : ( + dogs.map((d) => { + const isAssigned = d.id === order.dogId; + const statusColors: Record = { + open: "text-[#75aafc] border-[rgba(117,170,252,0.4)]", + in_progress: "text-yellow-400 border-yellow-800", + done: "text-emerald-400 border-emerald-800", + archived: "text-[#556677] border-[#2a3a5a]", + }; + const sColor = statusColors[d.status] || statusColors.open; + return ( + + ); + }) + )} +
+
+ )} +
+ )} + {/* Convert to Directive Step */} {!order.directiveStepId && order.directiveId && (