Skip to content

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

fix(frontend): stop secrets overview re-rendering every row while resizing (#8543)

Andrew Huang8e28188e2faf
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index f8e24ad621..faedb245a4 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -1,4 +1,12 @@
-import { SetStateAction, useCallback, useEffect, useMemo, useRef, useState } from "react";
+import {
+ SetStateAction,
+ useCallback,
+ useEffect,
+ useLayoutEffect,
+ useMemo,
+ useRef,
+ useState
+} from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { subject } from "@casl/ability";
@@ -2674,27 +2682,35 @@ const OverviewPageContent = () => {
// localStorage.setItem("overview-header-height", debouncedHeaderHeight.toString());
// }, [debouncedHeaderHeight]);
- const [tableWidth, setTableWidth] = useState(0);
const [storedColumnWidths, setStoredColumnWidths] = useLocalStorageState<
Record<string, number[]>
>(`overview-column-widths-${projectId}`, {});
- const columnResize = useRef<{ index: number; startX: number; widths: number[] } | null>(null);
+ const columnResize = useRef<{
+ index: number;
+ startX: number;
+ widths: number[];
+ next?: number[];
+ handle: HTMLElement;
+ columnKey: string;
+ } | null>(null);
const columnKey = `${isSingleEnvView ? "single" : "multi"}:${visibleEnvs.map(({ id }) => id).join(":")}`;
- const nameMaxWidth = Math.max(isSingleEnvView ? 280 : 240, tableWidth * 0.8);
const columnMinWidths = isSingleEnvView ? [280, 368] : Array(visibleEnvs.length + 1).fill(240);
const minColumnTotal = columnMinWidths.reduce((total, width) => total + width, 0);
const savedWidths = storedColumnWidths?.[columnKey];
- const columnWidths = (() => {
+ const getNameMaxWidth = (tableWidth: number) =>
+ Math.max(isSingleEnvView ? 280 : 240, tableWidth * 0.8);
+
+ const getColumnWidths = (tableWidth: number, saved: number[] | undefined) => {
const hasSavedWidths =
- Array.isArray(savedWidths) &&
- savedWidths.length === columnMinWidths.length &&
- savedWidths.every((width) => Number.isFinite(width) && width > 0);
+ Array.isArray(saved) &&
+ saved.length === columnMinWidths.length &&
+ saved.every((width) => Number.isFinite(width) && width > 0);
const defaultWidth =
tableWidth >= 40 + minColumnTotal ? (tableWidth - 40) / columnMinWidths.length : 0;
const widths = columnMinWidths.map((minWidth, index) =>
Math.min(
- index === 0 ? nameMaxWidth : Infinity,
- Math.max(minWidth, hasSavedWidths ? savedWidths[index] : defaultWidth)
+ index === 0 ? getNameMaxWidth(tableWidth) : Infinity,
+ Math.max(minWidth, hasSavedWidths ? saved[index] : defaultWidth)
)
);
if (tableWidth < 40 + minColumnTotal) return widths;
@@ -2710,16 +2726,35 @@ const OverviewPageContent = () => {
excess -= shrink;
}
return widths;
- })();
+ };
+
+ // Column and table widths are written to the DOM directly so resizing a column or the
+ // page doesn't re-render every row on each frame
+ const applyColumnWidths = (
+ saved: number[] | undefined,
+ tableWidth = tableRef.current?.clientWidth ?? 0
+ ) => {
+ const element = tableRef.current;
+ const table = element?.querySelector<HTMLTableElement>(":scope > table");
+ if (!element || !table) return;
+ const widths = getColumnWidths(tableWidth, saved);
+ element.style.setProperty("--overview-table-width", `${tableWidth}px`);
+ element.style.setProperty("--name-column-width", `${widths[0]}px`);
+ table.querySelectorAll<HTMLTableColElement>(":scope > colgroup > col").forEach((col, index) => {
+ if (index > 0) col.style.setProperty("width", `${widths[index - 1]}px`);
+ });
+ table.style.width = `max(100%, ${40 + widths.reduce((total, width) => total + width, 0)}px)`;
+ };
const getCurrentColumnWidths = () =>
Array.from(tableRef.current?.querySelectorAll(":scope > table > thead > tr > th") ?? [])
.slice(1)
.map((header) => header.getBoundingClientRect().width);
- const resizeColumns = (widths: number[], index: number, delta: number) => {
+ const getResizedColumnWidths = (widths: number[], index: number, delta: number) => {
const next = [...widths];
- const availableWidth = (tableRef.current?.clientWidth ?? 40) - 40;
+ const tableWidth = tableRef.current?.clientWidth ?? 40;
+ const availableWidth = tableWidth - 40;
const spareWidth = Math.max(
0,
availableWidth - widths.reduce((total, width) => total + width, 0)
@@ -2730,7 +2765,7 @@ const OverviewPageContent = () => {
Math.min(
widths[index] + delta,
availableWidth >= minColumnTotal ? widths[index] + maxGrowth : Infinity,
- index === 0 ? nameMaxWidth : Infinity
+ index === 0 ? getNameMaxWidth(tableWidth) : Infinity
)
);
next[index] = left;
@@ -2746,9 +2781,12 @@ const OverviewPageContent = () => {
widths[index + 1] - (left - widths[index])
);
}
- setStoredColumnWidths((current) => ({ ...current, [columnKey]: next }));
+ return next;
};
+ const saveColumnWidths = (widths: number[]) =>
+ setStoredColumnWidths((current) => ({ ...current, [columnKey]: widths }));
+
const resizeHandle = (index: number) => (
<button
type="button"
@@ -2762,29 +2800,40 @@ const OverviewPageContent = () => {
columnResize.current = {
index,
startX: event.clientX,
- widths: getCurrentColumnWidths()
+ widths: getCurrentColumnWidths(),
+ handle: event.currentTarget,
+ columnKey
};
event.currentTarget.setPointerCapture(event.pointerId);
}}
onPointerMove={(event) => {
if (!columnResize.current) return;
if (Math.abs(event.clientX - columnResize.current.startX) < 3) return;
- resizeColumns(
+ columnResize.current.next = getResizedColumnWidths(
columnResize.current.widths,
columnResize.current.index,
event.clientX - columnResize.current.startX
);
+ applyColumnWidths(columnResize.current.next);
}}
onPointerUp={() => {
+ if (columnResize.current?.next) saveColumnWidths(columnResize.current.next);
columnResize.current = null;
}}
onPointerCancel={() => {
columnResize.current = null;
+ applyColumnWidths(savedWidths);
}}
onKeyDown={(event) => {
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
event.preventDefault();
- resizeColumns(getCurrentColumnWidths(), index, event.key === "ArrowRight" ? 16 : -16);
+ saveColumnWidths(
+ getResizedColumnWidths(
+ getCurrentColumnWidths(),
+ index,
+ event.key === "ArrowRight" ? 16 : -16
+ )
+ );
}}
>
<span className="pointer-events-none absolute top-0 left-0 h-full w-full group-focus-visible:outline-2 group-focus-visible:outline-ring" />
@@ -2812,34 +2861,6 @@ const OverviewPageContent = () => {
if (!isOverviewPending) prevPageSize.current = Math.min(perPage, totalCount);
}, [isOverviewPending, totalCount, perPage]);
- useEffect(() => {
- const element = tableRef.current;
- if (!element) return;
- const table = element.querySelector<HTMLTableElement>(":scope > table");
- const nameHeader = table?.querySelector("thead > tr > th:nth-child(2)");
-
- const handleResize = () => {
- setTableWidth(element.clientWidth);
- if (nameHeader) {
- element.style.setProperty(
- "--name-column-width",
- `${nameHeader.getBoundingClientRect().width}px`
- );
- }
- };
-
- const resizeObserver = new ResizeObserver(handleResize);
- resizeObserver.observe(element);
- if (table) resizeObserver.observe(table);
- if (nameHeader) resizeObserver.observe(nameHeader);
- handleResize();
-
- // eslint-disable-next-line consistent-return
- return () => {
- resizeObserver.disconnect();
- };
- }, [tableRef, isTableEmpty]);
-
// This is needed to also show imports from other paths – right now those are missing.
// const combinedKeys = [...secKeys, ...secretImports.map((impSecrets) => impSecrets?.data?.map((impSec) => impSec.secrets?.map((impSecKey) => impSecKey.key))).flat().flat()];
@@ -2856,6 +2877,26 @@ const OverviewPageContent = () => {
})();
const isTableVisible = tableView !== "no-environments";
+ useLayoutEffect(() => {
+ const element = tableRef.current;
+ if (!element) return;
+
+ // Sizes come from the observer entry: reading layout here would force an extra full-table
+ // layout on every frame of a sidebar or window resize
+ const resizeObserver = new ResizeObserver(([entry]) => {
+ if (!columnResize.current) applyColumnWidths(savedWidths, entry.contentRect.width);
+ });
+ resizeObserver.observe(element);
+ applyColumnWidths(savedWidths);
+
+ // eslint-disable-next-line consistent-return
+ return () => {
+ resizeObserver.disconnect();
+ if (!columnResize.current?.handle.isConnected || columnResize.current.columnKey !== columnKey)
+ columnResize.current = null;
+ };
+ }, [tableRef, tableView, isTableEmpty, columnKey, savedWidths?.join(",")]);
+
let quickAddSaveLabel: string | undefined;
if (isBatchModeActive) quickAddSaveLabel = "Add Pending Change";
else if (visibleEnvs.length > 1) quickAddSaveLabel = "Add to all environments";
@@ -3184,23 +3225,12 @@ const OverviewPageContent = () => {
ref={tableRef}
className="w-full table-fixed border-separate border-spacing-0 [&_tbody>tr>td:nth-child(2)]:pl-1 [&_thead>tr>th:nth-child(2)>button]:pl-1"
containerClassName="overscroll-x-none rounded-t-none"
- style={{
- minWidth: 40 + minColumnTotal,
- width: columnWidths
- ? `max(100%, ${40 + columnWidths.reduce((total, width) => total + width, 0)}px)`
- : undefined
- }}
+ style={{ minWidth: 40 + minColumnTotal }}
>
<colgroup>
<col className="w-10" />
- <col style={{ width: columnWidths?.[0] }} />
- {isSingleEnvView ? (
- <col style={{ width: columnWidths?.[1] }} />
- ) : (
- visibleEnvs.map(({ id }, index) => (
- <col key={id} style={{ width: columnWidths?.[index + 1] }} />
- ))
- )}
+ <col />
+ {isSingleEnvView ? <col /> : visibleEnvs.map(({ id }) => <col key={id} />)}
</colgroup>
<TableHeader className="relative z-20">
<TableRow className="h-10 has-[>th:nth-child(2):hover]:[&>th:nth-child(-n+2)]:bg-container-hover">
@@ -3586,7 +3616,6 @@ const OverviewPageContent = () => {
environments={visibleEnvs}
isSecretImportInEnv={isSecretImportInEnv}
getSecretImportByEnv={getSecretImportByEnv}
- tableWidth={tableWidth}
secretPath={secretPath}
searchFilter={searchFilter}
onDelete={(secretImport) =>
@@ -3610,7 +3639,6 @@ const OverviewPageContent = () => {
environments={visibleEnvs}
isSecretImportInEnv={isSecretImportInEnv}
getSecretImportByEnv={getSecretImportByEnv}
- tableWidth={tableWidth}
secretPath={secretPath}
searchFilter={searchFilter}
onDelete={(secretImport) =>
@@ -3671,7 +3699,6 @@ const OverviewPageContent = () => {
getDynamicSecretByName={getDynamicSecretByName}
getDynamicSecretStatusesByName={getDynamicSecretStatusesByName}
environments={visibleEnvs}
- tableWidth={tableWidth}
secretPath={secretPath}
key={`overview-${dynamicSecretName}-${index + 1}`}
onEdit={(dynamicSecret) =>
@@ -3702,7 +3729,6 @@ const OverviewPageContent = () => {
getSecretRotationByName={getSecretRotationByName}
getSecretRotationStatusesByName={getSecretRotationStatusesByName}
key={`overview-${secretRotationName}-${index + 1}`}
- tableWidth={tableWidth}
isSelected={Boolean(selectedEntries.secretRotation[secretRotationName])}
onToggleRotationSelect={(_, isShiftKey) =>
toggleSelectedEntry(
@@ -3753,7 +3779,6 @@ const OverviewPageContent = () => {
isHoneyTokenInEnv={isHoneyTokenPresentInEnv}
environments={visibleEnvs}
getHoneyTokenByName={getHoneyTokenByName}
- tableWidth={tableWidth}
key={`overview-ht-${honeyTokenName}-${index + 1}`}
onEdit={(honeyToken) => handlePopUpOpen("editHoneyToken", honeyToken)}
onRevoke={(honeyToken) =>
@@ -3771,7 +3796,6 @@ const OverviewPageContent = () => {
environments={visibleEnvs}
isProxiedServiceInEnv={isProxiedServicePresentInEnv}
getProxiedServiceByName={getProxiedServiceByName}
- tableWidth={tableWidth}
onEdit={(proxiedService) =>
handlePopUpOpen("editProxiedService", proxiedService)
}
@@ -3790,7 +3814,6 @@ const OverviewPageContent = () => {
toggleSelectedEntry(EntryType.SECRET, key, isShiftKey);
}}
secretPath={secretPath}
- tableWidth={tableWidth}
getImportedSecretByKey={getImportedSecretByKey}
isImportedSecretPresentInEnv={handleIsImportedSecretPresentInEnv}
onSecretCreate={handleSecretCreate}
@@ -3888,7 +3911,7 @@ const OverviewPageContent = () => {
<DragOverlay
tag="table"
className="w-full caption-bottom text-sm"
- style={{ width: tableWidth }}
+ style={{ width: tableRef.current?.clientWidth }}
>
{null}
</DragOverlay>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/DynamicSecretTableRow/DynamicSecretTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/DynamicSecretTableRow/DynamicSecretTableRow.tsx
index 7a2034a2f3..775adcd9a6 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/DynamicSecretTableRow/DynamicSecretTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/DynamicSecretTableRow/DynamicSecretTableRow.tsx
@@ -51,7 +51,6 @@ type Props = {
getDynamicSecretStatusesByName: (
name: string
) => (DynamicSecretStatus | null | undefined)[] | undefined;
- tableWidth: number;
secretPath: string;
onEdit: (dynamicSecret: DynamicSecretWithEnv) => void;
onGenerateLease: (dynamicSecret: DynamicSecretWithEnv) => void;
@@ -66,7 +65,6 @@ export const DynamicSecretTableRow = ({
isDynamicSecretInEnv,
getDynamicSecretByName,
getDynamicSecretStatusesByName,
- tableWidth,
secretPath,
onEdit,
onGenerateLease,
@@ -367,10 +365,7 @@ export const DynamicSecretTableRow = ({
{!isSingleEnvView && isExpanded && (
<TableRow className="border-0 hover:bg-transparent">
<TableCell colSpan={totalCols} className="border-0 p-0">
- <div
- style={{ minWidth: tableWidth, maxWidth: tableWidth }}
- className="sticky left-0 border-y border-border"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border">
<Table
className="w-full min-w-[calc(var(--name-column-width,180px)+24rem)] table-fixed"
containerClassName="rounded-none border-0"
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
index 406800c93a..0b5a85eecb 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
@@ -96,6 +96,7 @@ export function FolderBreadcrumb({ secretPath = "" }: Props) {
// Initial measurement and re-measure on path change
useEffect(() => {
measureElements();
+ document.fonts.ready.then(measureElements).catch(() => {});
}, [measureElements, folderPaths]);
// Track container width with ResizeObserver
@@ -103,14 +104,19 @@ export function FolderBreadcrumb({ secretPath = "" }: Props) {
const element = containerRef.current;
if (!element) return () => {};
- const observer = new ResizeObserver(() => {
- measureElements();
+ // The observer entry carries the new width; re-measuring here would force a layout of the
+ // whole page on every resize frame
+ const observer = new ResizeObserver(([entry]) => {
+ const containerWidth = entry.borderBoxSize[0].inlineSize;
+ setMeasurements((prev) =>
+ prev.containerWidth === containerWidth ? prev : { ...prev, containerWidth }
+ );
});
observer.observe(element);
return () => {
observer.disconnect();
};
- }, [measureElements]);
+ }, []);
// Calculate visible segments based on actual measurements
const { startCount, endCount, needsEllipsis } = useMemo(() => {
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
index 2f1f9b875b..52c723dd23 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
@@ -65,7 +65,6 @@ type Props = {
environments: { name: string; slug: string }[];
isHoneyTokenInEnv: (name: string, env: string) => boolean;
getHoneyTokenByName: (slug: string, name: string) => TDashboardHoneyToken | undefined;
- tableWidth: number;
onEdit: (honeyToken: TDashboardHoneyToken) => void;
onRevoke: (honeyToken: TDashboardHoneyToken) => void;
onViewDetails: (honeyToken: TDashboardHoneyToken) => void;
@@ -76,7 +75,6 @@ export const HoneyTokenTableRow = ({
environments = [],
isHoneyTokenInEnv,
getHoneyTokenByName,
- tableWidth,
onEdit,
onRevoke,
onViewDetails
@@ -366,10 +364,7 @@ export const HoneyTokenTableRow = ({
{!isSingleEnvView && isExpanded && (
<TableRow className="border-0 hover:bg-transparent">
<TableCell colSpan={totalCols} className="border-0 p-0">
- <div
- style={{ minWidth: tableWidth, maxWidth: tableWidth }}
- className="sticky left-0 border-y border-border"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border">
<Table
className="w-full min-w-[calc(var(--name-column-width,180px)+24rem)] table-fixed"
containerClassName="rounded-none border-0"
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/ProxiedServiceTableRow/ProxiedServiceTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/ProxiedServiceTableRow/ProxiedServiceTableRow.tsx
index 8f0a8c8669..2fff3c3a7a 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/ProxiedServiceTableRow/ProxiedServiceTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/ProxiedServiceTableRow/ProxiedServiceTableRow.tsx
@@ -56,7 +56,6 @@ type Props = {
environments: { name: string; slug: string }[];
isProxiedServiceInEnv: (name: string, env: string) => boolean;
getProxiedServiceByName: (slug: string, name: string) => TDashboardProxiedService | undefined;
- tableWidth: number;
onEdit: (proxiedService: TDashboardProxiedService) => void;
onDelete: (proxiedService: TDashboardProxiedService) => void;
};
@@ -66,7 +65,6 @@ export const ProxiedServiceTableRow = ({
environments = [],
isProxiedServiceInEnv,
getProxiedServiceByName,
- tableWidth,
onEdit,
onDelete
}: Props) => {
@@ -259,10 +257,7 @@ export const ProxiedServiceTableRow = ({
{!isSingleEnvView && isExpanded && (
<TableRow className="border-0 hover:bg-transparent">
<TableCell colSpan={totalCols} className="border-0 p-0">
- <div
- style={{ minWidth: tableWidth, maxWidth: tableWidth }}
- className="sticky left-0 border-y border-border"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border">
<Table
className="w-full min-w-[calc(var(--name-column-width,180px)+24rem)] table-fixed"
containerClassName="rounded-none border-0"
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 597b111410..3be1085cc5 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretImportTableRow/SecretImportTableRow.tsx
@@ -83,7 +83,6 @@ type Props = {
importPath: string,
env: string
) => TSecretImport | undefined;
- tableWidth: number;
secretPath: string;
searchFilter: string;
onDelete: (secretImport: TSecretImport) => void;
@@ -102,7 +101,6 @@ export const SecretImportTableRow = ({
environments = [],
isSecretImportInEnv,
getSecretImportByEnv,
- tableWidth,
secretPath,
searchFilter,
onDelete,
@@ -914,10 +912,7 @@ export const SecretImportTableRow = ({
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 }}
- className="sticky left-0 border-b border-border bg-container"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-b border-border bg-container">
{renderExpandedSecrets(singleEnvSlug)}
</div>
</TableCell>
@@ -927,10 +922,7 @@ export const SecretImportTableRow = ({
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 }}
- className="sticky left-0 border-y border-border bg-container"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border bg-container">
<div className="flex min-h-10 flex-wrap items-center gap-2 border-b border-border px-3 py-1.5 pl-11">
<span className="text-xs text-muted">Imported in:</span>
{environments
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 ee3ec0c40c..30b797c4cb 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretRotationTableRow/SecretRotationTableRow.tsx
@@ -64,7 +64,6 @@ type Props = {
isSecretRotationInEnv: (name: string, env: string) => boolean;
getSecretRotationByName: (slug: string, name: string) => TSecretRotationV2 | undefined;
getSecretRotationStatusesByName: (name: string) => (SecretRotationStatus | null)[] | undefined;
- tableWidth: number;
isSelected: boolean;
onToggleRotationSelect: (name: string, isShiftKey: boolean) => void;
onEdit: (secretRotation: TSecretRotationV2) => void;
@@ -90,7 +89,6 @@ export const SecretRotationTableRow = ({
secretRotationName,
environments = [],
isSecretRotationInEnv,
- tableWidth,
getSecretRotationByName,
getSecretRotationStatusesByName,
isSelected,
@@ -465,10 +463,7 @@ export const SecretRotationTableRow = ({
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 }}
- className="sticky left-0 border-y border-border"
- >
+ <div className="sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border">
<Table
className="w-full min-w-[calc(var(--name-column-width,180px)+24rem)] table-fixed"
containerClassName="rounded-none border-0"
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 0acd30434d..c4ae8987b9 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretTableRow.tsx
@@ -67,7 +67,6 @@ import SecretRenameForm from "./SecretRenameForm";
type Props = {
secretKey: string;
secretPath: string;
- tableWidth: number;
environments: { name: string; slug: string }[];
isSelected: boolean;
onToggleSecretSelect: (key: string, isShiftKey: boolean) => void;
@@ -130,7 +129,6 @@ type ExpandedTableSort = {
export const SecretTableRow = ({
secretKey,
- tableWidth,
environments = [],
secretPath,
getSecretByKey,
@@ -433,9 +431,9 @@ export const SecretTableRow = ({
)}
>
<div
- style={isFormExpanded ? { minWidth: tableWidth, maxWidth: tableWidth } : undefined}
className={twMerge(
- isFormExpanded && "sticky left-0 flex min-h-10 items-center bg-container-hover"
+ isFormExpanded &&
+ "sticky left-0 flex min-h-10 max-w-(--overview-table-width) min-w-(--overview-table-width) items-center bg-container-hover"
)}
>
{isFormExpanded && (
@@ -622,16 +620,10 @@ export const SecretTableRow = ({
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 }}
- className="sticky left-0 border-y border-border bg-container"
- >
+ <div className="@container sticky left-0 max-w-(--overview-table-width) min-w-(--overview-table-width) border-y border-border bg-container">
<Table
className="w-full min-w-[600px] table-fixed"
- containerClassName={twMerge(
- "rounded-none border-0",
- tableWidth >= 600 && "overflow-hidden"
- )}
+ containerClassName="rounded-none border-0 @min-[600px]:overflow-hidden"
>
<colgroup>
<col className="w-10" />