Skip to content

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

fix: product / DX improvements

varonix352668798fc2
diff --git a/frontend/src/components/v2/Divider/Divider.tsx b/frontend/src/components/v2/Divider/Divider.tsx
index a5b755eeb1..47054b6fef 100644
--- a/frontend/src/components/v2/Divider/Divider.tsx
+++ b/frontend/src/components/v2/Divider/Divider.tsx
@@ -2,12 +2,20 @@ import { twMerge } from "tailwind-merge";
interface IProps {
className?: string;
+ orientation?: "horizontal" | "vertical";
}
-export const Divider = ({ className }: IProps): JSX.Element => {
+export const Divider = ({ className, orientation = "horizontal" }: IProps): JSX.Element => {
+ if (orientation === "horizontal") {
+ return (
+ <div className={twMerge("flex items-center px-2 opacity-50", className)}>
+ <div aria-hidden="true" className="h-1 w-full grow border-t border-mineshaft-300" />
+ </div>
+ );
+ }
return (
- <div className={twMerge("flex items-center px-2 opacity-50", className)}>
- <div aria-hidden="true" className="h-1 w-full grow border-t border-mineshaft-300" />
+ <div className={twMerge("flex items-center opacity-50", className)}>
+ <div aria-hidden="true" className="h-full w-px grow rounded-md bg-mineshaft-300" />
</div>
);
};
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionPolicies.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionPolicies.tsx
index 3cc130a31b..862f99bea5 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionPolicies.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionPolicies.tsx
@@ -134,15 +134,6 @@ const ActionsMultiSelect = ({
return legacyActionsState.secretsRead;
}
- // manage-access is only obtainable through the folder access flow; show it only on
- // roles that already hold it (the built-in admin role)
- if (
- subject === ProjectPermissionSub.SecretFolders &&
- value === ProjectPermissionSecretFolderActions.ManageAccess
- ) {
- return legacyActionsState.folderManageAccess;
- }
-
// Hide legacy "grant-privileges" actions unless already selected
if (
subject === ProjectPermissionSub.Member &&
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
index 2ad5fd7d1e..e2e705c9c8 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
@@ -2049,13 +2049,7 @@ export const PROJECT_PERMISSION_OBJECT: TProjectPermissionObject = {
actions: [
{ label: "Create", value: "create", description: "Create new folders to organize secrets" },
{ label: "Modify", value: "edit", description: "Rename or modify folder properties" },
- { label: "Remove", value: "delete", description: "Delete folders and their contents" },
- {
- label: "Manage Access",
- value: ProjectPermissionSecretFolderActions.ManageAccess,
- description:
- "Grant and revoke folder-level access for users and machine identities. Granted through folder-level access controls"
- }
+ { label: "Remove", value: "delete", description: "Delete folders and their contents" }
]
},
[ProjectPermissionSub.SecretImports]: {
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index f9195ae6d1..4185373eb1 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -52,6 +52,7 @@ import { CommitHistorySheet } from "@app/components/secrets/CommitHistorySheet";
import {
Button as ButtonV2,
DeleteActionModal,
+ Divider,
Modal,
ModalContent,
PageHeader
@@ -83,7 +84,6 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- IconButton,
Pagination,
Sheet,
SheetContent,
@@ -2737,16 +2737,37 @@ const OverviewPageContent = () => {
<CardHeader>
<div className="flex flex-col gap-3 overflow-hidden dashboard:flex-row dashboard:items-center">
<div className="flex flex-1 items-center gap-x-3 overflow-hidden whitespace-nowrap dashboard:mr-auto">
- <EnvironmentSelect
- selectedEnvs={filteredEnvs}
- setSelectedEnvs={setFilteredEnvs}
- isDisabled={
- isBatchModeActive &&
- (pendingChanges.secrets.length > 0 || pendingChanges.folders.length > 0)
- }
- />
- <FolderBreadcrumb secretPath={secretPath} onResetSearch={handleResetSearch} />
+ <div className="flex shrink-0 items-center gap-2">
+ <EnvironmentSelect
+ selectedEnvs={filteredEnvs}
+ setSelectedEnvs={setFilteredEnvs}
+ isDisabled={
+ isBatchModeActive &&
+ (pendingChanges.secrets.length > 0 || pendingChanges.folders.length > 0)
+ }
+ />
+ </div>
+ <FolderBreadcrumb secretPath={secretPath} onResetSearch={handleResetSearch}>
+ {canManageCurrentFolderAccess && (
+ <>
+ <Divider orientation="vertical" className="mx-1 h-4 shrink-0" />
+ <Button
+ className="group h-fit shrink-0 p-1 text-muted transition-colors hover:text-foreground"
+ variant="ghost"
+ size="sm"
+ aria-label="Manage Access"
+ onClick={handleCurrentFolderAccessOpen}
+ >
+ <div className="flex items-center gap-2 text-mineshaft-100/80 transition-all group-hover:text-mineshaft-50">
+ <UsersIcon className="size-4" />
+ Manage Access
+ </div>
+ </Button>
+ </>
+ )}
+ </FolderBreadcrumb>
</div>
+
<div className="flex flex-wrap items-center gap-3">
{userAvailableEnvs.length > 0 && (
<DownloadEnvButton
@@ -2765,21 +2786,6 @@ const OverviewPageContent = () => {
onClearTags={handleClearTags}
/>
)}
- {canManageCurrentFolderAccess && (
- <Tooltip>
- <TooltipTrigger asChild>
- <IconButton
- variant="outline"
- size="sm"
- aria-label="Manage Access"
- onClick={handleCurrentFolderAccessOpen}
- >
- <UsersIcon />
- </IconButton>
- </TooltipTrigger>
- <TooltipContent>Manage Access</TooltipContent>
- </Tooltip>
- )}
<ResourceSearchInput
key={secretPath}
value={searchFilter}
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/AddFolderAccessSheet.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/AddFolderAccessSheet.tsx
index 01309999bd..f08c7302ff 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/AddFolderAccessSheet.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/AddFolderAccessSheet.tsx
@@ -15,6 +15,7 @@ import {
SheetTitle
} from "@app/components/v3";
import { useDebounce } from "@app/hooks";
+import { ActorType } from "@app/hooks/api/auditLogs/enums";
import {
SecretFolderRole,
useCreateIdentityFolderAccess,
@@ -30,6 +31,10 @@ import {
toIdentityActor,
toUserActor
} from "./folder-access.utils";
+import {
+ FolderAccessActorMultiValueLabel,
+ FolderAccessActorOption
+} from "./FolderAccessActorOption";
import { FolderTierRadioGroup } from "./FolderTierRadioGroup";
const CANDIDATE_LIMIT = 100;
@@ -112,7 +117,7 @@ export const AddFolderAccessSheet = ({
// no bulk endpoint exists, so each actor is its own request; failures are reported globally
const results = await Promise.allSettled(
selected.map((actor) =>
- actor.type === "user"
+ actor.type === ActorType.USER
? createUserAccess.mutateAsync({
projectId,
environmentSlug,
@@ -168,8 +173,15 @@ export const AddFolderAccessSheet = ({
if (action === "input-change") setSearch(value);
}}
onChange={(value) => setSelected((value ?? []) as TFolderAccessActor[])}
+ components={{
+ Option: FolderAccessActorOption,
+ MultiValueLabel: FolderAccessActorMultiValueLabel
+ }}
getOptionValue={(option) => `${option.type}-${option.id}`}
getOptionLabel={(option) => option.name}
+ // the candidate lists are already searched server side, so the label-only
+ // client filter would drop matches found by email or identity metadata
+ filterOption={null}
placeholder="Search users & machine identities"
noOptionsMessage={() => "No matches found"}
/>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessActorOption.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessActorOption.tsx
new file mode 100644
index 0000000000..ba985534f7
--- /dev/null
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessActorOption.tsx
@@ -0,0 +1,49 @@
+import { components, MultiValueGenericProps, OptionProps } from "react-select";
+import { BotIcon, CheckIcon, UserIcon } from "lucide-react";
+
+import { ActorType } from "@app/hooks/api/auditLogs/enums";
+
+import { TFolderAccessActor } from "./folder-access.utils";
+
+const ActorTypeIcon = ({ type }: { type: TFolderAccessActor["type"] }) =>
+ type === ActorType.IDENTITY ? (
+ <BotIcon className="size-3.5 shrink-0 text-muted" />
+ ) : (
+ <UserIcon className="size-3.5 shrink-0 text-muted" />
+ );
+
+export const FolderAccessActorOption = ({
+ isSelected,
+ children,
+ ...props
+}: OptionProps<TFolderAccessActor>) => {
+ const { type, subtitle } = props.data;
+
+ return (
+ <components.Option isSelected={isSelected} {...props}>
+ <div className="flex flex-row items-center justify-between gap-2">
+ <div className="flex min-w-0 items-center gap-2">
+ <ActorTypeIcon type={type} />
+ <span className="truncate">{children}</span>
+ <span className="truncate text-xs text-muted">{subtitle}</span>
+ </div>
+ {isSelected && <CheckIcon className="size-4 shrink-0" />}
+ </div>
+ </components.Option>
+ );
+};
+
+export const FolderAccessActorMultiValueLabel = (
+ props: MultiValueGenericProps<TFolderAccessActor>
+) => {
+ const { data, children } = props;
+
+ return (
+ <components.MultiValueLabel {...props}>
+ <span className="flex items-center gap-1.5">
+ <ActorTypeIcon type={data.type} />
+ {children}
+ </span>
+ </components.MultiValueLabel>
+ );
+};
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
index 1833313dba..1703aae1f2 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx
@@ -177,7 +177,7 @@ export const FolderAccessSheet = ({
</Badge>
<FolderIcon className="size-3.5 shrink-0 text-folder" />
- <span className="truncate font-mono text-accent">{folderPath}</span>
+ <span className="truncate font-mono text-mineshaft-100/80">{folderPath}</span>
</div>
</SheetHeader>
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 20ba1006b5..15fe99653a 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/FolderBreadcrumb/FolderBreadcrumb.tsx
@@ -24,6 +24,8 @@ import { useTimedReset } from "@app/hooks";
type Props = {
secretPath?: string;
onResetSearch: (secretPath: string) => void;
+ // Rendered inline after the copy button; measured so the path collapses before it collides.
+ children?: React.ReactNode;
};
type Measurements = {
@@ -32,18 +34,21 @@ type Measurements = {
ellipsisWidth: number;
folderIconWidth: number;
separatorWidth: number;
+ trailingWidth: number;
};
-export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
+export function FolderBreadcrumb({ secretPath = "", onResetSearch, children }: Props) {
const containerRef = useRef<HTMLDivElement>(null);
const measureContainerRef = useRef<HTMLDivElement>(null);
+ const trailingRef = useRef<HTMLDivElement>(null);
const [measurements, setMeasurements] = useState<Measurements>({
containerWidth: 0,
segmentWidths: [],
ellipsisWidth: 0,
folderIconWidth: 0,
- separatorWidth: 0
+ separatorWidth: 0,
+ trailingWidth: 0
});
const folderPaths = useMemo(() => (secretPath || "").split("/").filter(Boolean), [secretPath]);
@@ -83,6 +88,7 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
const segments = measureContainer.querySelectorAll("[data-measure='segment']");
const segmentWidths = Array.from(segments).map((el) => el.getBoundingClientRect().width);
+ const trailingWidth = trailingRef.current?.getBoundingClientRect().width ?? 0;
setMeasurements((prev) => {
// Only update if values changed to prevent unnecessary re-renders
@@ -91,7 +97,8 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
segmentWidths,
ellipsisWidth: ellipsis?.getBoundingClientRect().width ?? 0,
folderIconWidth: folderIcon?.getBoundingClientRect().width ?? 0,
- separatorWidth: separator?.getBoundingClientRect().width ?? 0
+ separatorWidth: separator?.getBoundingClientRect().width ?? 0,
+ trailingWidth
};
if (
@@ -99,6 +106,7 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
prev.ellipsisWidth === newMeasurements.ellipsisWidth &&
prev.folderIconWidth === newMeasurements.folderIconWidth &&
prev.separatorWidth === newMeasurements.separatorWidth &&
+ prev.trailingWidth === newMeasurements.trailingWidth &&
prev.segmentWidths.length === newMeasurements.segmentWidths.length &&
prev.segmentWidths.every((w, i) => w === newMeasurements.segmentWidths[i])
) {
@@ -123,6 +131,9 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
measureElements();
});
observer.observe(element);
+ // The trailing actions are optional and permission-gated, so the reserved footprint
+ // changes after mount; without watching it the path collapses at the wrong point.
+ if (trailingRef.current) observer.observe(trailingRef.current);
return () => {
observer.disconnect();
};
@@ -130,8 +141,14 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
// Calculate visible segments based on actual measurements
const { startCount, endCount, needsEllipsis } = useMemo(() => {
- const { containerWidth, segmentWidths, ellipsisWidth, folderIconWidth, separatorWidth } =
- measurements;
+ const {
+ containerWidth,
+ segmentWidths,
+ ellipsisWidth,
+ folderIconWidth,
+ separatorWidth,
+ trailingWidth
+ } = measurements;
// Before measurements are ready, show minimal state to prevent overflow
if (segmentWidths.length === 0 || containerWidth === 0) {
@@ -148,12 +165,11 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
(sum, w) => sum + w + separatorWidth + GAP * 2,
0
);
- // The copy-path 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 COPY_BUTTON_WIDTH = 28;
- const copyButtonReserve = folderPaths.length > 0 ? COPY_BUTTON_WIDTH + GAP : 0;
- const availableWidth = containerWidth - folderIconWidth - GAP - copyButtonReserve;
+ // The trailing group (copy button plus any caller-supplied actions) is a non-shrinking
+ // sibling after the breadcrumb, so the path has to collapse before it reaches that group.
+ // Its width is measured rather than assumed, because it depends on the caller's actions.
+ const trailingReserve = trailingWidth > 0 ? trailingWidth + GAP : 0;
+ const availableWidth = containerWidth - folderIconWidth - GAP - trailingReserve;
// If everything fits, show all
if (totalSegmentWidth <= availableWidth) {
@@ -382,30 +398,33 @@ export function FolderBreadcrumb({ secretPath = "", onResetSearch }: Props) {
</BreadcrumbList>
</Breadcrumb>
- {/* Copy current folder path (pinned outside the clip flow so it's always visible) */}
- {folderPaths.length > 0 && (
- <Tooltip>
- <TooltipTrigger asChild>
- <IconButton
- variant="ghost-muted"
- size="xs"
- className="shrink-0"
- aria-label="Copy folder path"
- onClick={async () => {
- try {
- await navigator.clipboard.writeText(fullPath);
- setIsCopied(true);
- } catch {
- // clipboard unavailable (denied or insecure context); keep the un-copied state
- }
- }}
- >
- {isCopied ? <Check /> : <Copy />}
- </IconButton>
- </TooltipTrigger>
- <TooltipContent>{isCopied ? "Copied" : "Copy path"}</TooltipContent>
- </Tooltip>
- )}
+ {/* Trailing actions (pinned outside the clip flow so they're always visible) */}
+ <div ref={trailingRef} className="flex shrink-0 items-center gap-1">
+ {folderPaths.length > 0 && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <IconButton
+ variant="ghost-muted"
+ size="xs"
+ className="shrink-0"
+ aria-label="Copy folder path"
+ onClick={async () => {
+ try {
+ await navigator.clipboard.writeText(fullPath);
+ setIsCopied(true);
+ } catch {
+ // clipboard unavailable (denied or insecure context); keep the un-copied state
+ }
+ }}
+ >
+ {isCopied ? <Check /> : <Copy />}
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent>{isCopied ? "Copied" : "Copy path"}</TooltipContent>
+ </Tooltip>
+ )}
+ {children}
+ </div>
</div>
);
}