Conversation
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
🔍 Visual review for your branch is published 🔍Here are the links to: |
📦 Alpha Package Version PublishedUse Use |
b749216 to
83e0490
Compare
There was a problem hiding this comment.
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 exposesmode/setModeviauseAiChat(). - Adds an optional
VoiceModeinjected component and renders it whenmode === "voice". - Bumps
@factorialco/f0-reactversion + 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 |
There was a problem hiding this comment.
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.
| VoiceMode?: React.ComponentType | |
| voiceMode?: React.ComponentType |
| return ( | ||
| <SidebarWindow clickOutsideToClose hitEscapeToClose shortcut=""> | ||
| <div className="flex h-full w-full flex-col"> | ||
| <VoiceMode /> | ||
| </div> | ||
| </SidebarWindow> |
There was a problem hiding this comment.
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.
| 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} | |
| /> |
| @@ -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> | |||
| ) | |||
| } | |||
There was a problem hiding this comment.
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.
| ## [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)) |
There was a problem hiding this comment.
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.
Description
Screenshots (if applicable)
[Link to Figma Design](Figma URL here)
Implementation details