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:
Cats Juice
2025-07-04 16:00:24 +08:00
committed by GitHub
parent b9c4d7230e
commit 882d06b359
6 changed files with 56 additions and 44 deletions
@@ -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);