Skip to content

feat(cocreation): co-creation pattern definition#4307

Merged
sauldom102 merged 13 commits into
mainfrom
cocreation-patterns-definition
Jul 3, 2026
Merged

feat(cocreation): co-creation pattern definition#4307
sauldom102 merged 13 commits into
mainfrom
cocreation-patterns-definition

Conversation

@warcos-fact

@warcos-fact warcos-fact commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

Defines the co-creation pattern in Storybook — the docs, the interactive creation-with-ai and standard-flow stories with their mock data, and the shared mock clarifying runtime that backs the flow.

The flow exercises a couple of capabilities the SDS didn't expose yet, so this PR also ships a small amount of component code (below). Rebased on main now that the stack it was built on (#4550, #4533, #4535) has merged.

Component changes (public API)

  • refactor(headers) — rename BaseHeader / ResourceHeader closeActiononClose. Drops the per-action tooltip; the close button is now labelled via i18n.actions.close and also renders on mobile (previously desktop-only).
  • feat(ai) — add revealChatOnCanvasToggle to F0AiChat. Lets a host suppress the chat content's re-fade when the canvas opens/closes while the chat is docked as a side panel. Defaults to true (unchanged behavior); fullscreen transitions still reveal.

Docs & stories

  • docs — co-creation pattern MDX: index, guidelines, phases, building-blocks, standard-flow, creation-with-ai, accessibility, adoption.
  • storiescreation-with-ai and standard-flow with mock data (mockData, mockToast, survey-mocks, tab-configs).
  • mocks — extend the shared F0AiChat mock runtime with a clarifying-question flow; add a welcome-suggestions demo to the F0AiChatTextArea story.

Internal refactors (from review)

  • Centralize the story's story-local CanvasContent / CanvasEntityDefinition casts behind typed helpers.
  • Extract repeated survey toast titles into constants.

@warcos-fact warcos-fact requested review from a team as code owners June 3, 2026 14:25
@github-actions github-actions Bot added feat react Changes affect packages/react labels Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 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 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@warcos-fact warcos-fact marked this pull request as draft June 4, 2026 08:43
@warcos-fact warcos-fact changed the title feat: co-creation patterns + F0Card oneLiner, F0HILActionConfirmation & F0AiProcessingOverlay feat: co-creation patterns & F0AiProcessingOverlay Jun 5, 2026
@warcos-fact warcos-fact force-pushed the cocreation-patterns-definition branch 2 times, most recently from eeb58d9 to ead68f9 Compare June 8, 2026 13:29
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

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

Use pnpm i github:factorialco/f0#45a7e4eba85e072c80a769aa357dfe97e0e9b39c to install this specific commit

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 57.78% 19193 / 33217
🔵 Statements 56.84% 20041 / 35256
🔵 Functions 50% 4432 / 8863
🔵 Branches 50.58% 13705 / 27093
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/experimental/Information/Headers/BaseHeader/index.tsx 90.9% 50% 77.77% 90.9% 110, 116
packages/react/src/lib/storybook-utils/ai-mocks.ts 0% 0% 0% 0% 3-79
packages/react/src/patterns/Cocreation/__stories__/mockData.tsx 0% 100% 0% 0% 16-191
packages/react/src/patterns/Cocreation/__stories__/survey-mocks.ts 0% 100% 0% 0% 25-260
packages/react/src/patterns/Cocreation/__stories__/tab-configs.ts 0% 100% 100% 0% 12-26
packages/react/src/patterns/ResourceHeader/index.tsx 100% 100% 100% 100%
packages/react/src/sds/ai/F0AiChat/F0AiChat.tsx 74.07% 57.69% 25% 74.07% 63-94, 126, 138, 152-163
packages/react/src/sds/ai/F0AiChat/__stories__/_mock/MockAiChatRuntime.tsx 0% 0% 0% 0% 69-800
packages/react/src/sds/ai/F0AiChat/__stories__/_mock/MockConnectedChatInput.tsx 0% 0% 0% 0% 20-117
packages/react/src/sds/ai/F0AiChat/__stories__/_mock/MockConnectedMessagesContainer.tsx 0% 0% 0% 0% 21-175
packages/react/src/sds/ai/F0AiChat/__stories__/_mock/index.ts 100% 100% 100% 100%
Generated in workflow #15292 for commit 4a4b275 by the Vitest Coverage Report Action

@warcos-fact

