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>
|
||||
<DetailRow>
|
||||
<Stack gap={2}>
|
||||
<DetailLabel>Status</DetailLabel>
|
||||
<DetailValue>{status}</DetailValue>
|
||||
</Stack>
|
||||
<Stack gap={2}>
|
||||
<DetailLabel>Last Updated</DetailLabel>
|
||||
<DetailValue>{lastUpdatedAt}</DetailValue>
|
||||
|
|
@ -145,7 +141,7 @@ export function TaskCard({
|
|||
<DetailLabel>Created At</DetailLabel>
|
||||
<DetailValue>{createdAt}</DetailValue>
|
||||
</Stack>
|
||||
{ttl !== null && (
|
||||
{ttl != null && (
|
||||
<Stack gap={2}>
|
||||
<DetailLabel>TTL</DetailLabel>
|
||||
<DetailValue>{formatTtl(ttl)}</DetailValue>
|
||||
|
|
@ -160,29 +156,21 @@ export function TaskCard({
|
|||
{progress && isActive ? (
|
||||
<ProgressDisplay params={progress} />
|
||||
) : (
|
||||
statusMessage &&
|
||||
isActive && <StatusMessageText>{statusMessage}</StatusMessageText>
|
||||
statusMessage && (
|
||||
<StatusMessageText>{statusMessage}</StatusMessageText>
|
||||
)
|
||||
)}
|
||||
|
||||
{isExpanded && (
|
||||
<Collapse in={isExpanded}>
|
||||
<Stack gap="sm">
|
||||
{statusMessage && !isActive && (
|
||||
<Stack gap={2}>
|
||||
<DetailLabel>Status Message</DetailLabel>
|
||||
<StatusMessageText>{statusMessage}</StatusMessageText>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
<Divider />
|
||||
<SectionTitle>Full Task Object</SectionTitle>
|
||||
<ContentViewer
|
||||
block={{ type: "text", text: JSON.stringify(task) }}
|
||||
copyable
|
||||
/>
|
||||
</Stack>
|
||||
</Collapse>
|
||||
)}
|
||||
<Collapse in={isExpanded}>
|
||||
<Stack gap="sm">
|
||||
<Divider />
|
||||
<SectionTitle>Full Task Object</SectionTitle>
|
||||
<ContentViewer
|
||||
block={{ type: "text", text: JSON.stringify(task) }}
|
||||
copyable
|
||||
/>
|
||||
</Stack>
|
||||
</Collapse>
|
||||
</Stack>
|
||||
</TaskContainer>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue