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:
cliffhall 2026-04-20 15:49:14 -04:00
commit 3d6280eb0e

View file

@ -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,20 +156,13 @@ 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">
{statusMessage && !isActive && (
<Stack gap={2}>
<DetailLabel>Status Message</DetailLabel>
<StatusMessageText>{statusMessage}</StatusMessageText>
</Stack>
)}
<Divider /> <Divider />
<SectionTitle>Full Task Object</SectionTitle> <SectionTitle>Full Task Object</SectionTitle>
<ContentViewer <ContentViewer
@ -182,7 +171,6 @@ export function TaskCard({
/> />
</Stack> </Stack>
</Collapse> </Collapse>
)}
</Stack> </Stack>
</TaskContainer> </TaskContainer>
); );