From 676641f3dab87a230aae8352a3e752b8f9497cf9 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 22 Mar 2026 02:21:27 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20refactor:=20Migrate=20to=20`reac?= =?UTF-8?q?t-resizable-panels`=20v4=20with=20Artifacts=20Header=20polish?= =?UTF-8?q?=20(#12356)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Update react-resizable-panels dependency to version 4.7.4 - Upgraded the "react-resizable-panels" package in package-lock.json, package.json, and client package.json files to ensure compatibility with the latest features and improvements. - Adjusted peer dependencies for React and ReactDOM to align with the new version requirements. * refactor: Update Share and SidePanel components to `react-resizable-panels` v4 - Refactored the ShareArtifactsContainer to utilize a new layout change handler, enhancing artifact panel resizing functionality. - Updated ArtifactsPanel to use the new `usePanelRef` hook, improving panel reference management. - Simplified SidePanelGroup by removing unnecessary layout normalization and integrating default layout handling with localStorage. - Removed the deprecated `normalizeLayout` utility function to streamline the codebase. - Adjusted Resizable components to ensure consistent sizing and layout behavior across panels. * style: Enhance scrollbar appearance across application - Added custom scrollbar styles to both artifacts and markdown files, improving aesthetics and user experience. - Implemented dark mode adjustments for scrollbar visibility, ensuring consistency across different color schemes. * style: Standardize button sizes and layout in Artifacts components - Updated button dimensions to a consistent height of 9 units across various components including Artifacts, Code, and DownloadArtifact. - Adjusted padding and layout properties in the Artifacts header for improved visual consistency. - Enhanced the Radio component to accept a new `buttonClassName` prop for better customization of button styles. * chore: import order --- client/package.json | 2 +- client/src/components/Artifacts/Artifacts.tsx | 5 +- client/src/components/Artifacts/Code.tsx | 1 + .../components/Artifacts/DownloadArtifact.tsx | 1 + .../src/components/Share/ShareArtifacts.tsx | 29 +++++------- .../components/SidePanel/ArtifactsPanel.tsx | 27 ++++------- .../components/SidePanel/SidePanelGroup.tsx | 47 +++++++------------ client/src/utils/artifacts.ts | 8 ++++ client/src/utils/index.ts | 18 ------- client/src/utils/markdown.ts | 12 +++++ package-lock.json | 14 +++--- packages/client/package.json | 2 +- packages/client/src/components/Radio.tsx | 10 ++-- packages/client/src/components/Resizable.tsx | 34 ++++++-------- 14 files changed, 92 insertions(+), 118 deletions(-) diff --git a/client/package.json b/client/package.json index c23c44804c..85d5a176f4 100644 --- a/client/package.json +++ b/client/package.json @@ -95,7 +95,7 @@ "react-hook-form": "^7.43.9", "react-i18next": "^15.4.0", "react-markdown": "^9.0.1", - "react-resizable-panels": "^3.0.6", + "react-resizable-panels": "^4.7.4", "react-router-dom": "^6.30.3", "react-speech-recognition": "^3.10.0", "react-textarea-autosize": "^8.4.0", diff --git a/client/src/components/Artifacts/Artifacts.tsx b/client/src/components/Artifacts/Artifacts.tsx index 74b2e20180..776f689f08 100644 --- a/client/src/components/Artifacts/Artifacts.tsx +++ b/client/src/components/Artifacts/Artifacts.tsx @@ -216,7 +216,7 @@ export default function Artifacts() { {/* Header */}
@@ -234,6 +234,7 @@ export default function Artifacts() { value={activeTab} onChange={setActiveTab} disabled={isMutating && activeTab !== 'code'} + buttonClassName="h-9 px-3 gap-1.5" />
)} @@ -249,6 +250,7 @@ export default function Artifacts() {