Skip to content

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

fix(secrets-overview): keep row action bar visible while a focused row is hovered (#8696)

Andrew Huang6474099b7ffe
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 359eb956e4..3fd098b72f 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx
@@ -1105,8 +1105,19 @@ export const SecretEditTableRow = ({
const shouldStayExpanded =
isCommentOpen || isTagOpen || isMetadataOpen || isReminderOpen || isDropdownOpen;
- const [isHoveringActionZone, setIsHoveringActionZone] = useState(false);
- const showMenuWhileFocused = isHoveringActionZone || shouldStayExpanded;
+ const [actionBarWidth, setActionBarWidth] = useState(0);
+ const actionBarResizeObserverRef = useRef<ResizeObserver | null>(null);
+ const actionBarRef = useCallback((node: HTMLDivElement | null) => {
+ actionBarResizeObserverRef.current?.disconnect();
+ actionBarResizeObserverRef.current = null;
+ if (!node) {
+ setActionBarWidth(0);
+ return;
+ }
+ const observer = new ResizeObserver(() => setActionBarWidth(node.offsetWidth));
+ observer.observe(node);
+ actionBarResizeObserverRef.current = observer;
+ }, []);
const getTooltipContentForSecretSharing = () => {
if (!currentProject.secretSharing) {
@@ -1234,6 +1245,7 @@ export const SecretEditTableRow = ({
isFieldActive && !isBatchMode && "pr-16",
isFieldActive && isBatchMode && "pr-6"
)}
+ style={isFieldActive && actionBarWidth ? { paddingRight: actionBarWidth } : undefined}
>
{isFieldActive && !secretValueHidden && !isCreatable && secretHasReference && (
<ResolvedSecretValuePopover
@@ -1378,24 +1390,6 @@ export const SecretEditTableRow = ({
)}
</ProjectPermissionCan>
)}
- {isFieldActive &&
- !(
- isDirty &&
- (dirtyFields.key || dirtyFields.value) &&
- !isImportedSecret &&
- !isBatchMode
- ) && (
- <div
- className={twMerge(
- "absolute top-0 bottom-0 z-10 flex w-8 cursor-pointer items-start justify-center",
- isSingleEnvView ? "right-0 pt-[11px] pr-[6px]" : "-right-3 pt-[8px] pr-[12px]"
- )}
- onMouseEnter={() => setIsHoveringActionZone(true)}
- onMouseLeave={() => setIsHoveringActionZone(false)}
- >
- <EllipsisIcon className="animate-fade-in text-muted-foreground/40 size-4" />
- </div>
- )}
{!(
isDirty &&
(dirtyFields.key || dirtyFields.value) &&
@@ -1403,18 +1397,13 @@ export const SecretEditTableRow = ({
!isBatchMode
) && (
<div
+ ref={actionBarRef}
data-table-row-filter-positioner
- onMouseEnter={() => setIsHoveringActionZone(true)}
- onMouseLeave={() => setIsHoveringActionZone(false)}
className={twMerge(
"absolute z-20",
"flex items-center gap-0.5 rounded-md border border-border bg-container-hover px-0.5 py-0.5 shadow-md",
TABLE_ROW_ACTION_BAR_VISIBILITY_CLASS_NAME,
shouldStayExpanded && TABLE_ROW_ACTION_BAR_FORCE_VISIBLE_CLASS_NAME,
- isFieldActive &&
- !showMenuWhileFocused &&
- "[@media(hover:hover)]:group-hover:pointer-events-none [@media(hover:hover)]:group-hover:opacity-0",
- isFieldActive && showMenuWhileFocused && TABLE_ROW_ACTION_BAR_FORCE_VISIBLE_CLASS_NAME,
isSingleEnvView ? "top-[3px] right-0.5" : "-top-px -right-1.5"
)}
>