feat(sds): render F0HILActionConfirmation with F0CardRow#4341
Conversation
📦 Alpha Package Version PublishedUse Use |
🔍 Visual review for your branch is published 🔍Here are the links to: |
Coverage Report for packages/react
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||
| </div> | ||
| <F0CardRow | ||
| title={text ?? ""} |
There was a problem hiding this comment.
title is mandatory in F0CardRow, that's why we're using ?? "", but if that happens we will show a card without any title... do we want that? Sounds like a broken UI to me
There was a problem hiding this comment.
Good catch. We had the same issue in the previous PR that builds the CardRow. I'll review and fix.
There was a problem hiding this comment.
Reviewed — this is not addressed yet. text is still optional (text?: string in types.ts) and we still coerce with title={text ?? ""}.
F0CardRow guards the title with {title && …}, so an empty text won't crash, but it renders a confirmation row with no prompt — just the description + ✓/✗ buttons — which is the broken UI you flagged.
Fix I'm going with: make text required (text: string) and drop the ?? "". A HIL confirmation without a prompt has no meaning, and there are no external consumers yet (only the stories, which all pass text), so tightening the type is safe and removes the coercion entirely. Pushing that now.
F0CardRow is the horizontal, row-shaped counterpart to F0Card: an optional avatar on the left, a title with an optional description, and trailing actions on the right. Supports primary / secondary / overflow actions, an icon-only confirm/reject variant, an alert banner, and a `stackAt` container breakpoint that drops the actions onto their own line (folding secondary buttons into a left ⋯ menu) when the card is narrow. Net-new component with a unit test suite and autodocs (description + use cases). The F0HILActionConfirmation migration and removal of the experimental F0Card `oneLiner` variant stay with the cocreation PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the ellipsis prop from the title and description Text elements so long content wraps across multiple lines in all cases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the bespoke overflow/primary-secondary-other machinery in CardRowActions with a thin adapter over the data-driven ButtonGroup (#4339), which now owns the width-driven "⋯" overflow, the primary pinning, and the row/stacked layout. The card keeps its own concerns: stopping click propagation so actions don't trigger the row link, the stacked own-line footer hairline at the container breakpoint, and the confirm/reject icon variant (mapped to two pinned secondaries). The actions wrapper takes the remaining row space (flex-1) so ButtonGroup has a bound wider than its content to measure against; a shrink-to-fit container made it shed its tail into the menu. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c6c264f to
43cfc49
Compare
…tack The confirm (✓) action now renders as the solid primary instead of a second outline button; reject (✗) stays outline. While inline the pair stays icon-only, but once the row stacks onto its own line the buttons reveal their labels (default "Cancel" / "Confirm", or whatever the caller supplies) — rendered as a CSS-toggled labelled cluster since hideLabel is static and the stack is a container query ButtonGroup can't observe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The stacked actions wrapper had both `w-full` and the `-mx-4` full-bleed: a negative right margin can't widen a fixed-width box, so the footer hairline clipped ~16px short on the right. Drop `w-full` and let the flex column stretch the wrapper instead, so `-mx-4`/`px-4` bleeds evenly to both card edges. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a generic `status` prop (an F0TagStatus) rendered at the trailing edge in place of any actions — the resolved state of a confirm/reject row. It's informational, so no click-stop / z-index (a row-level overlay link stays clickable through it), and the outer flex drops it to its own line when stacked. The accepted/rejected -> positive/critical mapping is left to the caller; Accepted/Rejected stories demonstrate it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an `inactive` prop that strikes through and dims the title (lighter foreground) and description, marking the row's subject as void/closed — e.g. a rejected request. Presentational and generic; the Rejected story pairs it with the critical status tag. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Allow `status` to be a coloured icon instead of a tag — a discriminated
union of TagStatusProps or { icon, variant, label }. Renders the plain
accept/reject glyph (Check / Cross, not the circled variants) at lg size,
coloured by variant, with the label exposed via role="img" + aria-label.
Accepted/Rejected-icon stories demonstrate it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the status tag variant in favour of the coloured icon: `status` is
now just `{ icon, variant, label }`, no longer a tag/icon union. Removes
the F0TagStatus path; Accepted/Rejected stories render the Check/Cross
glyph. Not a breaking change — F0CardRow has no consumers outside this PR.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`title` is a required prop, so the `{title && …}` check never short-
circuits. Render it unconditionally. Addresses review feedback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dd5fc1e to
64445ae
Compare
…variant Render the prompt as the row title with icon-only ✓/✗ actions, plus optional avatar, description and stackAt props. Fix the story layout (centered → padded) so the row no longer collapses to min-content width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…oercion A confirmation without a prompt is meaningless and rendered an empty F0CardRow title. Make text required and drop the ?? "" fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cb9522a to
bf6f8cb
Compare
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
|
…ards Rebased onto main (#4340 F0CardRow / #4341 F0HILActionConfirmation now landed). The welcome footer cards use F0CardRow instead of a hand-rolled button. Also drops the now-unused appendRawMessages mock helper (dead after removing the in-chat resource cards). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ards Rebased onto main (#4340 F0CardRow / #4341 F0HILActionConfirmation now landed). The welcome footer cards use F0CardRow instead of a hand-rolled button. Also drops the now-unused appendRawMessages mock helper (dead after removing the in-chat resource cards). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Updates
F0HILActionConfirmationto render withF0CardRowinstead of its bespokediv+ buttons layout: the confirm action becomes the primary, cancel becomes a secondary.Sequencing
Third step of the ship sequence:
Stacked on
feat/f0-card-rowso it compiles againstF0CardRow. Retarget tomainonce #4340 merges. The deadoneLinervariant has been removed from the cocreation branch, so nothing competes with this.🤖 Generated with Claude Code