Address PR #1217 code review feedback
- Fix Collapse animation: remove outer {isExpanded && ...} wrapper so
Mantine's Collapse component drives the mount/unmount animation
- Show statusMessage for all tasks, not just active ones, so failed/
cancelled tasks display their error reason without expanding
- Remove redundant "Status" detail row — the TaskStatusBadge in the
header already communicates status
- Fix ttl guard: change !== null to != null to correctly handle the
SDK's optional (undefined) field
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6af51e5963
commit
3d6280eb0e
1 changed files with 14 additions and 26 deletions
|
|
@ -133,10 +133,6 @@ export function TaskCard({
|
||||||
|
|
||||||
<SummaryRow>
|
<SummaryRow>
|
||||||
<DetailRow>
|
<DetailRow>
|
||||||
<Stack gap={2}>
|
|
||||||
<DetailLabel>Status</DetailLabel>
|
|
||||||
<DetailValue>{status}</DetailValue>
|
|
||||||
</Stack>
|
|
||||||
<Stack gap={2}>
|
<Stack gap={2}>
|
||||||
<DetailLabel>Last Updated</DetailLabel>
|
<DetailLabel>Last Updated</DetailLabel>
|
||||||
<DetailValue>{lastUpdatedAt}</DetailValue>
|
<DetailValue>{lastUpdatedAt}</DetailValue>
|
||||||
|
|
@ -145,7 +141,7 @@ export function TaskCard({
|
||||||
<DetailLabel>Created At</DetailLabel>
|
<DetailLabel>Created At</DetailLabel>
|
||||||
<DetailValue>{createdAt}</DetailValue>
|
<DetailValue>{createdAt}</DetailValue>
|
||||||
</Stack>
|
</Stack>
|
||||||
{ttl !== null && (
|
{ttl != null && (
|
||||||
<Stack gap={2}>
|
<Stack gap={2}>
|
||||||
<DetailLabel>TTL</DetailLabel>
|
<DetailLabel>TTL</DetailLabel>
|
||||||
<DetailValue>{formatTtl(ttl)}</DetailValue>
|
<DetailValue>{formatTtl(ttl)}</DetailValue>
|
||||||
|
|
@ -160,29 +156,21 @@ export function TaskCard({
|
||||||
{progress && isActive ? (
|
{progress && isActive ? (
|
||||||
<ProgressDisplay params={progress} />
|
<ProgressDisplay params={progress} />
|
||||||
) : (
|
) : (
|
||||||
statusMessage &&
|
statusMessage && (
|
||||||
isActive && <StatusMessageText>{statusMessage}</StatusMessageText>
|
<StatusMessageText>{statusMessage}</StatusMessageText>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isExpanded && (
|
<Collapse in={isExpanded}>
|
||||||
<Collapse in={isExpanded}>
|
<Stack gap="sm">
|
||||||
<Stack gap="sm">
|
<Divider />
|
||||||
{statusMessage && !isActive && (
|
<SectionTitle>Full Task Object</SectionTitle>
|
||||||
<Stack gap={2}>
|
<ContentViewer
|
||||||
<DetailLabel>Status Message</DetailLabel>
|
block={{ type: "text", text: JSON.stringify(task) }}
|
||||||
<StatusMessageText>{statusMessage}</StatusMessageText>
|
copyable
|
||||||
</Stack>
|
/>
|
||||||
)}
|
</Stack>
|
||||||
|
</Collapse>
|
||||||
<Divider />
|
|
||||||
<SectionTitle>Full Task Object</SectionTitle>
|
|
||||||
<ContentViewer
|
|
||||||
block={{ type: "text", text: JSON.stringify(task) }}
|
|
||||||
copyable
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</Collapse>
|
|
||||||
)}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</TaskContainer>
|
</TaskContainer>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue