feat(core): add reasoning icon button (#11941)

Close [AI-58](https://linear.app/affine-design/issue/AI-58).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Introduced a toggleable AI reasoning feature in the chat interface, allowing users to enable or disable advanced reasoning during AI chat interactions.
  - Added a new reasoning button to the chat input for quick access and control.
- **Enhancements**
  - Improved chat configuration options to include reasoning settings, providing more flexibility for AI responses.
  - Streamlined network search and image upload interactions for a smoother user experience.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
akumatus
2025-04-24 14:32:54 +00:00
parent fd90b2541e
commit 807cba03ee
14 changed files with 175 additions and 38 deletions
@@ -41,8 +41,12 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
}
}, [onLoad, ref]);
const { docDisplayConfig, searchMenuConfig, networkSearchConfig } =
useAIChatConfig();
const {
docDisplayConfig,
searchMenuConfig,
networkSearchConfig,
reasoningConfig,
} = useAIChatConfig();
useEffect(() => {
if (!editor || !editor.host) return;
@@ -67,6 +71,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
chatPanelRef.current.docDisplayConfig = docDisplayConfig;
chatPanelRef.current.searchMenuConfig = searchMenuConfig;
chatPanelRef.current.networkSearchConfig = networkSearchConfig;
chatPanelRef.current.reasoningConfig = reasoningConfig;
chatPanelRef.current.extensions = editor.host.std
.get(ViewExtensionManagerIdentifier)
.get('preview-page');
@@ -98,6 +103,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
framework,
networkSearchConfig,
searchMenuConfig,
reasoningConfig,
]);
return <div className={styles.root} ref={containerRef} />;