From 7ff8a195183e75170f9b0ba9b5a7487876762788 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Mon, 14 Jul 2025 14:08:30 -0700 Subject: [PATCH] improvement: address feedback --- .../src/hooks/api/folderCommits/queries.tsx | 3 +- .../CommitDetailsTab/CommitDetailsTab.tsx | 17 ++++++- .../SecretVersionDiffView.tsx | 47 +++++++------------ 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/frontend/src/hooks/api/folderCommits/queries.tsx b/frontend/src/hooks/api/folderCommits/queries.tsx index 8d0883c5b..785c13ad2 100644 --- a/frontend/src/hooks/api/folderCommits/queries.tsx +++ b/frontend/src/hooks/api/folderCommits/queries.tsx @@ -265,7 +265,8 @@ export const useGetFolderCommitHistory = ({ ], queryFn: () => fetchFolderCommitHistory(workspaceId, environment, directory, offset, limit, search, sort), - enabled: Boolean(workspaceId && environment) + enabled: Boolean(workspaceId && environment), + placeholderData: (prev) => prev }); }; diff --git a/frontend/src/pages/secret-manager/CommitDetailsPage/components/CommitDetailsTab/CommitDetailsTab.tsx b/frontend/src/pages/secret-manager/CommitDetailsPage/components/CommitDetailsTab/CommitDetailsTab.tsx index 7c7fa3d0d..f1d6d8f7e 100644 --- a/frontend/src/pages/secret-manager/CommitDetailsPage/components/CommitDetailsTab/CommitDetailsTab.tsx +++ b/frontend/src/pages/secret-manager/CommitDetailsPage/components/CommitDetailsTab/CommitDetailsTab.tsx @@ -1,5 +1,10 @@ import { useEffect, useState } from "react"; -import { faAngleDown, faCodeCommit, faWarning } from "@fortawesome/free-solid-svg-icons"; +import { + faAngleDown, + faChevronLeft, + faCodeCommit, + faWarning +} from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { DropdownMenuItem } from "@radix-ui/react-dropdown-menu"; import { useSearch } from "@tanstack/react-router"; @@ -244,6 +249,16 @@ export const CommitDetailsTab = ({ return ( <> + { - return ""; - }; - const prefix = isDifferent ? (isOldVersion ? " -" : " +") : " "; const keyDisplay = keyName ? `"${keyName}": ` : ""; const comma = !isLastItem ? "," : ""; @@ -257,8 +252,8 @@ const renderJsonWithDiffs = (
{prefix}
{indent} - {keyName && {keyDisplay}} - {valueDisplay} + {keyName && {keyDisplay}} + {valueDisplay} {comma}
@@ -271,8 +266,8 @@ const renderJsonWithDiffs = (
{prefix}
{indent} - {keyName && {keyDisplay}} - [] + {keyName && {keyDisplay}} + [] {comma}
@@ -285,8 +280,8 @@ const renderJsonWithDiffs = (
{prefix}
{indent} - {keyName && {keyDisplay}} - {"{}"} + {keyName && {keyDisplay}} + {"{}"} {comma}
@@ -326,12 +321,8 @@ const renderJsonWithDiffs = (
{indent} - {keyName && ( - - {keyDisplay} - - )} - [ + {keyName && {keyDisplay}} + [
@@ -363,7 +354,7 @@ const renderJsonWithDiffs = (
{indent} - ] + ] {comma}
@@ -382,12 +373,8 @@ const renderJsonWithDiffs = (
{indent} - {keyName && ( - - {keyDisplay} - - )} - {"{"} + {keyName && {keyDisplay}} + {"{"}
@@ -420,7 +407,7 @@ const renderJsonWithDiffs = (
{indent} - {"}"} + {"}"} {comma}
@@ -630,18 +617,18 @@ export const SecretVersionDiffView = ({
{showHeader && renderHeader()} {!collapsed && ( -
-
+
+
{oldVersionContent}
- +
{newVersionContent}