Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(frontend): dim inactive secret rows (#8230)

Andrew Huangd2d67f385727
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index 8b558421fd..5981e6f582 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -234,6 +234,11 @@ import { ImportSecretsSheet } from "./components/SecretDropzone";
import { SecretV2MigrationSection } from "./components/SecretV2MigrationSection";
import { MoveSecretsModal } from "./components/SelectionPanel/components";
import { SelectionPanel } from "./components/SelectionPanel/SelectionPanel";
+import {
+ getTableRowActivityId,
+ type TableRowActivityChangeHandler,
+ type TableRowActivityId
+} from "./components/tableRowActivity";
import {
DownloadEnvButton,
DynamicSecretTableRow,
@@ -633,6 +638,23 @@ const OverviewPageContent = () => {
const isProtectedBranch = Boolean(boardPolicy);
const isSingleEnvView = visibleEnvs.length === 1;
+ const [activeTableRows, setActiveTableRows] = useState<Set<TableRowActivityId>>(new Set());
+ const handleTableRowActivityChange = useCallback<TableRowActivityChangeHandler>(
+ (rowId, isActive) => {
+ setActiveTableRows((current) => {
+ if (current.has(rowId) === isActive) return current;
+
+ const next = new Set(current);
+ if (isActive) {
+ next.add(rowId);
+ } else {
+ next.delete(rowId);
+ }
+ return next;
+ });
+ },
+ []
+ );
const singleEnvSlug = isSingleEnvView ? visibleEnvs[0].slug : "";
const singleEnvName = isSingleEnvView ? visibleEnvs[0].name : "";
const visibleDynamicSecretEnvs = visibleEnvs.filter((env) =>
@@ -2234,6 +2256,11 @@ const OverviewPageContent = () => {
secrets?.length || folders?.length || secretRotationNames?.length
);
+ const hasSelectedEntriesOnPage =
+ mergedFolderNamesAndDescriptions.some(({ name }) => selectedEntries.folder[name]) ||
+ secretRotationNames.some((name) => selectedEntries.secretRotation[name]) ||
+ mergedSecKeys.some((key) => selectedEntries.secret[key]);
+
const allRowsSelectedOnPage = useMemo(() => {
if (!hasSelectableRows) return { isChecked: false, isIndeterminate: false };
@@ -3139,7 +3166,13 @@ const OverviewPageContent = () => {
)}
</TableRow>
</TableHeader>
- <TableBody className="transition-all duration-500">
+ <TableBody
+ className={twMerge(
+ "transition-all duration-500 [&>tr>td>*:not([data-table-row-filter-contents])]:transition-[filter] [&>tr>td>*:not([data-table-row-filter-contents])]:duration-200 motion-reduce:[&>tr>td>*:not([data-table-row-filter-contents])]:transition-none [&>tr>td>[data-table-row-filter-contents]>*:not([data-table-row-filter-positioner])]:transition-[filter] [&>tr>td>[data-table-row-filter-contents]>*:not([data-table-row-filter-positioner])]:duration-200 motion-reduce:[&>tr>td>[data-table-row-filter-contents]>*:not([data-table-row-filter-positioner])]:transition-none [&>tr>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:transition-[filter] [&>tr>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:duration-200 motion-reduce:[&>tr>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:transition-none [@media(hover:hover)]:[&>tr:hover>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:!filter-none",
+ (activeTableRows.size > 0 || hasSelectedEntriesOnPage) &&
+ "[&>tr>td>*:not([data-table-row-filter-contents])]:filter-[opacity(40%)] [&>tr>td>[data-table-row-filter-contents]>*:not([data-table-row-filter-positioner])]:filter-[opacity(40%)] [&>tr>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:filter-[opacity(40%)]"
+ )}
+ >
{showOverviewSkeleton ? (
Array.from({ length: prevPageSize.current || perPage }).map((_, index) => (
<TableRow className="group" key={`loading-row-${index + 1}`}>
@@ -3193,6 +3226,8 @@ const OverviewPageContent = () => {
}
importedSecrets={importedSecretsFlat}
isVisible={isSingleEnvSecretsVisible}
+ activityId={getTableRowActivityId("secret-import", imp.id)}
+ onActivityChange={handleTableRowActivityChange}
/>
))}
{!isSingleEnvView &&
@@ -3215,6 +3250,12 @@ const OverviewPageContent = () => {
}
importedSecrets={importedSecretsFlat}
isVisible={isSingleEnvSecretsVisible}
+ activityId={getTableRowActivityId(
+ "secret-import",
+ importEnvSlug,
+ importPath
+ )}
+ onActivityChange={handleTableRowActivityChange}
/>
)
)}
@@ -3331,6 +3372,11 @@ const OverviewPageContent = () => {
text: `Successfully authenticated to ${SECRET_ROTATION_MAP[secretRotation.type].name} with the current rotated credentials for ${secretRotation.name}`
});
}}
+ activityId={getTableRowActivityId(
+ "secret-rotation",
+ secretRotationName
+ )}
+ onActivityChange={handleTableRowActivityChange}
/>
))}
{honeyTokenNames.map((honeyTokenName, index) => (
@@ -3392,6 +3438,8 @@ const OverviewPageContent = () => {
onBatchRevert={handleBatchRevert}
isSelectionDisabled={hasPendingBatchChanges}
onCopySecret={handleCopySecret}
+ activityId={getTableRowActivityId("secret", key)}
+ onActivityChange={handleTableRowActivityChange}
/>
))}
<SecretNoAccessTableRow
@@ -3414,8 +3462,10 @@ const OverviewPageContent = () => {
!isTableEmpty && (
<QuickAddSecretRow
autoQueueOnBlur={isBatchModeActive}
+ activityId={getTableRowActivityId("quick-add", secretPath)}
environments={visibleEnvs.map((env) => env.slug)}
existingSecretKeys={mergedSecKeys}
+ onActivityChange={handleTableRowActivityChange}
saveLabel={quickAddSaveLabel}
onCreateSecret={(environment, key, value, comment) =>
handleSecretCreate(
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
index dea17c48e7..370cd9c3be 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderTableRow/FolderTableRow.tsx
@@ -25,7 +25,8 @@ import { pendingActionBorderClass, pendingActionRowClass } from "../pendingActio
import { ResourceEnvironmentStatusCell } from "../ResourceEnvironmentStatusCell";
import {
TABLE_ROW_ACTION_BAR_CLASS_NAME,
- TABLE_ROW_ACTION_BUTTON_CLASS_NAME
+ TABLE_ROW_ACTION_BUTTON_CLASS_NAME,
+ TABLE_ROW_ACTIVE_FILTER_CLASS_NAME
} from "../tableRowActionStyles";
type Props = {
@@ -80,7 +81,11 @@ export const FolderTableRow = ({
return (
<TableRow
- className={twMerge("group hover:z-10", pendingActionRowClass(pendingAction))}
+ className={twMerge(
+ "group hover:z-10",
+ isSelected && TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
+ pendingActionRowClass(pendingAction)
+ )}
onClick={handleClick}
>
<TableCell
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/QuickAddSecretRow/QuickAddSecretRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/QuickAddSecretRow/QuickAddSecretRow.tsx
index caa64f9ab2..896307039a 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/QuickAddSecretRow/QuickAddSecretRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/QuickAddSecretRow/QuickAddSecretRow.tsx
@@ -19,6 +19,9 @@ import {
} from "@app/components/v3";
import { useProject } from "@app/context";
+import { TABLE_ROW_ACTIVE_FILTER_CLASS_NAME } from "../tableRowActionStyles";
+import type { TableRowActivityChangeHandler, TableRowActivityId } from "../tableRowActivity";
+
type TParsedEnv = Record<string, { value: string; comments: string[] }>;
type Props = {
@@ -35,6 +38,8 @@ type Props = {
renderResourceTypeTrigger: (isDisabled: boolean) => ReactNode;
saveLabel?: string;
secretPath: string;
+ activityId: TableRowActivityId;
+ onActivityChange: TableRowActivityChangeHandler;
};
export const QuickAddSecretRow = ({
@@ -45,7 +50,9 @@ export const QuickAddSecretRow = ({
onPasteSecrets,
renderResourceTypeTrigger,
saveLabel,
- secretPath
+ secretPath,
+ activityId,
+ onActivityChange
}: Props) => {
const { currentProject } = useProject();
const rowRef = useRef<HTMLTableRowElement>(null);
@@ -56,6 +63,7 @@ export const QuickAddSecretRow = ({
const [value, setValue] = useState("");
const [comment, setComment] = useState("");
const [error, setError] = useState<string>();
+ const [isActive, setIsActive] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);
const [valueEditorStyle, setValueEditorStyle] = useState<CSSProperties>();
const isMultiEnvironmentView = environments.length > 1;
@@ -90,6 +98,17 @@ export const QuickAddSecretRow = ({
return () => resizeObserver.disconnect();
}, [isMultiEnvironmentView]);
+ useEffect(() => {
+ onActivityChange(activityId, isActive);
+ }, [activityId, isActive, onActivityChange]);
+
+ useEffect(
+ () => () => {
+ onActivityChange(activityId, false);
+ },
+ [activityId, onActivityChange]
+ );
+
const submitDraft = async ({ refocus = true }: { refocus?: boolean } = {}) => {
const normalizedKey = key.trim();
@@ -174,8 +193,13 @@ export const QuickAddSecretRow = ({
return (
<TableRow
ref={rowRef}
- className="group"
+ className={isActive ? `group ${TABLE_ROW_ACTIVE_FILTER_CLASS_NAME}` : "group"}
+ onFocusCapture={() => setIsActive(true)}
onBlurCapture={(event) => {
+ if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {
+ setIsActive(false);
+ }
+
if (
!autoQueueOnBlur ||
!isDraftActive ||
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx
index 036c526192..40292b088e 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx
@@ -55,12 +55,14 @@ import {
TABLE_ROW_ACTION_BAR_VISIBLE_CLASS_NAME,
TABLE_ROW_ACTION_BUTTON_CLASS_NAME,
TABLE_ROW_ACTION_BUTTON_VISIBLE_CLASS_NAME,
+ TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
TABLE_ROW_EXPAND_ICON_CLASS_NAME,
TABLE_ROW_EXPAND_ICON_TRANSITION_CLASS_NAME,
TABLE_ROW_EXPANDED_ICON_CLASS_NAME,
TABLE_ROW_NAME_HEADER_COLUMN_CLASS_NAME,
TABLE_ROW_RESOURCE_ICON_CLASS_NAME
} from "../tableRowActionStyles";
+import type { TableRowActivityChangeHandler, TableRowActivityId } from "../tableRowActivity";
import { SecretImportSecretRow } from "./SecretImportSecretRow";
type ImportedSecretData = {
@@ -89,6 +91,8 @@ type Props = {
index: number;
secretImport?: TSecretImport;
isVisible?: boolean;
+ activityId: TableRowActivityId;
+ onActivityChange: TableRowActivityChangeHandler;
};
export const SecretImportTableRow = ({
@@ -105,7 +109,9 @@ export const SecretImportTableRow = ({
importedSecrets,
index,
secretImport,
- isVisible
+ isVisible,
+ activityId,
+ onActivityChange
}: Props) => {
const [isExpanded, setIsExpanded] = useToggle(false);
const [selectedReplicationEnv, setSelectedReplicationEnv] = useState<string>("");
@@ -254,6 +260,17 @@ export const SecretImportTableRow = ({
}
}, [searchFilter, filteredImportedSecrets.length]);
+ useEffect(() => {
+ onActivityChange(activityId, isExpanded);
+ }, [activityId, isExpanded, onActivityChange]);
+
+ useEffect(
+ () => () => {
+ onActivityChange(activityId, false);
+ },
+ [activityId, onActivityChange]
+ );
+
useEffect(() => {
if (
hasAnyReplicatedImport &&
@@ -747,7 +764,11 @@ export const SecretImportTableRow = ({
<TableRow
ref={isSingleEnvView ? (sortableRef as React.Ref<HTMLTableRowElement>) : undefined}
onClick={handleRowClick}
- className={twMerge("group hover:z-10", isDragging && "opacity-50")}
+ className={twMerge(
+ "group hover:z-10",
+ isExpanded && TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
+ isDragging && "opacity-50"
+ )}
>
<TableCell
className={twMerge(
@@ -873,7 +894,10 @@ export const SecretImportTableRow = ({
{isExpanded &&
!isAnyDragging &&
(isSingleEnvView ? (
- <TableRow key={`expanded-import-row-${index}`} className="border-0 hover:bg-transparent">
+ <TableRow
+ key={`expanded-import-row-${index}`}
+ className={twMerge("border-0 hover:bg-transparent", TABLE_ROW_ACTIVE_FILTER_CLASS_NAME)}
+ >
<TableCell colSpan={totalCols} className="border-0 p-0">
<div
style={{ minWidth: tableWidth, maxWidth: tableWidth }}
@@ -884,7 +908,9 @@ export const SecretImportTableRow = ({
</TableCell>
</TableRow>
) : (
- <TableRow className="border-0 hover:bg-transparent">
+ <TableRow
+ className={twMerge("border-0 hover:bg-transparent", TABLE_ROW_ACTIVE_FILTER_CLASS_NAME)}
+ >
<TableCell colSpan={totalCols} className="border-0 p-0">
<div
style={{ minWidth: tableWidth, maxWidth: tableWidth }}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
index a6d17ce929..489a4dee91 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { subject } from "@casl/ability";
import {
ActivityIcon,
@@ -52,9 +52,11 @@ import {
TABLE_ROW_ACTION_BAR_VISIBLE_CLASS_NAME,
TABLE_ROW_ACTION_BUTTON_CLASS_NAME,
TABLE_ROW_ACTION_BUTTON_VISIBLE_CLASS_NAME,
+ TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
TABLE_ROW_NAME_CELL_COLUMN_CLASS_NAME,
TABLE_ROW_NAME_HEADER_COLUMN_CLASS_NAME
} from "../tableRowActionStyles";
+import type { TableRowActivityChangeHandler, TableRowActivityId } from "../tableRowActivity";
type Props = {
secretRotationName: string;
@@ -71,6 +73,8 @@ type Props = {
onViewGeneratedCredentials: (secretRotation: TSecretRotationV2) => void;
onDelete: (secretRotation: TSecretRotationV2) => void;
onCheckActiveCredentials: (secretRotation: TSecretRotationV2) => Promise<void> | void;
+ activityId: TableRowActivityId;
+ onActivityChange: TableRowActivityChangeHandler;
};
const shouldShowReconciliationButton = (secretRotation: TSecretRotationV2) =>
@@ -96,7 +100,9 @@ export const SecretRotationTableRow = ({
onViewGeneratedCredentials,
onDelete,
onReconcile,
- onCheckActiveCredentials
+ onCheckActiveCredentials,
+ activityId,
+ onActivityChange
}: Props) => {
const [isExpanded, setIsExpanded] = useToggle(false);
const [checkingRotationId, setCheckingRotationId] = useState<string | null>(null);
@@ -122,6 +128,17 @@ export const SecretRotationTableRow = ({
? getSecretRotationByName(singleEnvSlug, secretRotationName)
: undefined;
+ useEffect(() => {
+ onActivityChange(activityId, isExpanded);
+ }, [activityId, isExpanded, onActivityChange]);
+
+ useEffect(
+ () => () => {
+ onActivityChange(activityId, false);
+ },
+ [activityId, onActivityChange]
+ );
+
const renderActionButtons = (secretRotation: TSecretRotationV2) => {
const { environment, folder } = secretRotation;
@@ -323,7 +340,10 @@ export const SecretRotationTableRow = ({
<>
<TableRow
onClick={isSingleEnvView ? undefined : setIsExpanded.toggle}
- className="group hover:z-10"
+ className={twMerge(
+ "group hover:z-10",
+ (isExpanded || isSelected) && TABLE_ROW_ACTIVE_FILTER_CLASS_NAME
+ )}
>
<TableCell
className={twMerge(
@@ -441,7 +461,9 @@ export const SecretRotationTableRow = ({
})}
</TableRow>
{!isSingleEnvView && isExpanded && (
- <TableRow className="border-0 hover:bg-transparent">
+ <TableRow
+ className={twMerge("border-0 hover:bg-transparent", TABLE_ROW_ACTIVE_FILTER_CLASS_NAME)}
+ >
<TableCell colSpan={totalCols} className="border-0 p-0">
<div
style={{ minWidth: tableWidth, maxWidth: tableWidth }}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
index 33c69e9be6..c84af08ece 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
@@ -181,6 +181,7 @@ type Props = {
pendingKeyName?: string;
revokedProjectFolderGrant?: boolean;
onCopySecret?: () => void;
+ onExpandedChange?: (isExpanded: boolean) => void;
};
export const SecretEditTableRow = ({
@@ -219,7 +220,8 @@ export const SecretEditTableRow = ({
hasPendingValueChange,
pendingKeyName,
revokedProjectFolderGrant,
- onCopySecret
+ onCopySecret,
+ onExpandedChange
}: Props) => {
const { handlePopUpOpen, handlePopUpToggle, handlePopUpClose, popUp } = usePopUp([
"editSecret",
@@ -241,6 +243,10 @@ export const SecretEditTableRow = ({
const isFieldActive = isFieldFocused || isResolvedValueOpen;
const [isCopied, , setIsCopied] = useTimedReset<boolean>({ initialState: false });
+ useEffect(() => {
+ onExpandedChange?.(isFieldActive);
+ }, [isFieldActive, onExpandedChange]);
+
const fetchSharedValueParams =
importedSecret && !isSecretPresent
? {
@@ -964,10 +970,12 @@ export const SecretEditTableRow = ({
: event.currentTarget.value;
field.onChange(value);
}}
+ onFocus={() => setIsFieldFocused.on()}
onKeyDown={handleEditShortcut}
onBlur={(e) => {
field.onBlur();
if (!isBatchMode && field.onChange) field.onChange(e);
+ setIsFieldFocused.off();
}}
/>
)}
@@ -1176,6 +1184,7 @@ export const SecretEditTableRow = ({
!isBatchMode
) && (
<div
+ data-table-row-filter-positioner
onMouseEnter={() => setIsHoveringActionZone(true)}
onMouseLeave={() => setIsHoveringActionZone(false)}
className={twMerge(
@@ -1990,11 +1999,20 @@ export const SecretEditTableRow = ({
{nameInput}
</TableCell>
<TableCell className={twMerge("relative w-full", isOverride && "border-b-border/50")}>
- <div className="flex w-full flex-col gap-y-2">{valueContent}</div>
+ <div data-table-row-filter-contents className="flex w-full flex-col gap-y-2 !filter-none">
+ {valueContent}
+ </div>
</TableCell>
</>
);
}
- return <div className="relative flex w-full flex-col gap-y-2 py-1.5">{valueContent}</div>;
+ return (
+ <div
+ data-table-row-filter-contents
+ className="relative flex w-full flex-col gap-y-2 py-1.5 !filter-none"
+ >
+ {valueContent}
+ </div>
+ );
};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretOverrideRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretOverrideRow.tsx
index c1511da886..5ed2fb36b7 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretOverrideRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretOverrideRow.tsx
@@ -55,6 +55,7 @@ type Props = {
}) => Promise<void>;
onSecretDelete: (env: string, key: string, secretId?: string, type?: SecretType) => Promise<void>;
isSingleEnvView?: boolean;
+ onActiveChange?: (isActive: boolean) => void;
};
export const SecretOverrideRow = ({
@@ -70,7 +71,8 @@ export const SecretOverrideRow = ({
onSecretCreate,
onSecretUpdate,
onSecretDelete,
- isSingleEnvView
+ isSingleEnvView,
+ onActiveChange
}: Props) => {
const { currentProject } = useProject();
const { permission } = useProjectPermission();
@@ -194,8 +196,23 @@ export const SecretOverrideRow = ({
}
}, [isCreatingOverride]);
+ useEffect(
+ () => () => {
+ onActiveChange?.(false);
+ },
+ [onActiveChange]
+ );
+
return (
- <div className="flex w-full cursor-text items-center gap-2">
+ <div
+ className="flex w-full cursor-text items-center gap-2"
+ onFocusCapture={() => onActiveChange?.(true)}
+ onBlurCapture={(event) => {
+ if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {
+ onActiveChange?.(false);
+ }
+ }}
+ >
{!isSingleEnvView && (
<div className="flex shrink-0 items-center text-override">
<GitBranchIcon className="size-3.5" />
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
index c034e6b419..da384cda1f 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
@@ -55,9 +55,11 @@ import { EnvironmentStatus, ResourceEnvironmentStatusCell } from "../ResourceEnv
import {
TABLE_ROW_ACTION_BAR_CLASS_NAME,
TABLE_ROW_ACTION_BUTTON_CLASS_NAME,
+ TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
TABLE_ROW_NAME_CELL_COLUMN_CLASS_NAME,
TABLE_ROW_NAME_COLUMN_CLASS_NAME
} from "../tableRowActionStyles";
+import type { TableRowActivityChangeHandler, TableRowActivityId } from "../tableRowActivity";
import { SecretEditTableRow } from "./SecretEditTableRow";
import { SecretOverrideRow } from "./SecretOverrideRow";
import SecretRenameForm from "./SecretRenameForm";
@@ -114,6 +116,8 @@ type Props = {
source: { id: string; name: string; path: string; isValueHidden: boolean };
environmentSlug: string;
}) => void;
+ activityId: TableRowActivityId;
+ onActivityChange: TableRowActivityChangeHandler;
};
type ExpandedTableSortColumn = "environment";
@@ -141,20 +145,38 @@ export const SecretTableRow = ({
isBatchMode,
onBatchRevert,
isSelectionDisabled,
- onCopySecret
+ onCopySecret,
+ activityId,
+ onActivityChange
}: Props) => {
const [isFormExpanded, setIsFormExpanded] = useToggle();
const totalCols = environments.length + 2; // secret key row + icon
const [isSecretVisible, setIsSecretVisible] = useToggle();
const [isEditSecretNameOpen, setIsEditSecretNameOpen] = useState(false);
+ const [isSingleEnvBaseActive, setIsSingleEnvBaseActive] = useState(false);
+ const [isSingleEnvOverrideActive, setIsSingleEnvOverrideActive] = useState(false);
const [isSecNameCopied, setIsSecNameCopied] = useToggle(false);
const [creatingOverrideEnvs, setCreatingOverrideEnvs] = useState<Set<string>>(new Set());
const [expandedTableSort, setExpandedTableSort] = useState<ExpandedTableSort | null>(null);
const isSingleEnvView = environments.length === 1;
+ const isRowActive = isSingleEnvView
+ ? isSingleEnvBaseActive || isSingleEnvOverrideActive
+ : isFormExpanded;
const { projectId } = useProject();
const { mutateAsync: updateSecretV3ForRename } = useUpdateSecretV3();
+ useEffect(() => {
+ onActivityChange(activityId, isRowActive);
+ }, [activityId, isRowActive, onActivityChange]);
+
+ useEffect(
+ () => () => {
+ onActivityChange(activityId, false);
+ },
+ [activityId, onActivityChange]
+ );
+
// Pre-compute single-env data
const singleEnvSlug = isSingleEnvView ? environments[0].slug : "";
const singleEnvName = isSingleEnvView ? environments[0].name : "";
@@ -274,7 +296,12 @@ export const SecretTableRow = ({
<>
<TableRow
onClick={isSingleEnvView ? undefined : () => setIsFormExpanded.toggle()}
- className={twMerge("group hover:z-10", pendingActionRowClass(singleEnvPendingAction))}
+ className={twMerge(
+ "group hover:z-10",
+ (isSingleEnvView ? isSingleEnvBaseActive || isSelected : isRowActive || isSelected) &&
+ TABLE_ROW_ACTIVE_FILTER_CLASS_NAME,
+ pendingActionRowClass(singleEnvPendingAction)
+ )}
>
<TableCell
className={twMerge(
@@ -402,6 +429,7 @@ export const SecretTableRow = ({
})
: undefined
}
+ onExpandedChange={setIsSingleEnvBaseActive}
/>
) : (
<TableCell
@@ -479,7 +507,13 @@ export const SecretTableRow = ({
)}
{environments.length > 1 &&
environments.map(({ slug }, i) => {
- if (isFormExpanded) return <TableCell className="border-b-0 bg-container-hover" />;
+ if (isFormExpanded)
+ return (
+ <TableCell
+ key={`sec-overview-${slug}-${i + 1}-expanded`}
+ className="border-b-0 bg-container-hover"
+ />
+ );
const secret = getSecretByKey(slug, secretKey);
@@ -510,7 +544,12 @@ export const SecretTableRow = ({
})}
</TableRow>
{isSingleEnvView && singleEnvShowOverride && (
- <TableRow className="group bg-gradient-to-r from-override/[0.03] from-[1%] via-override/[0.075] to-override/[0.03] to-[99%]">
+ <TableRow
+ className={twMerge(
+ "group bg-gradient-to-r from-override/[0.03] from-[1%] via-override/[0.075] to-override/[0.03] to-[99%]",
+ (isSingleEnvOverrideActive || isSelected) && TABLE_ROW_ACTIVE_FILTER_CLASS_NAME
+ )}
+ >
<TableCell>
<GitBranchIcon className="text-override" />
</TableCell>
@@ -520,7 +559,7 @@ export const SecretTableRow = ({
singleEnvHasOverride && "border-l border-l-override"
)}
>
- {secretKey}
+ <span>{secretKey}</span>
</TableCell>
<TableCell>
<SecretOverrideRow
@@ -547,6 +586,7 @@ export const SecretTableRow = ({
onSecretCreate={onSecretCreate}
onSecretUpdate={onSecretUpdate}
onSecretDelete={onSecretDelete}
+ onActiveChange={setIsSingleEnvOverrideActive}
/>
</TableCell>
</TableRow>
@@ -567,7 +607,9 @@ export const SecretTableRow = ({
</Dialog>
)}
{!isSingleEnvView && isFormExpanded && (
- <TableRow className="border-0 hover:bg-transparent">
+ <TableRow
+ className={twMerge("border-0 hover:bg-transparent", TABLE_ROW_ACTIVE_FILTER_CLASS_NAME)}
+ >
<TableCell colSpan={totalCols} className="border-0 p-0">
<div
style={{ minWidth: tableWidth, maxWidth: tableWidth }}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActionStyles.ts b/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActionStyles.ts
index 9efe02f64f..2a3781411f 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActionStyles.ts
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActionStyles.ts
@@ -23,6 +23,9 @@ export const TABLE_ROW_EXPAND_ICON_CLASS_NAME = `block ${TABLE_ROW_EXPAND_ICON_T
export const TABLE_ROW_EXPANDED_ICON_CLASS_NAME = `block rotate-90 ${TABLE_ROW_EXPAND_ICON_TRANSITION_CLASS_NAME}`;
+export const TABLE_ROW_ACTIVE_FILTER_CLASS_NAME =
+ "[&>td>*]:!filter-none [&>td>[data-table-row-filter-contents]>*]:!filter-none [&>td>[data-table-row-filter-contents]>[data-table-row-filter-positioner]>*]:!filter-none";
+
export const TABLE_ROW_NAME_COLUMN_CLASS_NAME =
"w-60 max-w-60 min-w-60 lg:w-96 lg:max-w-96 lg:min-w-96";
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActivity.ts b/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActivity.ts
new file mode 100644
index 0000000000..dd05f5f58c
--- /dev/null
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/tableRowActivity.ts
@@ -0,0 +1,10 @@
+export type TableRowActivityType = "quick-add" | "secret" | "secret-import" | "secret-rotation";
+
+export type TableRowActivityId = `${TableRowActivityType}:${string}`;
+
+export type TableRowActivityChangeHandler = (rowId: TableRowActivityId, isActive: boolean) => void;
+
+export const getTableRowActivityId = (
+ type: TableRowActivityType,
+ ...identity: string[]
+): TableRowActivityId => `${type}:${JSON.stringify(identity)}`;