Skip to content

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

improvement(ui): refine secrets overview header (#8201)

Andrew Huang1bf8ac3c1901
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index b0b4de49fe..bcf989da36 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -2662,57 +2662,49 @@ const OverviewPageContent = () => {
<Card className="min-w-0">
<CardHeader className="min-w-0">
<div className="flex min-w-0 flex-col gap-2">
- <div className="flex min-w-0 items-center justify-between gap-2">
- <div className="flex min-w-0 flex-1 items-center overflow-hidden px-1 whitespace-nowrap">
- <FolderBreadcrumb
- secretPath={secretPath}
- onManageFolderAccess={
- canManageCurrentFolderAccess ? handleCurrentFolderAccessOpen : undefined
- }
- />
- </div>
- {userAvailableEnvs.length > 0 && (
- <div className="shrink-0">
- <AddResourceButtons {...addResourceButtonsProps} />
+ <div className="grid min-w-0 grid-cols-1 gap-2 md:grid-cols-[minmax(0,1fr)_auto]">
+ <div className="flex min-w-0 flex-wrap items-center gap-2 md:flex-nowrap">
+ <div className="max-w-full shrink-0">
+ <EnvironmentSelect
+ selectedEnvs={filteredEnvs}
+ setSelectedEnvs={setFilteredEnvs}
+ isDisabled={
+ isBatchModeActive &&
+ (pendingChanges.secrets.length > 0 || pendingChanges.folders.length > 0)
+ }
+ />
</div>
- )}
- </div>
- <div className="flex min-w-0 flex-wrap items-center gap-2">
- <div className="max-w-full shrink-0">
- <EnvironmentSelect
- selectedEnvs={filteredEnvs}
- setSelectedEnvs={setFilteredEnvs}
- isDisabled={
- isBatchModeActive &&
- (pendingChanges.secrets.length > 0 || pendingChanges.folders.length > 0)
- }
+ <ResourceSearchInput
+ key={secretPath}
+ className="max-w-2xl min-w-0 flex-1 basis-48"
+ value={searchFilter}
+ tags={tags}
+ onChange={setSearchFilter}
+ onSelectResult={({ search }) => setSearchFilter(search)}
+ environments={userAvailableEnvs}
+ projectId={currentProject?.id}
/>
+ {userAvailableEnvs.length > 0 && (
+ <div className="flex shrink-0 items-center gap-2">
+ <ResourceFilter
+ rowTypeFilter={filter}
+ onToggleRowType={handleToggleRowType}
+ tags={tags}
+ selectedTagSlugs={tagFilter}
+ onToggleTag={handleToggleTag}
+ onClearTags={handleClearTags}
+ />
+ <DownloadEnvButton
+ secretPath={secretPath}
+ environments={visibleEnvs}
+ projectId={projectId}
+ />
+ </div>
+ )}
</div>
- <ResourceSearchInput
- key={secretPath}
- className="min-w-0 flex-1 basis-48"
- value={searchFilter}
- tags={tags}
- onChange={setSearchFilter}
- onSelectResult={({ search }) => setSearchFilter(search)}
- environments={userAvailableEnvs}
- projectId={currentProject?.id}
- />
{userAvailableEnvs.length > 0 && (
- <div className="flex shrink-0 items-center gap-2">
- <ResourceFilter
- rowTypeFilter={filter}
- onToggleRowType={handleToggleRowType}
- tags={tags}
- selectedTagSlugs={tagFilter}
- onToggleTag={handleToggleTag}
- onClearTags={handleClearTags}
- />
- <DownloadEnvButton
- secretPath={secretPath}
- environments={visibleEnvs}
- projectId={projectId}
- />
+ <div className="flex justify-end">
+ <AddResourceButtons {...addResourceButtonsProps} />
</div>
)}
</div>
@@ -2796,6 +2788,24 @@ const OverviewPageContent = () => {
</AlertTitle>
</Alert>
) : null)}
+ <div
+ className={twMerge(
+ "flex h-10 min-w-0 items-center border border-border bg-container-hover whitespace-nowrap",
+ tableView === "table" ? "rounded-t-md border-b-0" : "mb-3 rounded-md"
+ )}
+ >
+ <FolderBreadcrumb projectName={currentProject.name} secretPath={secretPath} />
+ {canManageCurrentFolderAccess && (
+ <Button
+ variant="ghost"
+ size="xs"
+ className="mr-1.5 shrink-0"
+ onClick={handleCurrentFolderAccessOpen}
+ >
+ Manage Access
+ </Button>
+ )}
+ </div>
{tableView === "no-environments" && (
<EmptyResourceDisplay
variant="no-environments"
@@ -2819,11 +2829,11 @@ const OverviewPageContent = () => {
<DragDropProvider onDragEnd={handleSecretImportReorder}>
<Table
ref={tableRef}
- className="border-separate border-spacing-0"
- containerClassName="overscroll-x-none"
+ className="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"
>
<TableHeader>
- <TableRow className="h-10">
+ <TableRow className="h-10 has-[>th:nth-child(2):hover]:[&>th:nth-child(-n+2)]:bg-foreground/5">
<TableHead
className={twMerge(
!isSingleEnvView && "sticky",
@@ -2851,7 +2861,7 @@ const OverviewPageContent = () => {
<DropdownMenuTrigger asChild>
<button
type="button"
- className="flex h-full w-full cursor-pointer items-center gap-2 px-3 text-left hover:bg-foreground/5 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
+ className="flex h-full w-full cursor-pointer items-center gap-2 px-3 text-left focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
aria-label={`Sort secrets. Current order: ${activeSecretSort?.label ?? "Name (A to Z)"}`}
>
<span className="text-foreground">Name</span>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
index 3a389432fe..fe7e848fc7 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx
@@ -527,8 +527,8 @@ export const CreateSecretForm = ({
control={control}
name={`secrets.${index}.value`}
render={({ field }) => (
- <Field>
- <div className="flex items-center justify-between gap-2">
+ <Field className="grid grid-cols-[1fr_auto]">
+ <div className="flex items-center">
<FieldLabel htmlFor={`create-secret-${index}-value`}>
Value
<Tooltip>
@@ -543,6 +543,17 @@ export const CreateSecretForm = ({
</TooltipContent>
</Tooltip>
</FieldLabel>
+ </div>
+ <FieldContent className="col-span-2 row-start-2">
+ <InfisicalSecretInput
+ id={`create-secret-${index}-value`}
+ value={field.value ?? ""}
+ onChange={field.onChange}
+ placeholder="Enter secret value..."
+ />
+ <FieldError errors={[errors.secrets?.[index]?.value]} />
+ </FieldContent>
+ <div className="col-start-2 row-start-1 flex items-center">
<PasswordGenerator
trigger={
<Button variant="link" size="xs">
@@ -555,15 +566,6 @@ export const CreateSecretForm = ({
secretPath={secretPath}
/>
</div>
- <FieldContent>
- <InfisicalSecretInput
- id={`create-secret-${index}-value`}
- value={field.value ?? ""}
- onChange={field.onChange}
- placeholder="Enter secret value..."
- />
- <FieldError errors={[errors.secrets?.[index]?.value]} />
- </FieldContent>
</Field>
)}
/>
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 03e9b56fa3..737659d75e 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Link } from "@tanstack/react-router";
-import { ChevronDownIcon, CopyIcon, FolderIcon, SlashIcon, UsersIcon } from "lucide-react";
+import { ChevronDownIcon, CopyIcon, FolderIcon, SlashIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import {
@@ -15,29 +15,26 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- IconButton,
- Tooltip,
- TooltipContent,
- TooltipTrigger
+ IconButton
} from "@app/components/v3";
type Props = {
+ projectName: string;
secretPath?: string;
- onManageFolderAccess?: () => void;
};
type Measurements = {
containerWidth: number;
segmentWidths: number[];
ellipsisWidth: number;
- folderIconWidth: number;
+ rootWidth: number;
separatorWidth: number;
};
const breadcrumbLinkClassName =
"-my-1 inline-flex min-h-7 items-center rounded px-1.5 hover:bg-foreground/10 hover:no-underline";
-export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Props) {
+export function FolderBreadcrumb({ projectName, secretPath = "" }: Props) {
const containerRef = useRef<HTMLDivElement>(null);
const measureContainerRef = useRef<HTMLDivElement>(null);
@@ -45,7 +42,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
containerWidth: 0,
segmentWidths: [],
ellipsisWidth: 0,
- folderIconWidth: 0,
+ rootWidth: 0,
separatorWidth: 0
});
@@ -65,7 +62,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
if (!container || !measureContainer) return;
const containerWidth = container.getBoundingClientRect().width;
- const folderIcon = measureContainer.querySelector("[data-measure='folder-icon']");
+ const root = measureContainer.querySelector("[data-measure='root']");
const separator = measureContainer.querySelector("[data-measure='separator']");
const ellipsis = measureContainer.querySelector("[data-measure='ellipsis']");
const segments = measureContainer.querySelectorAll("[data-measure='segment']");
@@ -78,14 +75,14 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
containerWidth,
segmentWidths,
ellipsisWidth: ellipsis?.getBoundingClientRect().width ?? 0,
- folderIconWidth: folderIcon?.getBoundingClientRect().width ?? 0,
+ rootWidth: root?.getBoundingClientRect().width ?? 0,
separatorWidth: separator?.getBoundingClientRect().width ?? 0
};
if (
prev.containerWidth === newMeasurements.containerWidth &&
prev.ellipsisWidth === newMeasurements.ellipsisWidth &&
- prev.folderIconWidth === newMeasurements.folderIconWidth &&
+ prev.rootWidth === newMeasurements.rootWidth &&
prev.separatorWidth === newMeasurements.separatorWidth &&
prev.segmentWidths.length === newMeasurements.segmentWidths.length &&
prev.segmentWidths.every((w, i) => w === newMeasurements.segmentWidths[i])
@@ -100,7 +97,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
// Initial measurement and re-measure on path change
useEffect(() => {
measureElements();
- }, [measureElements, folderPaths]);
+ }, [measureElements, folderPaths, projectName]);
// Track container width with ResizeObserver
useEffect(() => {
@@ -118,7 +115,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
// Calculate visible segments based on actual measurements
const { startCount, endCount, needsEllipsis } = useMemo(() => {
- const { containerWidth, segmentWidths, ellipsisWidth, folderIconWidth, separatorWidth } =
+ const { containerWidth, segmentWidths, ellipsisWidth, rootWidth, separatorWidth } =
measurements;
// Before measurements are ready, show minimal state to prevent overflow
@@ -136,12 +133,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
(sum, w) => sum + w + separatorWidth + GAP * 2,
0
);
- // The folder access button is a fixed-width sibling after the breadcrumb; subtract its
- // footprint so the path collapses before it would collide with the button.
- // v3 IconButton size="xs" => h-7 w-7 = 28px (border-box); GAP covers the gap before it.
- const ACCESS_BUTTON_WIDTH = 28;
- const accessButtonReserve = onManageFolderAccess ? ACCESS_BUTTON_WIDTH + GAP : 0;
- const availableWidth = containerWidth - folderIconWidth - GAP - accessButtonReserve;
+ const availableWidth = containerWidth - rootWidth - GAP;
// If everything fits, show all
if (totalSegmentWidth <= availableWidth) {
@@ -199,7 +191,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
endCount: needsCollapse ? end : 0,
needsEllipsis: needsCollapse
};
- }, [measurements, folderPaths.length, Boolean(onManageFolderAccess)]);
+ }, [measurements, folderPaths.length]);
// Derive visible segments
const startSegments = needsEllipsis ? folderPaths.slice(0, startCount) : folderPaths;
@@ -247,7 +239,7 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
return (
<div
ref={containerRef}
- className="relative flex h-7 min-w-0 flex-1 items-center gap-1 overflow-hidden"
+ className="relative flex min-w-0 flex-1 items-center gap-1 overflow-hidden"
>
{/* Hidden measurement container */}
<div
@@ -255,8 +247,12 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
className="pointer-events-none invisible absolute flex items-center gap-1.5 whitespace-nowrap sm:gap-3"
aria-hidden="true"
>
- <span data-measure="folder-icon" className="inline-flex items-center">
+ <span
+ data-measure="root"
+ className="inline-flex max-w-48 items-center gap-4 pr-1.5 pl-3 text-sm"
+ >
<FolderIcon className="size-4" />
+ <span className="truncate">{projectName}</span>
</span>
<span data-measure="separator" className="inline-flex items-center">
<SlashIcon className="size-3 -rotate-12" />
@@ -278,20 +274,23 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
</span>
</div>
- {/* Visible breadcrumb (shrinks/clips on its own so the access button is never clipped) */}
- <Breadcrumb className="min-w-0 overflow-hidden">
+ <Breadcrumb className="min-w-0">
<BreadcrumbList className="flex-nowrap">
- {/* Root folder icon */}
+ {/* Root folder */}
<BreadcrumbItem>
- <BreadcrumbLink asChild>
+ <BreadcrumbLink
+ asChild
+ className="inline-flex min-h-7 max-w-48 items-center gap-4 pr-1.5 pl-3 hover:no-underline"
+ >
<Link
- className="inline-flex size-7 items-center justify-center rounded hover:bg-foreground/10"
from="/organizations/$orgId/projects/secret-management/$projectId/overview"
to="."
search={(prev) => ({ ...prev, secretPath: getCrumbPath(0) })}
- aria-label="Root folder"
+ aria-label={`${projectName} root folder`}
+ title={projectName}
>
- <FolderIcon />
+ <FolderIcon className="size-4 shrink-0 text-folder" />
+ <span className="truncate">{projectName}</span>
</Link>
</BreadcrumbLink>
</BreadcrumbItem>
@@ -406,23 +405,6 @@ export function FolderBreadcrumb({ secretPath = "", onManageFolderAccess }: Prop
})}
</BreadcrumbList>
</Breadcrumb>
-
- {onManageFolderAccess && (
- <Tooltip>
- <TooltipTrigger asChild>
- <IconButton
- variant="ghost-muted"
- size="xs"
- className="shrink-0"
- aria-label="Manage folder access"
- onClick={onManageFolderAccess}
- >
- <UsersIcon />
- </IconButton>
- </TooltipTrigger>
- <TooltipContent>Manage Folder Access</TooltipContent>
- </Tooltip>
- )}
</div>
);
}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/ResourceSearchInput/ResourceSearchInput.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/ResourceSearchInput/ResourceSearchInput.tsx
index 6b8bf00c46..7103b0ff70 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/ResourceSearchInput/ResourceSearchInput.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/ResourceSearchInput/ResourceSearchInput.tsx
@@ -96,14 +96,18 @@ export const ResourceSearchInput = ({
onFocus={() => {
setIsFocused(true);
}}
- onBlur={() => {
+ onBlur={(e) => {
+ if (e.relatedTarget === deepSearchBtnRef.current) return;
setIsFocused(false);
setIsOptionHighlighted(false);
}}
onKeyDown={(e) => {
if (!isFocused) return;
- if (e.key === "ArrowDown" || e.key === "ArrowUp") {
+ if (e.key === "Tab" && !e.shiftKey) {
+ e.preventDefault();
+ deepSearchBtnRef.current?.focus();
+ } else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
e.preventDefault();
setIsOptionHighlighted(true);
} else if (e.key === "Enter" && isOptionHighlighted) {
@@ -132,13 +136,30 @@ export const ResourceSearchInput = ({
align="start"
className="w-[var(--radix-popover-trigger-width)] p-1"
onOpenAutoFocus={(e) => e.preventDefault()}
+ onCloseAutoFocus={(e) => e.preventDefault()}
+ onEscapeKeyDown={(e) => {
+ e.preventDefault();
+ inputRef.current?.focus();
+ setIsFocused(false);
+ setIsOptionHighlighted(false);
+ }}
>
<button
ref={deepSearchBtnRef}
type="button"
className={`flex w-full cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-sm text-foreground hover:bg-foreground/5 ${isOptionHighlighted ? "bg-foreground/5" : ""}`}
- onMouseDown={(e) => {
- e.preventDefault();
+ onFocus={() => setIsOptionHighlighted(true)}
+ onBlur={() => {
+ setIsOptionHighlighted(false);
+ setIsFocused(false);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Tab" && e.shiftKey) {
+ e.preventDefault();
+ inputRef.current?.focus();
+ }
+ }}
+ onClick={() => {
setIsOpen(true);
setIsFocused(false);
setIsOptionHighlighted(false);