feat(ai): add welcomeScreenCards to F0AiChat#4550
Conversation
📦 Alpha Package Version PublishedUse Use |
🔍 Visual review for your branch is published 🔍Here are the links to: |
Opt-out of the default p-4 padding around form content, for embedding a form flush inside a host surface (e.g. an AI canvas panel). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- test: assert the content wrapper keeps p-4 by default and drops it when styling.noPadding is true, for both single-schema and per-section layouts - docs: add a Styling section to F0Form.mdx documenting showSectionsSidepanel and noPadding (nested in F0FormStylingConfig, not surfaced by argTypes) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ting classes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8adc9b0 to
d872f96
Compare
…mposer Bake the welcome-cards capability into F0AiChat as a data-driven welcomeScreenCards prop (symmetric with welcomeScreenSuggestions), rendered by an internal WelcomeScreenCardsRow — capped at 4 (2x2 grid). Replaces the standalone F0AiChatWelcomeCards component the consumer had to hand-wire through the footer slot. Also always render the welcome suggestions row above the composer so its popover opens upward instead of covering the input. Supersedes #4534 and #4537. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
a5c4870 to
8d88224
Compare
…footer Replace the QuickActions footer in the ApplicationFrame Default story with the welcome cards (WelcomeScreenCardsRow), wired to the mock chat runtime so prompt cards send their message. FullscreenWithActions keeps QuickActions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
|
sauldom102
left a comment
There was a problem hiding this comment.
Should all these cards in One full-screen trigger a prompt? What about the templates one?
Address review feedback on welcomeScreenCards: a card click now reports which card was clicked, not just a prompt string, so different cards can trigger different behaviors. - F0AiChatWelcomeCard gains a required, stable id; message stays optional and is now pure data (the host decides whether to send it). - Remove the per-card onClick; clicking any card calls onCardSelect(id, message) so the host can branch behavior per card (send a prompt, open a dialog, navigate, ...). - Update WelcomeScreenCardsRow, the F0AiChatTextArea types/passthrough, and the stories/tests; the ApplicationFrame demo routes "All templates" to a non-prompt branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the welcome-cards API. Alongside the data-driven `welcomeScreenCards`, F0AiChat now exposes an `onCardSelect(id, message)` handler — both as a prop and as a `setOnCardSelect` registrar on the provider, so a component rendered inside the chat (one that needs in-provider context such as `openCanvas`) can wire per-card behavior. The handler is ref-backed and exposed as a stable dispatcher, so the connected input always calls the latest registered handler without re-rendering and consumers can `setOnCardSelect(fn)` directly (no functional-setState wrapper). Data and its handler now live together in the provider, symmetric with `welcomeScreenCards`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Aligns the survey reference with the reworked welcome-cards API (PR #4550): cards are now pure data with stable ids instead of per-card onClick closures, and the three card behaviors collapse into one id-keyed handler registered with the chat via setOnCardSelect. The mock connected input forwards the provider handler to the composer. Keeps the data-driven welcomeScreenCards approach intact — the registrar still feeds card data through the provider; only the click wiring changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the host-level onCardSelect(id, message) handler and the setOnCardSelect/onCardSelectRef dispatcher plumbing in the provider. Each F0AiChatWelcomeCard now owns its behavior via an optional onClick, so different cards can trigger different things and the host wires each one directly. Final card shape: id, icon, title, description, message, onClick. Tests and stories updated to the new model; a card without onClick renders non-interactive. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n-cards # Conflicts: # packages/react/src/patterns/ApplicationFrame/index.stories.tsx
Description
Bakes the welcome-cards capability into F0AiChat as a data-driven
welcomeScreenCardsprop (symmetric withwelcomeScreenSuggestions), rendered by an internalWelcomeScreenCardsRow. Prompt cards (with amessage) callonCardSelect; action cards (with anonClick) run their own handler. The row is a 2×2 grid capped at 4 cards. Also always renders the welcome suggestions row above the composer so its popover opens upward instead of covering the input.This replaces the standalone
F0AiChatWelcomeCardscomponent (which the consumer had to hand-wire through thefooterslot) and supersedes the now-closed #4534 and #4537.Implementation details
welcomeScreenCards+onCardSelecttoF0AiChat/F0AiChatTextArea, rendered by a new internalWelcomeScreenCardsRow(capped at 4, 2×2 grid)WelcomeScreenCardsRow(incl. the 4-card cap) and the welcome-layout placement