Copy link
Copy Markdown
Contributor Author

Dialogs-behind-AI-canvas fix is now split out

The dialog-alike stacking bug (confirmation dialogs rendering behind the AI chat/canvas) is fixed properly in #4421fix(dialog-alike): portal center modals to a top-level overlay root.

This branch now consumes that fix (merged in here) and drops the temporary container={null} workaround — the cocreation dialogs rely on the new default (center modals portal to #f0-overlay-root, escaping the ApplicationFrame isolate context).

Merge order: merge #4421 first. This branch is main + commits and already contains those exact fix commits, so rebasing onto an updated main (with #4421 merged) is conflict-free. The DialogContent portal resolution here also matches main's latest (#f0-overlay-root → #content → document.body).

@warcos-fact warcos-fact marked this pull request as ready for review June 29, 2026 16:08
@warcos-fact warcos-fact requested a review from a team as a code owner June 29, 2026 16:08
@warcos-fact warcos-fact force-pushed the cocreation-patterns-definition branch from 931e912 to 9492b1c Compare June 30, 2026 11:35
Base automatically changed from chop/ai-welcome-screen-cards to main June 30, 2026 13:01
@warcos-fact warcos-fact force-pushed the cocreation-patterns-definition branch from 9492b1c to 4f13ce6 Compare June 30, 2026 14:17
@warcos-fact warcos-fact changed the title docs(cocreation): co-creation pattern definition feat(cocreation): co-creation pattern definition Jul 1, 2026
@github-actions github-actions Bot added feat and removed docs labels Jul 1, 2026
warcos-fact and others added 10 commits July 3, 2026 11:26
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sauldom102 sauldom102 force-pushed the cocreation-patterns-definition branch from 26d1ae2 to a568b93 Compare July 3, 2026 09:26
@factorialco factorialco deleted a comment from github-actions Bot Jul 3, 2026
Comment thread packages/react/src/sds/ai/F0AiChat/F0AiChat.tsx Outdated

@sauldom102 sauldom102 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would personally replace all pngs in favor of stories showcasing a snapshot of our patterns, we could have them in our f0 composer public index in the future as templates

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Breaking public API changes (5)

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

  • ✏️ SurveyAnsweringFormbreaking change

    • props.resourceHeader changed: Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "onClose" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">
    before → after
    // before
    (props: SurveyAnsweringFormProps) => Element
    // after
    (props: SurveyAnsweringFormProps) => Element
  • ✏️ SurveyAnsweringFormInlineReadonlyPropsbreaking change

    • resourceHeader changed: Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "onClose" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">
    before → after
    // before
    SurveyAnsweringFormInlineReadonlyProps
    // after
    SurveyAnsweringFormInlineReadonlyProps
  • ✏️ SurveyAnsweringFormPropsbreaking change

    • resourceHeader changed: Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">Omit<Pick<BaseHeaderProps_2, "title" | "status" | "metadata" | "description" | "onClose" | "avatar" | "deactivated" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">, "title" | "description">
    before → after
    // before
    SurveyAnsweringFormProps
    // after
    SurveyAnsweringFormProps

experimental

  • ✏️ ResourceHeaderbreaking change

    • __0 changed: Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "onClose" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">
    before → after
    // before
    ({ avatar, title, description, primaryAction, secondaryActions, otherActions, status, metadata, deactivated, metadataRowGap, showBottomBorder, }: Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">) => Element
    // after
    ({ avatar, title, description, primaryAction, secondaryActions, otherActions, status, metadata, deactivated, metadataRowGap, showBottomBorder, onClose, }: Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "onClose" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">) => Element
  • ✏️ ResourceHeaderPropsbreaking change

    • type changed: Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "onClose" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">
    before → after
    // before
    Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">
    // after
    Pick<BaseHeaderProps_2, "status" | "title" | "metadata" | "deactivated" | "description" | "avatar" | "onClose" | "primaryAction" | "secondaryActions" | "otherActions" | "metadataRowGap" | "showBottomBorder">

warcos-fact and others added 3 commits July 3, 2026 14:59
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…reply

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nvas

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sauldom102 sauldom102 merged commit 9ad337d into main Jul 3, 2026
24 checks passed
@sauldom102 sauldom102 deleted the cocreation-patterns-definition branch July 3, 2026 14:30
@eliseo-juan eliseo-juan mentioned this pull request Jul 3, 2026
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.

2 participants