From ab9d59a30d51f67a2bd785c238c8b87bad335eca Mon Sep 17 00:00:00 2001 From: Dominic Elm Date: Fri, 12 Jul 2024 17:25:41 +0200 Subject: [PATCH] feat: refactor layout and introduce workspace panel and fix some bugs --- packages/bolt/app/components/Header.tsx | 2 +- .../bolt/app/components/chat/Artifact.tsx | 13 +- .../bolt/app/components/chat/BaseChat.tsx | 167 ++++++++++-------- .../bolt/app/components/chat/Chat.client.tsx | 40 ++--- .../bolt/app/components/chat/CodeBlock.tsx | 2 +- .../app/components/chat/Markdown.module.scss | 10 +- .../bolt/app/components/chat/Markdown.tsx | 84 ++++----- .../app/components/chat/Messages.client.tsx | 62 +++++++ .../bolt/app/components/chat/Messages.tsx | 55 ------ .../bolt/app/components/ui/IconButton.tsx | 6 +- .../components/workspace/Workspace.client.tsx | 55 ++++++ .../components/workspace/WorkspacePanel.tsx | 3 - packages/bolt/app/routes/api.enhancer.ts | 2 +- packages/bolt/app/styles/index.scss | 2 +- packages/bolt/app/styles/variables.scss | 2 + packages/bolt/app/utils/easings.ts | 3 + 16 files changed, 297 insertions(+), 211 deletions(-) create mode 100644 packages/bolt/app/components/chat/Messages.client.tsx delete mode 100644 packages/bolt/app/components/chat/Messages.tsx create mode 100644 packages/bolt/app/components/workspace/Workspace.client.tsx delete mode 100644 packages/bolt/app/components/workspace/WorkspacePanel.tsx create mode 100644 packages/bolt/app/utils/easings.ts diff --git a/packages/bolt/app/components/Header.tsx b/packages/bolt/app/components/Header.tsx index a51eed6..061b645 100644 --- a/packages/bolt/app/components/Header.tsx +++ b/packages/bolt/app/components/Header.tsx @@ -2,7 +2,7 @@ import { IconButton } from './ui/IconButton'; export function Header() { return ( -
+
Bolt
diff --git a/packages/bolt/app/components/chat/Artifact.tsx b/packages/bolt/app/components/chat/Artifact.tsx index 525b074..188e4db 100644 --- a/packages/bolt/app/components/chat/Artifact.tsx +++ b/packages/bolt/app/components/chat/Artifact.tsx @@ -3,17 +3,22 @@ import { workspaceStore } from '~/lib/stores/workspace'; interface ArtifactProps { messageId: string; - onClick?: () => void; } -export function Artifact({ messageId, onClick }: ArtifactProps) { +export function Artifact({ messageId }: ArtifactProps) { const artifacts = useStore(workspaceStore.artifacts); const artifact = artifacts[messageId]; return ( -