mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
fix(core): re-layout ai-chat-content to display preview panel (#13030)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a split-view layout in the AI chat, allowing chat content and a preview panel to be displayed side-by-side. * Added responsive padding and layout adjustments for improved chat panel appearance. * **Refactor** * Simplified the chat panel by removing the previous preview panel feature and related state from the main chat component. * Updated internal logic to support the new split-view structure. * **Style** * Adjusted chat panel and workspace chat page styles for better layout consistency and responsiveness. * **Chores** * Improved code organization and import statements for maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -3,9 +3,6 @@ import { style } from '@vanilla-extract/css';
|
||||
export const chatRoot = style({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
maxWidth: 800,
|
||||
padding: '0px 16px',
|
||||
margin: '0 auto',
|
||||
});
|
||||
|
||||
export const chatHeader = style({
|
||||
|
||||
@@ -188,16 +188,18 @@ export const Component = () => {
|
||||
|
||||
tool.session = currentSession;
|
||||
|
||||
tool.onNewSession = () => {
|
||||
if (!currentSession) return;
|
||||
setCurrentSession(null);
|
||||
chatContent?.reset();
|
||||
};
|
||||
|
||||
tool.onTogglePin = async () => {
|
||||
await togglePin();
|
||||
};
|
||||
|
||||
// initial props
|
||||
if (!chatTool) {
|
||||
tool.onNewSession = () => {
|
||||
if (!currentSession) return;
|
||||
setCurrentSession(null);
|
||||
chatContent?.reset();
|
||||
};
|
||||
tool.onTogglePin = async () => {
|
||||
await togglePin();
|
||||
};
|
||||
// mount
|
||||
chatToolContainerRef.current.append(tool);
|
||||
setChatTool(tool);
|
||||
|
||||
Reference in New Issue
Block a user