Skip to content

feat(sds): render F0HILActionConfirmation with F0CardRow#4341

Merged
warcos-fact merged 18 commits into
mainfrom
feat/f0-hil-card-row
Jun 8, 2026
Merged

feat(sds): render F0HILActionConfirmation with F0CardRow#4341
warcos-fact merged 18 commits into
mainfrom
feat/f0-hil-card-row

Conversation

@warcos-fact

Copy link
Copy Markdown
Contributor

What

Updates F0HILActionConfirmation to render with F0CardRow instead of its bespoke div + buttons layout: the confirm action becomes the primary, cancel becomes a secondary.

Sequencing

Third step of the ship sequence:

  1. ButtonGroup (feat(ui): add ButtonGroup — a data-driven action bar #4339)
  2. F0CardRow (feat(ui): add F0CardRow component #4340)
  3. F0HIL → F0CardRow (this PR)

Stacked on feat/f0-card-row so it compiles against F0CardRow. Retarget to main once #4340 merges. The dead oneLiner variant has been removed from the cocreation branch, so nothing competes with this.

🤖 Generated with Claude Code

@warcos-fact warcos-fact requested a review from a team as a code owner June 5, 2026 09:59
@github-actions github-actions Bot added feat react Changes affect packages/react labels Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-4341 to install the package

Use pnpm i github:factorialco/f0#6cc0b5777f99148cccdb7811fbf99d7d0e19b8e5 to install this specific commit

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 53.05% 15409 / 29041
🔵 Statements 52.18% 15989 / 30638
🔵 Functions 45.23% 3468 / 7667
🔵 Branches 46.05% 10945 / 23767
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/sds/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx 0% 0% 0% 0% 5-29
packages/react/src/sds/ai/F0HILActionConfirmation/types.ts 100% 100% 100% 100%
Generated in workflow #14376 for commit 043da63 by the Vitest Coverage Report Action

</div>
</div>
<F0CardRow
title={text ?? ""}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. We had the same issue in the previous PR that builds the CardRow. I'll review and fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

warcos-fact and others added 5 commits June 8, 2026 12:59
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>
@warcos-fact warcos-fact requested a review from a team as a code owner June 8, 2026 11:04
warcos-fact and others added 9 commits June 8, 2026 13:17
…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>
@warcos-fact warcos-fact force-pushed the feat/f0-hil-card-row branch from dd5fc1e to 64445ae Compare June 8, 2026 12:52
warcos-fact and others added 3 commits June 8, 2026 15:02
Replace the bespoke div + buttons layout with F0CardRow — the confirm action
becomes the primary, cancel becomes a secondary. Third step of the sequence
after ButtonGroup (#4339) and F0CardRow (#4340).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…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>
@warcos-fact warcos-fact force-pushed the feat/f0-hil-card-row branch from cb9522a to bf6f8cb Compare June 8, 2026 13:03
Base automatically changed from feat/f0-card-row to main June 8, 2026 13:13
@warcos-fact warcos-fact merged commit e0c8cf0 into main Jun 8, 2026
@warcos-fact warcos-fact deleted the feat/f0-hil-card-row branch June 8, 2026 13:20
@eliseo-juan eliseo-juan mentioned this pull request Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking public API changes (4)

These public exports were renamed/removed, or had a property/parameter removed, retyped, or newly required compared to main — that breaks consumers. Adding new exports or new optional props is always safe and is not flagged. If a breaking change is intentional, note it in the PR description and use a feat!:/BREAKING CHANGE commit so the release is a major bump.

Comparing f0, experimental and ai against main. Adding components, types, or optional props is safe. This check is non-blocking.

f0

  • ✏️ F0HILActionConfirmationbreaking change

    • __0.text became required
    before → after
    // before
    ({ text, confirmationText, onConfirm, cancelText, onCancel, }: F0HILActionConfirmationProps) => JSX_2.Element
    // after
    ({ text, description, avatar, confirmationText, onConfirm, cancelText, onCancel, stackAt, }: F0HILActionConfirmationProps) => JSX_2.Element
  • ✏️ F0HILActionConfirmationPropsbreaking change

    • text became required
    before → after
    // before
    F0HILActionConfirmationProps
    // after
    F0HILActionConfirmationProps

ai

  • ✏️ F0HILActionConfirmationbreaking change

    • __0.text became required
    before → after
    // before
    ({ text, confirmationText, onConfirm, cancelText, onCancel, }: F0HILActionConfirmationProps) => JSX_2.Element
    // after
    ({ text, description, avatar, confirmationText, onConfirm, cancelText, onCancel, stackAt, }: F0HILActionConfirmationProps) => JSX_2.Element
  • ✏️ F0HILActionConfirmationPropsbreaking change

    • text became required
    before → after
    // before
    F0HILActionConfirmationProps
    // after
    F0HILActionConfirmationProps

warcos-fact added a commit that referenced this pull request Jun 8, 2026
…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>
warcos-fact added a commit that referenced this pull request Jun 9, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants