From 0ee5712df149878ea0d2e5f08761d8a8c80afbf6 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sat, 7 Jun 2025 23:41:25 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Enhance=20Artifact=20Manage?= =?UTF-8?q?ment=20with=20Version=20Control=20and=20UI=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Artifacts/ArtifactButton.tsx | 12 +- .../Artifacts/ArtifactCodeEditor.tsx | 4 + .../components/Artifacts/ArtifactPreview.tsx | 25 +-- .../src/components/Artifacts/ArtifactTabs.tsx | 7 +- .../components/Artifacts/ArtifactVersion.tsx | 78 ++++++++++ client/src/components/Artifacts/Artifacts.tsx | 142 +++++++++--------- client/src/components/Artifacts/Code.tsx | 12 +- .../components/Artifacts/DownloadArtifact.tsx | 21 +-- client/src/hooks/Artifacts/useArtifacts.ts | 1 + client/src/locales/en/translation.json | 1 + 10 files changed, 194 insertions(+), 109 deletions(-) create mode 100644 client/src/components/Artifacts/ArtifactVersion.tsx diff --git a/client/src/components/Artifacts/ArtifactButton.tsx b/client/src/components/Artifacts/ArtifactButton.tsx index 162e7d717c..bfb9037210 100644 --- a/client/src/components/Artifacts/ArtifactButton.tsx +++ b/client/src/components/Artifacts/ArtifactButton.tsx @@ -13,8 +13,9 @@ const ArtifactButton = ({ artifact }: { artifact: Artifact | null }) => { const location = useLocation(); const setVisible = useSetRecoilState(store.artifactsVisibility); const [artifacts, setArtifacts] = useRecoilState(store.artifactsState); - const setCurrentArtifactId = useSetRecoilState(store.currentArtifactId); + const [currentArtifactId, setCurrentArtifactId] = useRecoilState(store.currentArtifactId); const resetCurrentArtifactId = useResetRecoilState(store.currentArtifactId); + const isSelected = artifact?.id === currentArtifactId; const [visibleArtifacts, setVisibleArtifacts] = useRecoilState(store.visibleArtifacts); const debouncedSetVisibleRef = useRef( @@ -69,9 +70,14 @@ const ArtifactButton = ({ artifact }: { artifact: Artifact | null }) => { setCurrentArtifactId(artifact.id); }, 15); }} - className="relative overflow-hidden rounded-xl border border-border-medium transition-all duration-300 hover:border-border-xheavy hover:shadow-lg" + className={ + `relative overflow-hidden rounded-xl transition-all duration-200 hover:border-border-medium hover:bg-surface-hover hover:shadow-lg ` + + (isSelected + ? 'border-border-medium bg-surface-hover shadow-lg' + : 'border-border-light bg-surface-tertiary shadow-sm') + } > -
+
+ {localize('com_ui_code')}
+
+