Skip to content

feat: One Voice Mode Test#3700

Closed
adriablancafort wants to merge 1 commit intomainfrom
voice-mode
Closed

feat: One Voice Mode Test#3700
adriablancafort wants to merge 1 commit intomainfrom
voice-mode

Conversation

@adriablancafort
Copy link
Copy Markdown
Member

Description

Screenshots (if applicable)

[Link to Figma Design](Figma URL here)

Implementation details

Copilot AI review requested due to automatic review settings March 19, 2026 11:41
@github-actions github-actions bot added feat react Changes affect packages/react labels Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@adriablancafort adriablancafort review requested due to automatic review settings March 19, 2026 11:43
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 44.28% 9708 / 21924
🔵 Statements 43.62% 9994 / 22910
🔵 Functions 35.85% 2187 / 6099
🔵 Branches 35.1% 6144 / 17504
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/lib/providers/i18n/i18n-provider-defaults.ts 100% 100% 100% 100%
packages/react/src/sds/ai/F0AiChat/F0AiChat.tsx 18% 0% 0% 18% 49-69, 77-84, 89-104, 108-120, 124-200, 205-225
packages/react/src/sds/ai/F0AiChat/index.ts 100% 100% 100% 100%
packages/react/src/sds/ai/F0AiChat/internal-types.ts 100% 100% 100% 100%
packages/react/src/sds/ai/F0AiChat/types.ts 100% 100% 100% 100%
packages/react/src/sds/ai/F0AiChat/components/ChatHeader.tsx 4.54% 0% 0% 5% 17-92
packages/react/src/sds/ai/F0AiChat/components/MessagesContainer.tsx 26.27% 23.33% 15.62% 28.34% 26-28, 42-371, 376
packages/react/src/sds/ai/F0AiChat/providers/AiChatStateProvider.tsx 5.37% 0% 0% 5.55% 32-44, 68-280, 287-333
Generated in workflow #11932 for commit b749216 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

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

Use pnpm i github:factorialco/f0#9b7e96701017080477417b06075f1cc7687c5fbd to install this specific commit

Copilot AI review requested due to automatic review settings March 19, 2026 23:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an interaction “mode” concept to F0AiChat to support rendering a dedicated voice UI inside the existing chat window shell.

Changes:

  • Introduces AiChatMode ("chat" | "voice") and exposes mode/setMode via useAiChat().
  • Adds an optional VoiceMode injected component and renders it when mode === "voice".
  • Bumps @factorialco/f0-react version + release metadata files.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/react/src/sds/ai/F0AiChat/types.ts Adds AiChatMode type and VoiceMode provider prop.
packages/react/src/sds/ai/F0AiChat/providers/AiChatStateProvider.tsx Adds mode state and exposes it through context.
packages/react/src/sds/ai/F0AiChat/internal-types.ts Extends internal/provider return types with mode and VoiceMode.
packages/react/src/sds/ai/F0AiChat/index.ts Re-exports AiChatMode.
packages/react/src/sds/ai/F0AiChat/F0AiChat.tsx Switches UI rendering based on mode, rendering VoiceMode in voice mode.
packages/react/package.json Version bump to 1.406.0.
packages/react/CHANGELOG.md Adds 1.406.0 changelog entry (currently unrelated to voice mode).
.release-please-manifest.json Updates release-please manifest version for packages/react.

/**
* Optional component rendered in place of the chat UI when voice mode is active.
*/
VoiceMode?: React.ComponentType
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

VoiceMode is introduced as a PascalCase prop on AiChatProviderProps, while the rest of this public API uses camelCase prop names. Consider renaming to a camelCase prop (e.g. voiceMode, voiceModeComponent, etc.) before release to keep the API consistent and avoid consumers mistaking it for a component export rather than a prop.

Suggested change
VoiceMode?: React.ComponentType
voiceMode?: React.ComponentType

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +215
return (
<SidebarWindow clickOutsideToClose hitEscapeToClose shortcut="">
<div className="flex h-full w-full flex-col">
<VoiceMode />
</div>
</SidebarWindow>
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

In the voice-mode branch, SidebarWindow is rendered directly with clickOutsideToClose/hitEscapeToClose/shortcut props, but SidebarWindow (packages/react/src/sds/ai/F0AiChat/components/ChatWindow.tsx) only uses children and ignores the rest of WindowProps. This means those close/escape behaviors won’t work here, and there’s no other built-in way to dismiss the voice UI unless VoiceMode itself manually calls setOpen(false). Consider either rendering voice mode through CopilotSidebar’s Window so CopilotKit can manage close behavior, or updating SidebarWindow to actually implement/spread the relevant WindowProps when used standalone.

Suggested change
return (
<SidebarWindow clickOutsideToClose hitEscapeToClose shortcut="">
<div className="flex h-full w-full flex-col">
<VoiceMode />
</div>
</SidebarWindow>
const VoiceMessages = () => (
<div className="flex h-full w-full flex-col">
<VoiceMode />
</div>
)
return (
<CopilotSidebar
className="h-full w-full"
defaultOpen={open}
onSetOpen={(isOpen) => {
setOpen(isOpen)
}}
Window={SidebarWindow}
Header={ChatHeader}
Messages={VoiceMessages}
Button={() => {
return null // hide CopilotKit's default chat button
}}
Input={() => null}
UserMessage={UserMessage}
AssistantMessage={AssistantMessage}
/>

Copilot uses AI. Check for mistakes.
Comment on lines 199 to +217
@@ -204,6 +206,16 @@ const F0AiChatComponent = () => {
return null
}

if (mode === "voice" && VoiceMode) {
return (
<SidebarWindow clickOutsideToClose hitEscapeToClose shortcut="">
<div className="flex h-full w-full flex-col">
<VoiceMode />
</div>
</SidebarWindow>
)
}
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

New interaction-mode behavior is added (voice-mode rendering + mode state) but there are no unit tests covering it. Since this package already has unit tests under __tests__, please add coverage verifying that switching mode to "voice" renders the injected VoiceMode component and that the default "chat" mode continues to render the chat UI.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +3 to +8
## [1.406.0](https://github.com/factorialco/f0/compare/f0-react-v1.405.1...f0-react-v1.406.0) (2026-03-18)


### Features

* add ai_ticketing module icon ([#3693](https://github.com/factorialco/f0/issues/3693)) ([78c41b6](https://github.com/factorialco/f0/commit/78c41b62caeff77bfb3f56c7f939c356cd9aa031))
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

The new 1.406.0 changelog entry doesn’t mention the voice-mode feature introduced in this PR, and instead references an unrelated change (ai_ticketing module icon). Either regenerate the changelog for this PR’s actual changes or drop the version/changelog/manifest bumps from this PR if they were included accidentally.

Copilot uses AI. Check for mistakes.
@adriablancafort adriablancafort deleted the voice-mode branch March 19, 2026 23:26
@adriablancafort adriablancafort changed the title feat: voice mode nothing Mar 19, 2026
@adriablancafort adriablancafort changed the title nothing feat: voice test Mar 19, 2026
@adriablancafort adriablancafort changed the title feat: voice test feat: One Voice Mode Test Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants