Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: react ux (#19875)

ecmadao0d776b6e5822
diff --git a/frontend/src/assets/css/tailwind.css b/frontend/src/assets/css/tailwind.css
index 539150a5ff..d7ff159a5f 100644
--- a/frontend/src/assets/css/tailwind.css
+++ b/frontend/src/assets/css/tailwind.css
@@ -23,6 +23,26 @@
border-color: var(--color-gray-200, currentcolor);
}
+ /* Thin scrollbars globally */
+ * {
+ scrollbar-width: thin; /* Firefox */
+ scrollbar-color: #d1d5db transparent; /* gray-300 */
+ }
+ *::-webkit-scrollbar {
+ width: 6px;
+ height: 6px;
+ }
+ *::-webkit-scrollbar-track {
+ background: transparent;
+ }
+ *::-webkit-scrollbar-thumb {
+ background-color: #d1d5db; /* gray-300 */
+ border-radius: 3px;
+ }
+ *::-webkit-scrollbar-thumb:hover {
+ background-color: #9ca3af; /* gray-400 */
+ }
+
/* All disabled form elements should show not-allowed cursor */
input:disabled,
select:disabled,
diff --git a/frontend/src/react/components/AdvancedSearch.tsx b/frontend/src/react/components/AdvancedSearch.tsx
index 9ce354bc52..9e69e06363 100644
--- a/frontend/src/react/components/AdvancedSearch.tsx
+++ b/frontend/src/react/components/AdvancedSearch.tsx
@@ -520,7 +520,7 @@ export function AdvancedSearch({
{/* Dropdown menu */}
{showMenu && (
<div
- className="absolute top-[38px] w-full bg-gray-100 shadow-xl origin-top-left rounded-xs overflow-hidden z-50"
+ className="absolute top-[38px] w-full bg-gray-100 shadow-xl origin-top-left rounded-sm overflow-hidden z-50"
onMouseDown={(e) => e.preventDefault()}
>
{/* Scope menu */}
diff --git a/frontend/src/react/components/AuditLogTable.tsx b/frontend/src/react/components/AuditLogTable.tsx
index 6c1d15dc4a..d3d77d1991 100644
--- a/frontend/src/react/components/AuditLogTable.tsx
+++ b/frontend/src/react/components/AuditLogTable.tsx
@@ -29,6 +29,7 @@ import {
} from "@/react/hooks/useSessionPageSize";
import { useVueState } from "@/react/hooks/useVueState";
import { cn } from "@/react/lib/utils";
+import { PagedTableFooter } from "@/react/pages/settings/shared/usePagedData";
import { pushNotification, useSubscriptionV1Store } from "@/store";
import {
extractUserEmail,
@@ -973,37 +974,15 @@ export function AuditLogTable({
</div>
{/* Pagination footer */}
- <div className="flex items-center justify-end gap-x-2 mx-4 py-2">
- <div className="flex items-center gap-x-2">
- <span className="text-sm text-control-light">
- {t("common.rows-per-page")}
- </span>
- <select
- className="border border-control-border rounded-sm text-sm pl-2 pr-6 py-1 min-w-[5rem]"
- value={pageSize}
- onChange={(e) => setPageSize(Number(e.target.value))}
- >
- {pageSizeOptions.map((size) => (
- <option key={size} value={size}>
- {size}
- </option>
- ))}
- </select>
- </div>
- {hasMore && (
- <Button
- variant="ghost"
- size="sm"
- disabled={isFetchingMore || loading}
- onClick={loadMore}
- >
- <span className="text-sm text-control-light">
- {isFetchingMore || loading
- ? t("common.loading")
- : t("common.load-more")}
- </span>
- </Button>
- )}
+ <div className="mx-4 py-4">
+ <PagedTableFooter
+ pageSize={pageSize}
+ pageSizeOptions={pageSizeOptions}
+ onPageSizeChange={setPageSize}
+ hasMore={hasMore}
+ isFetchingMore={isFetchingMore || loading}
+ onLoadMore={loadMore}
+ />
</div>
</div>
) : (
diff --git a/frontend/src/react/components/CreateWorkloadIdentityDrawer.tsx b/frontend/src/react/components/CreateWorkloadIdentityDrawer.tsx
index 5fd94bb376..8f7387a08d 100644
--- a/frontend/src/react/components/CreateWorkloadIdentityDrawer.tsx
+++ b/frontend/src/react/components/CreateWorkloadIdentityDrawer.tsx
@@ -7,7 +7,7 @@ import { Button } from "@/react/components/ui/button";
import { Input } from "@/react/components/ui/input";
import { useEscapeKey } from "@/react/hooks/useEscapeKey";
import { useVueState } from "@/react/hooks/useVueState";
-import { RoleMultiSelect } from "@/react/pages/settings/shared/RoleMultiSelect";
+import { RoleSelect } from "@/react/pages/settings/shared/RoleSelect";
import {
ensureWorkloadIdentityFullName,
pushNotification,
@@ -595,7 +595,7 @@ export function CreateWorkloadIdentityDrawer({
<label className="block text-sm font-medium text-control">
{t("settings.members.table.roles")}
</label>
- <RoleMultiSelect
+ <RoleSelect
value={roles}
onChange={setRoles}
disabled={false}
diff --git a/frontend/src/react/components/CustomApproval/ApprovalStepsTable.tsx b/frontend/src/react/components/CustomApproval/ApprovalStepsTable.tsx
index ab65aa3a05..4345eee709 100644
--- a/frontend/src/react/components/CustomApproval/ApprovalStepsTable.tsx
+++ b/frontend/src/react/components/CustomApproval/ApprovalStepsTable.tsx
@@ -1,9 +1,9 @@
import { ArrowDown, ArrowUp, Plus, Trash2 } from "lucide-react";
import { useTranslation } from "react-i18next";
+import { RoleSelect } from "@/react/pages/settings/shared/RoleSelect";
import { PresetRoleType } from "@/types";
import { displayRoleTitle } from "@/utils";
import { Button } from "../ui/button";
-import { RoleSelect } from "./RoleSelect";
interface ApprovalStepsTableProps {
roles: string[];
@@ -67,12 +67,13 @@ export function ApprovalStepsTable({
<td className="border border-control-border px-3 py-2">
{editable ? (
<RoleSelect
- value={role}
- onChange={(val) => {
+ value={role ? [role] : []}
+ onChange={(vals) => {
const newRoles = [...roles];
- newRoles[index] = val;
+ newRoles[index] = vals[0] ?? "";
onRolesChange(newRoles);
}}
+ multiple={false}
/>
) : (
<span className="text-control">{displayRoleTitle(role)}</span>
diff --git a/frontend/src/react/components/CustomApproval/RoleSelect.tsx b/frontend/src/react/components/CustomApproval/RoleSelect.tsx
deleted file mode 100644
index 3dd354af24..0000000000
--- a/frontend/src/react/components/CustomApproval/RoleSelect.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/react/components/ui/select";
-import { useVueState } from "@/react/hooks/useVueState";
-import { useRoleStore } from "@/store";
-import {
- PRESET_PROJECT_ROLES,
- PRESET_ROLES,
- PRESET_WORKSPACE_ROLES,
-} from "@/types/iam";
-import { displayRoleTitle } from "@/utils";
-
-interface RoleSelectProps {
- value: string;
- onChange: (value: string) => void;
- disabled?: boolean;
-}
-
-export function RoleSelect({ value, onChange, disabled }: RoleSelectProps) {
- const allRoles = useVueState(() => useRoleStore().roleList);
-
- const customRoles = allRoles
- .filter((r) => !PRESET_ROLES.includes(r.name))
- .map((r) => r.name);
-
- const roles = [
- ...PRESET_WORKSPACE_ROLES,
- ...PRESET_PROJECT_ROLES,
- ...customRoles,
- ];
-
- return (
- <Select
- value={value}
- onValueChange={(v) => v !== null && onChange(v)}
- disabled={disabled}
- >
- <SelectTrigger className="w-48">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {roles.map((role) => (
- <SelectItem key={role} value={role}>
- {displayRoleTitle(role)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- );
-}
diff --git a/frontend/src/react/components/CustomApproval/RuleEditDialog.tsx b/frontend/src/react/components/CustomApproval/RuleEditDialog.tsx
index cef8791d0b..a2bd5ee923 100644
--- a/frontend/src/react/components/CustomApproval/RuleEditDialog.tsx
+++ b/frontend/src/react/components/CustomApproval/RuleEditDialog.tsx
@@ -177,7 +177,7 @@ export function RuleEditDialog({
<div className="flex flex-1 flex-col gap-y-4 overflow-y-auto px-6 py-4">
{/* Fallback hint */}
{isFallback && (
- <div className="rounded bg-amber-50 p-3 text-sm text-amber-600">
+ <div className="rounded-xs bg-amber-50 p-3 text-sm text-amber-600">
{t("custom-approval.approval-flow.fallback-rules-hint")}
</div>
)}
diff --git a/frontend/src/react/components/CustomApproval/RulesSection.tsx b/frontend/src/react/components/CustomApproval/RulesSection.tsx
index 0623497860..5501304f37 100644
--- a/frontend/src/react/components/CustomApproval/RulesSection.tsx
+++ b/frontend/src/react/components/CustomApproval/RulesSection.tsx
@@ -143,14 +143,14 @@ function SortableRow({
) : (
<>
<button
- className="inline-flex h-6 w-6 items-center justify-center rounded hover:bg-gray-200"
+ className="inline-flex h-6 w-6 items-center justify-center rounded-xs hover:bg-gray-200"
onClick={handleEditClick}
>
<Pencil className="h-3 w-3" />
</button>
{allowAdmin && (
<button
- className="inline-flex h-6 w-6 items-center justify-center rounded hover:bg-gray-200"
+ className="inline-flex h-6 w-6 items-center justify-center rounded-xs hover:bg-gray-200"
onClick={handleDeleteClick}
>
<Trash2 className="h-3 w-3" />
diff --git a/frontend/src/react/components/DashboardSidebar.tsx b/frontend/src/react/components/DashboardSidebar.tsx
index 17e8d904d5..c3afe8aab0 100644
--- a/frontend/src/react/components/DashboardSidebar.tsx
+++ b/frontend/src/react/components/DashboardSidebar.tsx
@@ -291,9 +291,9 @@ function filterSidebarList(items: SidebarItem[]): SidebarItem[] {
// ---------------------------------------------------------------------------
const parentRouteClass =
- "group flex items-center px-2 py-1.5 leading-normal font-medium rounded-md text-gray-700 outline-item text-sm!";
+ "group flex items-center px-2 py-1.5 leading-normal font-medium rounded-xs text-gray-700 outline-item text-sm!";
const childRouteClass =
- "group w-full flex items-center pl-9 pr-2 py-1 outline-item mb-0.5 rounded-md";
+ "group w-full flex items-center pl-9 pr-2 py-1 outline-item mb-0.5 rounded-xs";
export function DashboardSidebar() {
const rawItems = useSidebarItems();
diff --git a/frontend/src/react/components/EditEnvironmentDrawer.tsx b/frontend/src/react/components/EditEnvironmentDrawer.tsx
index 52d3dadcaa..567fac0335 100644
--- a/frontend/src/react/components/EditEnvironmentDrawer.tsx
+++ b/frontend/src/react/components/EditEnvironmentDrawer.tsx
@@ -42,7 +42,10 @@ export function EditEnvironmentDrawer({
<h2 className="text-lg font-semibold">
{t("database.edit-environment")}
</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
<X className="w-4 h-4" />
</button>
</div>
@@ -52,7 +55,7 @@ export function EditEnvironmentDrawer({
<label
key={env.name}
className={cn(
- "flex items-center gap-x-3 px-3 py-2.5 rounded-lg cursor-pointer border transition-colors",
+ "flex items-center gap-x-3 px-3 py-2.5 rounded-sm cursor-pointer border transition-colors",
selected === env.name
? "border-accent bg-accent/5"
: "border-transparent hover:bg-gray-50"
diff --git a/frontend/src/react/components/EnvironmentLabel.tsx b/frontend/src/react/components/EnvironmentLabel.tsx
index edbb516a18..10da439d86 100644
--- a/frontend/src/react/components/EnvironmentLabel.tsx
+++ b/frontend/src/react/components/EnvironmentLabel.tsx
@@ -52,7 +52,7 @@ export function EnvironmentLabel({
return (
<span
className={cn(
- "inline-flex items-center gap-x-1 px-1.5 rounded truncate",
+ "inline-flex items-center gap-x-1 px-1.5 rounded-xs truncate",
className
)}
style={
diff --git a/frontend/src/react/components/ExprEditor.tsx b/frontend/src/react/components/ExprEditor.tsx
index 23e6bbb1ed..aeee429249 100644
--- a/frontend/src/react/components/ExprEditor.tsx
+++ b/frontend/src/react/components/ExprEditor.tsx
@@ -383,7 +383,7 @@ function SearchableSelect({
<PortaledDropdown
anchorRef={triggerRef}
dropdownRef={dropdownRef}
- className="w-56 bg-white border border-control-border rounded-xs shadow-md"
+ className="w-56 bg-white border border-control-border rounded-sm shadow-md"
>
<div className="p-1 border-b border-control-border">
<input
@@ -559,7 +559,7 @@ function MultiSearchableSelect({
{value.map((v) => (
<span
key={v}
- className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded"
+ className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded-xs"
>
{getLabelForValue(v)}
{!disabled && (
@@ -581,7 +581,7 @@ function MultiSearchableSelect({
<PortaledDropdown
anchorRef={triggerRef}
dropdownRef={dropdownRef}
- className="w-56 bg-white border border-control-border rounded-xs shadow-md"
+ className="w-56 bg-white border border-control-border rounded-sm shadow-md"
>
<div className="p-1 border-b border-control-border">
<input
@@ -673,7 +673,7 @@ function TagInput({
{value.map((tag) => (
<span
key={tag}
- className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded"
+ className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded-xs"
>
{tag}
{!disabled && (
@@ -762,7 +762,7 @@ function MultiCheckSelect({
{value.map((v) => (
<span
key={v}
- className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded"
+ className="inline-flex items-center gap-1 bg-gray-100 text-xs px-1.5 py-0.5 rounded-xs"
>
{renderValue
? renderValue(v, getLabelForValue(v))
@@ -1499,7 +1499,7 @@ function ConditionGroup({
{t("cel.condition.add-group")}
<span className="relative">
<HelpCircle className="ml-1 w-3 h-3 text-gray-400" />
- <span className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1 hidden group-hover:block w-72 p-2 text-xs bg-gray-800 text-white rounded shadow-lg z-50">
+ <span className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1 hidden group-hover:block w-72 p-2 text-xs bg-gray-800 text-white rounded-sm shadow-lg z-50">
{t("cel.condition.group.tooltip")}
</span>
</span>
diff --git a/frontend/src/react/components/LabelsDisplay.tsx b/frontend/src/react/components/LabelsDisplay.tsx
index a5d8bd43cb..88bd165328 100644
--- a/frontend/src/react/components/LabelsDisplay.tsx
+++ b/frontend/src/react/components/LabelsDisplay.tsx
@@ -16,7 +16,7 @@ export function LabelsDisplay({
return (
<div className="flex items-center gap-x-1">
{displayEntries.map(([key, value]) => (
- <span key={key} className="rounded-md bg-gray-100 py-0.5 px-2 text-sm">
+ <span key={key} className="rounded-xs bg-gray-100 py-0.5 px-2 text-sm">
{key}:{value}
</span>
))}
diff --git a/frontend/src/react/components/MatchedDatabaseView.tsx b/frontend/src/react/components/MatchedDatabaseView.tsx
index a3ba5233d9..05ee4ed01e 100644
--- a/frontend/src/react/components/MatchedDatabaseView.tsx
+++ b/frontend/src/react/components/MatchedDatabaseView.tsx
@@ -278,12 +278,12 @@ export function MatchedDatabaseView({
</div>
{matchingError && (
- <p className="my-2 text-sm border border-red-600 px-2 py-1 rounded-lg bg-red-50 text-red-600">
+ <p className="my-2 text-sm border border-red-600 px-2 py-1 rounded-sm bg-red-50 text-red-600">
{matchingError}
</p>
)}
- <div className="border p-2 rounded-lg">
+ <div className="border p-2 rounded-sm">
{sections.map((section) => {
const isExpanded = expandedSections.has(section.name);
const isEmpty = section.databases.length === 0;
diff --git a/frontend/src/react/components/ProjectSidebar.tsx b/frontend/src/react/components/ProjectSidebar.tsx
index 90baba1d88..43d0d41c47 100644
--- a/frontend/src/react/components/ProjectSidebar.tsx
+++ b/frontend/src/react/components/ProjectSidebar.tsx
@@ -234,9 +234,9 @@ function filterSidebarList(items: SidebarItem[]): SidebarItem[] {
// ---------------------------------------------------------------------------
const parentRouteClass =
- "group flex items-center px-2 py-1.5 leading-normal font-medium rounded-md text-gray-700 outline-item text-sm!";
+ "group flex items-center px-2 py-1.5 leading-normal font-medium rounded-xs text-gray-700 outline-item text-sm!";
const childRouteClass =
- "group w-full flex items-center pl-9 pr-2 py-1 outline-item mb-0.5 rounded-md";
+ "group w-full flex items-center pl-9 pr-2 py-1 outline-item mb-0.5 rounded-xs";
export function ProjectSidebar() {
const rawItems = useSidebarItems();
diff --git a/frontend/src/react/components/WorkspaceSwitcher.tsx b/frontend/src/react/components/WorkspaceSwitcher.tsx
index b3ffa81578..0e3ec70730 100644
--- a/frontend/src/react/components/WorkspaceSwitcher.tsx
+++ b/frontend/src/react/components/WorkspaceSwitcher.tsx
@@ -34,7 +34,7 @@ export function WorkspaceSwitcher() {
<div ref={containerRef} className="relative px-2.5 pb-2">
<button
type="button"
- className="w-full flex items-center gap-x-2 px-2 py-1.5 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-100 cursor-pointer"
+ className="w-full flex items-center gap-x-2 px-2 py-1.5 rounded-xs text-sm font-medium text-gray-700 hover:bg-gray-100 cursor-pointer"
onClick={() => setOpen(!open)}
>
<Building2 className="w-4 h-4 text-gray-500 shrink-0" />
@@ -44,7 +44,7 @@ export function WorkspaceSwitcher() {
<ChevronsUpDown className="w-3.5 h-3.5 text-gray-400 shrink-0" />
</button>
{open && (
- <div className="absolute left-2.5 right-2.5 z-10 mt-1 bg-white border border-gray-200 rounded-md shadow-lg py-1">
+ <div className="absolute left-2.5 right-2.5 z-10 mt-1 bg-white border border-gray-200 rounded-sm shadow-lg py-1">
{workspaceList.map((ws) => (
<button
key={ws.name}
diff --git a/frontend/src/react/components/database/CreateDatabaseDrawer.tsx b/frontend/src/react/components/database/CreateDatabaseDrawer.tsx
index fbcaee4de9..49ee19c3d6 100644
--- a/frontend/src/react/components/database/CreateDatabaseDrawer.tsx
+++ b/frontend/src/react/components/database/CreateDatabaseDrawer.tsx
@@ -79,7 +79,7 @@ function IssueLabelSelect({
<button
type="button"
className={cn(
- "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-md h-9 px-3 text-sm bg-white text-left transition-colors",
+ "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-xs h-9 px-3 text-sm bg-white text-left transition-colors",
"hover:border-gray-400",
open && "border-accent shadow-[0_0_0_1px_var(--color-accent)]"
)}
@@ -92,7 +92,7 @@ function IssueLabelSelect({
return (
<span
key={val}
- className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-gray-100 text-xs"
+ className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded-xs bg-gray-100 text-xs"
>
<span
className="w-2.5 h-2.5 rounded-sm shrink-0"
@@ -121,7 +121,7 @@ function IssueLabelSelect({
/>
</button>
{open && (
- <div className="absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg overflow-hidden">
+ <div className="absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-sm shadow-lg overflow-hidden">
<div className="max-h-60 overflow-y-auto">
{labels.length === 0 ? (
<div className="px-3 py-6 text-sm text-gray-400 text-center">
@@ -141,7 +141,7 @@ function IssueLabelSelect({
type="checkbox"
checked={isSelected}
readOnly
- className="rounded border-gray-300 accent-accent"
+ className="rounded-xs border-gray-300 accent-accent"
/>
<span
className="w-4 h-4 rounded-sm shrink-0"
@@ -382,7 +382,10 @@ export function CreateDatabaseDrawer({
<h2 className="text-lg font-semibold">
{t("quick-action.create-db")}
</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
<X className="w-4 h-4" />
</button>
</div>
@@ -439,7 +442,7 @@ export function CreateDatabaseDrawer({
onChange={(e) => setDatabaseName(e.target.value)}
placeholder={t("create-db.new-database-name")}
className={cn(
- "w-full border rounded-md px-3 py-2 text-sm",
+ "w-full border rounded-xs px-3 py-2 text-sm",
isReservedName ? "border-error" : "border-control-border"
)}
/>
@@ -460,7 +463,7 @@ export function CreateDatabaseDrawer({
type="text"
value={tableName}
onChange={(e) => setTableName(e.target.value)}
- className="w-full border border-gray-300 rounded-md px-3 py-2 text-sm"
+ className="w-full border border-gray-300 rounded-xs px-3 py-2 text-sm"
/>
</div>
)}
@@ -474,7 +477,7 @@ export function CreateDatabaseDrawer({
type="text"
value={cluster}
onChange={(e) => setCluster(e.target.value)}
- className="w-full border border-gray-300 rounded-md px-3 py-2 text-sm"
+ className="w-full border border-gray-300 rounded-xs px-3 py-2 text-sm"
/>
</div>
)}
@@ -533,7 +536,7 @@ export function CreateDatabaseDrawer({
placeholder={defaultCharsetOfEngineV1(
selectedInstance.engine
)}
- className="w-full border border-control-border rounded-md px-3 py-2 text-sm"
+ className="w-full border border-control-border rounded-xs px-3 py-2 text-sm"
/>
</div>
<div>
@@ -548,7 +551,7 @@ export function CreateDatabaseDrawer({
defaultCollationOfEngineV1(selectedInstance.engine) ||
t("common.default")
}
- className="w-full border border-control-border rounded-md px-3 py-2 text-sm"
+ className="w-full border border-control-border rounded-xs px-3 py-2 text-sm"
/>
</div>
</>
diff --git a/frontend/src/react/components/database/DatabaseTable.tsx b/frontend/src/react/components/database/DatabaseTable.tsx
index 588bb2c579..6fd7724954 100644
--- a/frontend/src/react/components/database/DatabaseTable.tsx
+++ b/frontend/src/react/components/database/DatabaseTable.tsx
@@ -4,13 +4,13 @@ import { useTranslation } from "react-i18next";
import { EngineIconPath } from "@/components/InstanceForm/constants";
import { EnvironmentLabel } from "@/react/components/EnvironmentLabel";
import { LabelsDisplay } from "@/react/components/LabelsDisplay";
-import { Button } from "@/react/components/ui/button";
import {
getPageSizeOptions,
useSessionPageSize,
} from "@/react/hooks/useSessionPageSize";
import { useVueState } from "@/react/hooks/useVueState";
import { cn } from "@/react/lib/utils";
+import { PagedTableFooter } from "@/react/pages/settings/shared/usePagedData";
import { router } from "@/router";
import { useActuatorV1Store, useDatabaseV1Store } from "@/store";
import type { DatabaseFilter } from "@/store/modules/v1/database";
@@ -221,7 +221,7 @@ export function DatabaseTable({
type="checkbox"
checked={allSelected}
onChange={toggleSelectAll}
- className="rounded border-control-border"
+ className="rounded-xs border-control-border"
/>
</th>
<th
@@ -313,7 +313,7 @@ export function DatabaseTable({
checked={isSelected}
onChange={() => toggleSelection(db.name)}
onClick={(e) => e.stopPropagation()}
- className="rounded border-control-border"
+ className="rounded-xs border-control-border"
/>
</td>
<td className="px-4 py-2">
@@ -378,35 +378,15 @@ export function DatabaseTable({
</tbody>
</table>
- <div className="flex items-center justify-end gap-x-2 mx-4">
- <div className="flex items-center gap-x-2">
- <span className="text-sm text-control-light">
- {t("common.rows-per-page")}
- </span>
- <select
- className="border border-control-border rounded-sm text-sm pl-2 pr-6 py-1 min-w-[5rem]"
- value={pageSize}
- onChange={(e) => setPageSize(Number(e.target.value))}
- >
- {pageSizeOptions.map((size) => (
- <option key={size} value={size}>
- {size}
- </option>
- ))}
- </select>
- </div>
- {hasMore && (
- <Button
- variant="ghost"
- size="sm"
- disabled={isFetchingMore}
- onClick={loadMore}
- >
- <span className="text-sm text-control-light">
- {isFetchingMore ? t("common.loading") : t("common.load-more")}
- </span>
- </Button>
- )}
+ <div className="mx-4">
+ <PagedTableFooter
+ pageSize={pageSize}
+ pageSizeOptions={pageSizeOptions}
+ onPageSizeChange={setPageSize}
+ hasMore={hasMore}
+ isFetchingMore={isFetchingMore}
+ onLoadMore={loadMore}
+ />
</div>
</>
);
diff --git a/frontend/src/react/components/database/LabelEditorDrawer.tsx b/frontend/src/react/components/database/LabelEditorDrawer.tsx
index 2e4ebe2083..15a8628ac2 100644
--- a/frontend/src/react/components/database/LabelEditorDrawer.tsx
+++ b/frontend/src/react/components/database/LabelEditorDrawer.tsx
@@ -74,13 +74,16 @@ export function LabelEditorDrawer({
<div className="ml-auto relative bg-white w-[28rem] max-w-[100vw] h-full shadow-lg flex flex-col">
<div className="flex items-center justify-between px-6 py-4 border-b border-control-border">
<h2 className="text-lg font-semibold">{t("database.edit-labels")}</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
<X className="w-4 h-4" />
</button>
</div>
<div className="flex-1 overflow-y-auto p-6">
{hasMixedValues && (
- <div className="mb-4 rounded-md bg-yellow-50 border border-yellow-200 px-3 py-2 text-sm text-yellow-800">
+ <div className="mb-4 rounded-xs bg-yellow-50 border border-yellow-200 px-3 py-2 text-sm text-yellow-800">
{t("database.mixed-label-values-warning")}
</div>
)}
@@ -90,7 +93,7 @@ export function LabelEditorDrawer({
placeholder={t("common.key")}
value={newKey}
onChange={(e) => setNewKey(e.target.value)}
- className="flex-1 border border-control-border rounded-md px-2 py-1 text-sm"
+ className="flex-1 border border-control-border rounded-xs px-2 py-1 text-sm"
/>
<span className="text-control-placeholder">:</span>
<input
@@ -98,7 +101,7 @@ export function LabelEditorDrawer({
placeholder={t("common.value")}
value={newValue}
onChange={(e) => setNewValue(e.target.value)}
- className="flex-1 border border-control-border rounded-md px-2 py-1 text-sm"
+ className="flex-1 border border-control-border rounded-xs px-2 py-1 text-sm"
onKeyDown={(e) => {
if (e.key === "Enter") addLabelToAll();
}}
@@ -114,7 +117,7 @@ export function LabelEditorDrawer({
return (
<div
key={key}
- className="flex items-center justify-between rounded-md bg-gray-50 px-3 py-2"
+ className="flex items-center justify-between rounded-xs bg-gray-50 px-3 py-2"
>
<span className="text-sm">
{key}:
@@ -127,7 +130,7 @@ export function LabelEditorDrawer({
)}
</span>
<button
- className="p-0.5 hover:bg-gray-200 rounded"
+ className="p-0.5 hover:bg-gray-200 rounded-xs"
onClick={() => removeLabel(key)}
>
<X className="w-3 h-3" />
diff --git a/frontend/src/react/components/database/TransferProjectDrawer.tsx b/frontend/src/react/components/database/TransferProjectDrawer.tsx
index 5f881ff294..41ccc1394a 100644
--- a/frontend/src/react/components/database/TransferProjectDrawer.tsx
+++ b/frontend/src/react/components/database/TransferProjectDrawer.tsx
@@ -88,7 +88,10 @@ export function TransferProjectDrawer({
<h2 className="text-lg font-semibold">
{t("database.transfer-project")}
</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
<X className="w-4 h-4" />
</button>
</div>
@@ -97,7 +100,7 @@ export function TransferProjectDrawer({
{t("database.selected-n-databases", { n: databases.length })}
</p>
- <div className="border border-control-border rounded-md max-h-48 overflow-y-auto">
+ <div className="border border-control-border rounded-sm max-h-48 overflow-y-auto">
{databases.map((db) => (
<div
key={db.name}
@@ -145,9 +148,9 @@ export function TransferProjectDrawer({
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder={t("common.filter-by-name")}
- className="w-full border border-control-border rounded-md px-3 py-2 text-sm mb-2"
+ className="w-full border border-control-border rounded-xs px-3 py-2 text-sm mb-2"
/>
- <div className="border border-control-border rounded-md max-h-64 overflow-y-auto">
+ <div className="border border-control-border rounded-sm max-h-64 overflow-y-auto">
{loadingProjects ? (
<div className="px-3 py-4 text-sm text-center text-control-placeholder">
{t("common.loading")}
diff --git a/frontend/src/react/components/sql-review/RuleComponents.tsx b/frontend/src/react/components/sql-review/RuleComponents.tsx
index 989f17d80f..7760c1029b 100644
--- a/frontend/src/react/components/sql-review/RuleComponents.tsx
+++ b/frontend/src/react/components/sql-review/RuleComponents.tsx
@@ -287,7 +287,7 @@ function StringArrayInput({
{value.map((tag, i) => (
<span
key={i}
- className="inline-flex items-center gap-1 rounded bg-control-bg px-2 py-0.5 text-sm"
+ className="inline-flex items-center gap-1 rounded-xs bg-control-bg px-2 py-0.5 text-sm"
>
{tag}
{!disabled && (
diff --git a/frontend/src/react/components/sql-review/RuleTable.tsx b/frontend/src/react/components/sql-review/RuleTable.tsx
index 25c8386087..5c3890d9bc 100644
--- a/frontend/src/react/components/sql-review/RuleTable.tsx
+++ b/frontend/src/react/components/sql-review/RuleTable.tsx
@@ -1,15 +1,10 @@
-import {
- ChevronDown,
- ChevronRight,
- ExternalLink,
- Pencil,
- Search,
-} from "lucide-react";
+import { ChevronDown, ChevronRight, ExternalLink, Pencil } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { getRuleKey } from "@/components/SQLReview/components/utils";
import { t as vueT } from "@/plugins/i18n";
import { Button } from "@/react/components/ui/button";
+import { SearchInput } from "@/react/components/ui/search-input";
import { Tabs, TabsList, TabsTrigger } from "@/react/components/ui/tabs";
import type { Engine } from "@/types/proto-es/v1/common_pb";
import { SQLReviewRule_Level } from "@/types/proto-es/v1/review_config_service_pb";
@@ -221,10 +216,8 @@ export function RuleFilter({
</span>
</div>
)}
- <div className="relative ml-auto mt-2 md:mt-0 md:max-w-72 w-full md:w-auto">
- <Search className="absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-control-placeholder" />
- <input
- className="w-full rounded-xs border border-control-border bg-transparent py-1.5 pl-8 pr-3 text-sm text-main placeholder:text-control-placeholder focus:outline-hidden focus:ring-2 focus:ring-accent"
+ <div className="ml-auto mt-2 md:mt-0 md:max-w-72 w-full md:w-auto">
+ <SearchInput
placeholder={t("common.filter-by-name")}
value={params.searchText}
onChange={(e) => onChangeSearchText(e.target.value)}
@@ -532,7 +525,7 @@ function RuleTableRow({
type="checkbox"
checked={isSelected}
onChange={onToggleRule}
- className="h-4 w-4 rounded border-control-border accent-accent"
+ className="h-4 w-4 rounded-xs border-control-border accent-accent"
/>
</td>
)}
diff --git a/frontend/src/react/components/sql-review/TemplateSelector.tsx b/frontend/src/react/components/sql-review/TemplateSelector.tsx
index d21033341f..54c3d8cbed 100644
--- a/frontend/src/react/components/sql-review/TemplateSelector.tsx
+++ b/frontend/src/react/components/sql-review/TemplateSelector.tsx
@@ -100,7 +100,7 @@ export function TemplateSelector({
{reviewPolicyTemplateList.map((template) => (
<div
key={template.id}
- className={`relative border border-gray-300 hover:bg-gray-100 rounded-lg px-6 py-4 transition-all cursor-pointer w-full sm:max-w-xs ${
+ className={`relative border border-gray-300 hover:bg-gray-100 rounded-sm px-6 py-4 transition-all cursor-pointer w-full sm:max-w-xs ${
isSelected(template) ? "bg-gray-100" : "bg-transparent"
}`}
onClick={() => onSelectTemplate(template)}
@@ -136,7 +136,7 @@ export function TemplateSelector({
{builtInTemplateList.map((template) => (
<div
key={template.id}
- className={`relative border border-gray-300 hover:bg-gray-100 rounded-lg px-6 py-4 transition-all cursor-pointer w-full sm:max-w-xs ${
+ className={`relative border border-gray-300 hover:bg-gray-100 rounded-sm px-6 py-4 transition-all cursor-pointer w-full sm:max-w-xs ${
isSelected(template) ? "bg-gray-100" : "bg-transparent"
}`}
onClick={() => onSelectTemplate(template)}
diff --git a/frontend/src/react/components/ui/combobox.tsx b/frontend/src/react/components/ui/combobox.tsx
index fd1b6876dc..ad90018087 100644
--- a/frontend/src/react/components/ui/combobox.tsx
+++ b/frontend/src/react/components/ui/combobox.tsx
@@ -100,7 +100,7 @@ export function Combobox({
type="button"
disabled={disabled}
className={cn(
- "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-md h-9 px-3 text-sm bg-white text-left transition-colors",
+ "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-xs h-9 px-3 text-sm bg-white text-left transition-colors",
"hover:border-gray-400",
"disabled:opacity-50 disabled:pointer-events-none",
open && "border-accent shadow-[0_0_0_1px_var(--color-accent)]"
@@ -141,7 +141,7 @@ export function Combobox({
{/* Dropdown */}
{open && (
- <div className="absolute z-50 mt-1 min-w-full w-max bg-white border border-gray-200 rounded-md shadow-lg overflow-hidden">
+ <div className="absolute z-50 mt-1 min-w-full w-max bg-white border border-gray-200 rounded-sm shadow-lg overflow-hidden">
{/* Search */}
<div className="flex items-center gap-2 px-3 py-2 border-b border-gray-100">
<Search className="w-4 h-4 text-gray-400 shrink-0" />
diff --git a/frontend/src/react/components/ui/search-input.tsx b/frontend/src/react/components/ui/search-input.tsx
new file mode 100644
index 0000000000..2520a518cc
--- /dev/null
+++ b/frontend/src/react/components/ui/search-input.tsx
@@ -0,0 +1,22 @@
+import { Search } from "lucide-react";
+import type { ComponentProps } from "react";
+import { cn } from "@/react/lib/utils";
+import { Input } from "./input";
+
+type SearchInputProps = Omit<ComponentProps<typeof Input>, "className"> & {
+ className?: string;
+ wrapperClassName?: string;
+};
+
+export function SearchInput({
+ className,
+ wrapperClassName,
+ ...props
+}: SearchInputProps) {
+ return (
+ <div className={cn("relative flex-1", wrapperClassName)}>
+ <Search className="absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
+ <Input className={cn("h-9 text-sm pl-8", className)} {...props} />
+ </div>
+ );
+}
diff --git a/frontend/src/react/components/ui/select.tsx b/frontend/src/react/components/ui/select.tsx
index a3c534942f..acc47eeaba 100644
--- a/frontend/src/react/components/ui/select.tsx
+++ b/frontend/src/react/components/ui/select.tsx
@@ -48,7 +48,7 @@ function SelectContent({
<BaseSelect.Popup
ref={ref}
className={cn(
- "min-w-(--anchor-width) max-h-60 overflow-auto rounded-xs border border-control-border bg-white py-1 shadow-md",
+ "min-w-(--anchor-width) max-h-60 overflow-auto rounded-sm border border-control-border bg-white py-1 shadow-md",
className
)}
{...props}
diff --git a/frontend/src/react/components/ui/tooltip.tsx b/frontend/src/react/components/ui/tooltip.tsx
index 6485adc1ed..358c30088a 100644
--- a/frontend/src/react/components/ui/tooltip.tsx
+++ b/frontend/src/react/components/ui/tooltip.tsx
@@ -26,7 +26,7 @@ export function Tooltip({
</BaseTooltip.Trigger>
<BaseTooltip.Portal>
<BaseTooltip.Positioner side={side} sideOffset={4}>
- <BaseTooltip.Popup className="z-50 rounded-xs bg-gray-900 px-2.5 py-1.5 text-xs text-white shadow-md max-w-56">
+ <BaseTooltip.Popup className="z-50 rounded-sm bg-gray-900 px-2.5 py-1.5 text-xs text-white shadow-md max-w-56">
{content}
<BaseTooltip.Arrow className="fill-gray-900" />
</BaseTooltip.Popup>
@@ -60,7 +60,7 @@ export function BlockTooltip({
</BaseTooltip.Trigger>
<BaseTooltip.Portal>
<BaseTooltip.Positioner side={side} sideOffset={4}>
- <BaseTooltip.Popup className="z-50 rounded-xs bg-gray-900 px-2.5 py-1.5 text-xs text-white shadow-md max-w-56">
+ <BaseTooltip.Popup className="z-50 rounded-sm bg-gray-900 px-2.5 py-1.5 text-xs text-white shadow-md max-w-56">
{content}
<BaseTooltip.Arrow className="fill-gray-900" />
</BaseTooltip.Popup>
diff --git a/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx b/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx
index a60469ac90..eccf1295e7 100644
--- a/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx
+++ b/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx
@@ -487,7 +487,7 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {
</tbody>
</table>
- <div className="mt-3">
+ <div className="mt-4">
<PagedTableFooter
pageSize={paged.pageSize}
pageSizeOptions={paged.pageSizeOptions}
diff --git a/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx b/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx
index a650fa1074..f283c273b6 100644
--- a/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx
+++ b/frontend/src/react/pages/project/ProjectDatabaseGroupDetailPage.tsx
@@ -142,7 +142,7 @@ export function ProjectDatabaseGroupDetailPage({
className="fixed inset-0 z-10"
onClick={() => setShowDropdown(false)}
/>
- <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded shadow-md min-w-[100px]">
+ <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded-sm shadow-md min-w-[100px]">
<button
type="button"
className="w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-error"
diff --git a/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx b/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx
index 6037832772..69958d185e 100644
--- a/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx
+++ b/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx
@@ -296,7 +296,7 @@ function ActionDropdown({
<div className="relative flex justify-end">
<button
type="button"
- className="p-1 rounded hover:bg-gray-100"
+ className="p-1 rounded-xs hover:bg-gray-100"
onClick={(e) => {
e.stopPropagation();
setOpen((v) => !v);
@@ -308,7 +308,7 @@ function ActionDropdown({
<>
{/* backdrop */}
<div className="fixed inset-0 z-10" onClick={() => setOpen(false)} />
- <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded shadow-md min-w-[100px]">
+ <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded-sm shadow-md min-w-[100px]">
<button
type="button"
className="w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-error"
diff --git a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx b/frontend/src/react/pages/project/ProjectDatabasesPage.tsx
index acdc32f3d8..72d683c2f3 100644
--- a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx
+++ b/frontend/src/react/pages/project/ProjectDatabasesPage.tsx
@@ -427,7 +427,7 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {
className="fixed inset-0 bg-black/50"
onClick={() => setShowUnassignConfirm(false)}
/>
- <div className="relative bg-white rounded-lg shadow-lg p-6 max-w-md w-full mx-4">
+ <div className="relative bg-white rounded-sm shadow-lg p-6 max-w-md w-full mx-4">
<h3 className="text-lg font-semibold mb-2">
{t("database.unassign-alert-title")}
</h3>
diff --git a/frontend/src/react/pages/project/ProjectExportCenterPage.tsx b/frontend/src/react/pages/project/ProjectExportCenterPage.tsx
index d86af693d0..44a367b6df 100644
--- a/frontend/src/react/pages/project/ProjectExportCenterPage.tsx
+++ b/frontend/src/react/pages/project/ProjectExportCenterPage.tsx
@@ -515,7 +515,7 @@ function IssueListItem({
{validLabels.map((label: { value: string; color: string }) => (
<span
key={label.value}
- className="inline-flex items-center gap-x-1 px-1.5 py-0.5 rounded text-xs whitespace-nowrap border shrink-0"
+ className="inline-flex items-center gap-x-1 px-1.5 py-0.5 rounded-xs text-xs whitespace-nowrap border shrink-0"
>
<span
className="w-2.5 h-2.5 rounded-sm shrink-0"
diff --git a/frontend/src/react/pages/project/ProjectGitOpsPage.tsx b/frontend/src/react/pages/project/ProjectGitOpsPage.tsx
index 5bb9a3cc61..7c2d7cb994 100644
--- a/frontend/src/react/pages/project/ProjectGitOpsPage.tsx
+++ b/frontend/src/react/pages/project/ProjectGitOpsPage.tsx
@@ -304,7 +304,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {
return (
<div className="w-full px-4 flex flex-col gap-y-1 py-4">
{/* Section 1: What is GitOps */}
- <div className="border border-gray-200 rounded p-6 flex flex-col gap-y-3">
+ <div className="border border-gray-200 rounded-sm p-6 flex flex-col gap-y-3">
<div className="flex flex-col gap-y-1">
<h2 className="text-lg font-medium">{t("gitops.overview.title")}</h2>
<p className="textinfolabel">{t("gitops.overview.description")}</p>
@@ -332,7 +332,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {
<span className="mx-auto w-0.5 h-8 bg-block-border" aria-hidden="true" />
{/* Section 2: Checks before we start */}
- <div className="border border-gray-200 rounded p-6 flex flex-col gap-y-3">
+ <div className="border border-gray-200 rounded-sm p-6 flex flex-col gap-y-3">
<h2 className="text-lg font-medium">{t("gitops.checklist.title")}</h2>
<Alert variant="info">
@@ -471,7 +471,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {
{targetsString && (
<p className="text-sm text-control-light">
<span className="font-medium">targets:</span>{" "}
- <code className="text-xs bg-gray-100 px-1 py-0.5 rounded">
+ <code className="text-xs bg-gray-100 px-1 py-0.5 rounded-xs">
{targetsString}
</code>
</p>
@@ -483,7 +483,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {
<span className="mx-auto w-0.5 h-8 bg-block-border" aria-hidden="true" />
{/* Section 3: Workflow file generation */}
- <div className="border border-gray-200 rounded p-6 flex flex-col gap-y-3">
+ <div className="border border-gray-200 rounded-sm p-6 flex flex-col gap-y-3">
<div className="flex flex-col gap-y-1">
<h2 className="text-lg font-medium">{t("gitops.workflow.title")}</h2>
<p className="text-sm text-control-light">
@@ -575,7 +575,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {
<span className="mx-auto w-0.5 h-8 bg-block-border" aria-hidden="true" />
{/* Section 4: Test your first GitOps migration */}
- <div className="border border-gray-200 rounded p-6 flex flex-col gap-y-3">
+ <div className="border border-gray-200 rounded-sm p-6 flex flex-col gap-y-3">
<div className="flex flex-col gap-y-1">
<h2 className="text-lg font-medium">
{t("gitops.test-setup.title")}
@@ -840,7 +840,7 @@ function MultiDatabaseSelect({
{value.map((name) => (
<span
key={name}
- className="inline-flex items-center gap-x-1 px-2 py-0.5 text-xs bg-gray-100 rounded"
+ className="inline-flex items-center gap-x-1 px-2 py-0.5 text-xs bg-gray-100 rounded-xs"
>
{extractDatabaseResourceName(name).databaseName}
<button
diff --git a/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx b/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx
index c104834672..3792377a31 100644
--- a/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx
+++ b/frontend/src/react/pages/project/ProjectMaskingExemptionPage.tsx
@@ -924,7 +924,7 @@ function ExemptionMemberItem({
return (
<div
className={cn(
- "flex items-center gap-x-3 px-3 py-2.5 cursor-pointer rounded transition-colors",
+ "flex items-center gap-x-3 px-3 py-2.5 cursor-pointer rounded-xs transition-colors",
selected ? "bg-blue-50" : "hover:bg-gray-50"
)}
onClick={handleClick}
@@ -1061,7 +1061,7 @@ function ExemptionDetailPanel({
{member.grants.map((grant, idx) => (
<div
key={grant.id}
- className="border border-gray-200 rounded-lg overflow-hidden pt-4"
+ className="border border-gray-200 rounded-sm overflow-hidden pt-4"
>
<ExemptionGrantSection
grant={grant}
@@ -1392,12 +1392,12 @@ function ExemptionLevelCard({
const { t } = useTranslation();
return (
- <div className="flex items-center gap-x-6 px-4 py-3 bg-gray-50 rounded border border-gray-200">
+ <div className="flex items-center gap-x-6 px-4 py-3 bg-gray-50 rounded-xs border border-gray-200">
<div className="flex items-center gap-x-2">
<span className="textinfolabel font-medium uppercase text-xs">
{t("common.scope")}
</span>
- <span className="px-2 py-0.5 rounded text-xs bg-green-100 text-green-700 border border-green-200">
+ <span className="px-2 py-0.5 rounded-xs text-xs bg-green-100 text-green-700 border border-green-200">
{t("database.all")}
</span>
</div>
@@ -1465,7 +1465,7 @@ function LevelBadge({
return (
<span
className={cn(
- "px-1 py-0.5 rounded text-xs whitespace-nowrap",
+ "px-1 py-0.5 rounded-xs text-xs whitespace-nowrap",
colorClass
)}
>
diff --git a/frontend/src/react/pages/project/ProjectSettingsPage.tsx b/frontend/src/react/pages/project/ProjectSettingsPage.tsx
index a702374e4f..7ee93dc383 100644
--- a/frontend/src/react/pages/project/ProjectSettingsPage.tsx
+++ b/frontend/src/react/pages/project/ProjectSettingsPage.tsx
@@ -1128,7 +1128,7 @@ export function ProjectSettingsPage() {
<h1 className="text-2xl font-bold">{t("common.danger-zone")}</h1>
</div>
<div className="flex-1 mt-4 lg:px-4 lg:mt-0">
- <div className="border border-error-alpha bg-error-alpha rounded-lg divide-y divide-error-alpha">
+ <div className="border border-error-alpha bg-error-alpha rounded-sm divide-y divide-error-alpha">
{/* Archive / Restore */}
<div className="p-6 flex items-start justify-between gap-x-6">
{project.state === State.ACTIVE ? (
diff --git a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx
index f0ca457481..264b0ccdca 100644
--- a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx
+++ b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx
@@ -846,7 +846,7 @@ function ChangelogSelector({
type="button"
disabled={disabled}
className={cn(
- "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-md h-9 px-3 text-sm bg-white text-left transition-colors",
+ "w-full flex items-center justify-between gap-2 border border-gray-300 rounded-xs h-9 px-3 text-sm bg-white text-left transition-colors",
"hover:border-gray-400",
"disabled:opacity-50 disabled:pointer-events-none",
open && "border-accent shadow-[0_0_0_1px_var(--color-accent)]"
@@ -868,7 +868,7 @@ function ChangelogSelector({
/>
</button>
{open && (
- <div className="absolute z-50 mt-1 min-w-full w-max bg-white border border-gray-200 rounded-md shadow-lg overflow-hidden">
+ <div className="absolute z-50 mt-1 min-w-full w-max bg-white border border-gray-200 rounded-sm shadow-lg overflow-hidden">
<div className="max-h-60 overflow-y-auto">
{entries.map((entry) => (
<button
@@ -1452,10 +1452,10 @@ function SelectTargetDatabasesView({
</div>
{targetDatabaseList.length > 0 && (
<div className="w-full mt-2 px-2">
- <div className="flex rounded-md bg-gray-100 p-0.5">
+ <div className="flex rounded-xs bg-gray-100 p-0.5">
<button
className={cn(
- "flex-1 text-xs px-2 py-1 rounded transition-colors",
+ "flex-1 text-xs px-2 py-1 rounded-xs transition-colors",
showDatabaseWithDiff
? "bg-white shadow-sm font-medium"
: "text-gray-500 hover:text-gray-700"
@@ -1469,7 +1469,7 @@ function SelectTargetDatabasesView({
</button>
<button
className={cn(
- "flex-1 text-xs px-2 py-1 rounded transition-colors",
+ "flex-1 text-xs px-2 py-1 rounded-xs transition-colors",
!showDatabaseWithDiff
? "bg-white shadow-sm font-medium"
: "text-gray-500 hover:text-gray-700"
@@ -2029,7 +2029,10 @@ function TargetDatabasesSelectPanel({
<h2 className="text-lg font-semibold">
{t("database.sync-schema.target-databases")}
</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
&times;
</button>
</div>
@@ -2038,7 +2041,7 @@ function TargetDatabasesSelectPanel({
<div className="px-6 pt-4">
<input
type="text"
- className="w-full border border-gray-300 rounded-md h-9 px-3 text-sm"
+ className="w-full border border-gray-300 rounded-xs h-9 px-3 text-sm"
placeholder={t("database.filter-database")}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
diff --git a/frontend/src/react/pages/project/ProjectWebhookForm.tsx b/frontend/src/react/pages/project/ProjectWebhookForm.tsx
index 70bc2ddf4b..346a0e6f62 100644
--- a/frontend/src/react/pages/project/ProjectWebhookForm.tsx
+++ b/frontend/src/react/pages/project/ProjectWebhookForm.tsx
@@ -347,7 +347,7 @@ export function ProjectWebhookForm({
{/* Missing external URL warning */}
{!externalUrl && (
- <div className="mb-6 p-3 border border-red-300 bg-red-50 rounded text-sm text-red-800">
+ <div className="mb-6 p-3 border border-red-300 bg-red-50 rounded-xs text-sm text-red-800">
<div className="font-medium">{t("banner.external-url")}</div>
<div className="mt-1">
{t("settings.general.workspace.external-url.description")}
@@ -494,7 +494,7 @@ export function ProjectWebhookForm({
<div className="text-md leading-6 font-medium text-main">
{t("project.webhook.direct-messages")}
</div>
- <div className="my-2 p-3 border rounded text-sm">
+ <div className="my-2 p-3 border rounded-xs text-sm">
{imApp ? (
<span>{t("project.webhook.direct-messages-tip")}</span>
) : (
@@ -632,7 +632,7 @@ function DetailDropdown({
<div className="relative">
<button
type="button"
- className="p-1 rounded hover:bg-gray-100"
+ className="p-1 rounded-xs hover:bg-gray-100"
onClick={() => setOpen((v) => !v)}
>
<EllipsisVertical className="w-4 h-4" />
@@ -640,7 +640,7 @@ function DetailDropdown({
{open && (
<>
<div className="fixed inset-0 z-10" onClick={() => setOpen(false)} />
- <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded shadow-md min-w-[100px]">
+ <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded-sm shadow-md min-w-[100px]">
<button
type="button"
className="w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-error"
diff --git a/frontend/src/react/pages/project/ProjectWebhooksPage.tsx b/frontend/src/react/pages/project/ProjectWebhooksPage.tsx
index 67ee3441d9..7bde33adc1 100644
--- a/frontend/src/react/pages/project/ProjectWebhooksPage.tsx
+++ b/frontend/src/react/pages/project/ProjectWebhooksPage.tsx
@@ -204,7 +204,7 @@ function WebhookTable({
{activityTitles.map((title) => (
<span
key={title}
- className="inline-block px-2 py-0.5 text-xs rounded bg-gray-100 text-gray-700"
+ className="inline-block px-2 py-0.5 text-xs rounded-xs bg-gray-100 text-gray-700"
>
{title}
</span>
@@ -239,7 +239,7 @@ function ActionDropdown({
<div className="relative flex justify-end">
<button
type="button"
- className="p-1 rounded hover:bg-gray-100"
+ className="p-1 rounded-xs hover:bg-gray-100"
onClick={(e) => {
e.stopPropagation();
setOpen((v) => !v);
@@ -256,7 +256,7 @@ function ActionDropdown({
setOpen(false);
}}
/>
- <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded shadow-md min-w-[100px]">
+ <div className="absolute right-0 top-full z-20 mt-1 bg-white border rounded-sm shadow-md min-w-[100px]">
<button
type="button"
className="w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-error"
diff --git a/frontend/src/react/pages/project/export-center/DataExportPrepDrawer.tsx b/frontend/src/react/pages/project/export-center/DataExportPrepDrawer.tsx
index 1b540f23c6..8607ce7acc 100644
--- a/frontend/src/react/pages/project/export-center/DataExportPrepDrawer.tsx
+++ b/frontend/src/react/pages/project/export-center/DataExportPrepDrawer.tsx
@@ -307,7 +307,7 @@ export function DataExportPrepDrawer({
{t("custom-approval.risk-rule.risk.namespace.data_export")}
</span>
<button
- className="p-1 hover:bg-control-bg rounded"
+ className="p-1 hover:bg-control-bg rounded-xs"
onClick={onClose}
>
<X className="w-4 h-4" />
@@ -663,7 +663,7 @@ function IssueLabelSelect({
return (
<span
key={val}
- className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-gray-100 text-xs"
+ className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded-xs bg-gray-100 text-xs"
>
<span
className="w-2.5 h-2.5 rounded-sm shrink-0"
@@ -712,7 +712,7 @@ function IssueLabelSelect({
type="checkbox"
checked={isSelected}
readOnly
- className="rounded border-gray-300 accent-accent"
+ className="rounded-xs border-gray-300 accent-accent"
/>
<span
className="w-4 h-4 rounded-sm shrink-0"
diff --git a/frontend/src/react/pages/settings/DataClassificationPage.tsx b/frontend/src/react/pages/settings/DataClassificationPage.tsx
index e38b354b59..73620f8ea9 100644
--- a/frontend/src/react/pages/settings/DataClassificationPage.tsx
+++ b/frontend/src/react/pages/settings/DataClassificationPage.tsx
@@ -4,7 +4,6 @@ import {
ChevronRight,
ExternalLink,
Pencil,
- Search,
Trash2,
Undo2,
X,
@@ -22,7 +21,7 @@ import { v4 as uuidv4 } from "uuid";
import classificationExample from "@/components/SensitiveData/classification-example.json";
import { FeatureAttention } from "@/react/components/FeatureAttention";
import { Button } from "@/react/components/ui/button";
-import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import { useVueState } from "@/react/hooks/useVueState";
import {
pushNotification,
@@ -338,13 +337,11 @@ function ClassificationTree({
return (
<div className="space-y-4 h-full">
- <div className="relative max-w-full">
- <Search className="absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-control-placeholder" />
- <Input
+ <div>
+ <SearchInput
value={searchText}
onChange={(e) => setSearchText(e.target.value)}
placeholder={t("schema-template.classification.search")}
- className="pl-8"
/>
</div>
<div>
diff --git a/frontend/src/react/pages/settings/EnvironmentsPage.tsx b/frontend/src/react/pages/settings/EnvironmentsPage.tsx
index 8311eb10aa..7b14a55b3c 100644
--- a/frontend/src/react/pages/settings/EnvironmentsPage.tsx
+++ b/frontend/src/react/pages/settings/EnvironmentsPage.tsx
@@ -326,7 +326,7 @@ function RolloutPolicyConfig({
{t("common.add")}
</Button>
{showRoleDropdown && (
- <div className="absolute z-50 mt-1 w-64 max-h-60 overflow-auto rounded-xs border border-control-border bg-white py-1 shadow-md">
+ <div className="absolute z-50 mt-1 w-64 max-h-60 overflow-auto rounded-sm border border-control-border bg-white py-1 shadow-md">
{availableRoles.map((group) => (
<div key={group.label}>
<div className="px-2 py-1 text-xs font-semibold text-gray-500 uppercase">
@@ -539,7 +539,7 @@ function SQLReviewSectionInner(
{t("sql-review.configure-policy")}
</Button>
{showSelectPanel && (
- <div className="absolute z-50 mt-1 w-80 max-h-60 overflow-auto rounded-xs border border-control-border bg-white py-1 shadow-md">
+ <div className="absolute z-50 mt-1 w-80 max-h-60 overflow-auto rounded-sm border border-control-border bg-white py-1 shadow-md">
{reviewPolicyList.length === 0 ? (
<div className="px-3 py-2 text-sm text-gray-400">
{t("common.no-data")}
diff --git a/frontend/src/react/pages/settings/GroupsPage.tsx b/frontend/src/react/pages/settings/GroupsPage.tsx
index 9eb522fff3..528fa669ca 100644
--- a/frontend/src/react/pages/settings/GroupsPage.tsx
+++ b/frontend/src/react/pages/settings/GroupsPage.tsx
@@ -5,7 +5,6 @@ import {
ChevronRight,
Pencil,
Plus,
- Search,
Settings,
Trash2,
Users,
@@ -19,6 +18,7 @@ import { Alert, AlertDescription } from "@/react/components/ui/alert";
import { Badge } from "@/react/components/ui/badge";
import { Button } from "@/react/components/ui/button";
import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import { Tooltip } from "@/react/components/ui/tooltip";
import { useEscapeKey } from "@/react/hooks/useEscapeKey";
import { useVueState } from "@/react/hooks/useVueState";
@@ -310,7 +310,7 @@ function GroupRow({
<td className="px-4 py-2">
<div className="flex items-center gap-x-2">
<button
- className="shrink-0 p-0.5 rounded hover:bg-gray-200"
+ className="shrink-0 p-0.5 rounded-xs hover:bg-gray-200"
onClick={onToggle}
>
{isExpanded ? (
@@ -983,16 +983,12 @@ export function GroupsPage() {
return (
<div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">
{/* Action bar */}
- <div className="flex items-center justify-between mb-4">
- <div className="relative">
- <Input
- placeholder={t("common.filter-by-name")}
- value={groupSearchText}
- onChange={(e) => setGroupSearchText(e.target.value)}
- className="h-8 text-sm pr-8"
- />
- <Search className="absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
- </div>
+ <div className="flex items-center justify-between gap-x-2 mb-4">
+ <SearchInput
+ placeholder={t("common.filter-by-name")}
+ value={groupSearchText}
+ onChange={(e) => setGroupSearchText(e.target.value)}
+ />
<div className="flex items-center gap-x-2">
<Button
variant="outline"
@@ -1070,14 +1066,16 @@ export function GroupsPage() {
onGroupSelected={handleGroupSelected}
onGroupDeleted={handleGroupDeleted}
/>
- <PagedTableFooter
- pageSize={groupPaged.pageSize}
- pageSizeOptions={groupPaged.pageSizeOptions}
- onPageSizeChange={groupPaged.onPageSizeChange}
- hasMore={groupPaged.hasMore}
- isFetchingMore={groupPaged.isFetchingMore}
- onLoadMore={groupPaged.loadMore}
- />
+ <div className="mt-4">
+ <PagedTableFooter
+ pageSize={groupPaged.pageSize}
+ pageSizeOptions={groupPaged.pageSizeOptions}
+ onPageSizeChange={groupPaged.onPageSizeChange}
+ hasMore={groupPaged.hasMore}
+ isFetchingMore={groupPaged.isFetchingMore}
+ onLoadMore={groupPaged.loadMore}
+ />
+ </div>
</>
)}
</ComponentPermissionGuard>
diff --git a/frontend/src/react/pages/settings/IDPsPage.tsx b/frontend/src/react/pages/settings/IDPsPage.tsx
index 61b7cfbcbd..21ff826084 100644
--- a/frontend/src/react/pages/settings/IDPsPage.tsx
+++ b/frontend/src/react/pages/settings/IDPsPage.tsx
@@ -1771,7 +1771,7 @@ function CreateWizardDrawer({
return (
<label
key={tmpl.title}
- className={`block border rounded-xs p-4 transition-colors cursor-pointer ${
+ className={`block border rounded-sm p-4 transition-colors cursor-pointer ${
selectedTemplate?.title === tmpl.title
? "border-blue-500 bg-blue-50"
: "border-gray-200 hover:border-gray-300"
diff --git a/frontend/src/react/pages/settings/InstancesPage.tsx b/frontend/src/react/pages/settings/InstancesPage.tsx
index 6a07c92f53..5f576f1ef7 100644
--- a/frontend/src/react/pages/settings/InstancesPage.tsx
+++ b/frontend/src/react/pages/settings/InstancesPage.tsx
@@ -61,6 +61,7 @@ import {
hostPortOfInstanceV1,
supportedEngineV1List,
} from "@/utils";
+import { PagedTableFooter } from "./shared/usePagedData";
// ============================================================
// Pagination helpers
@@ -373,7 +374,7 @@ function InstanceActionDropdown({
<>
<div ref={dropdownRef} className="relative">
<button
- className="p-1 hover:bg-control-bg rounded"
+ className="p-1 hover:bg-control-bg rounded-xs"
onClick={(e) => {
e.stopPropagation();
setOpen(!open);
@@ -520,7 +521,10 @@ function EditEnvironmentDrawer({
<h2 className="text-lg font-semibold">
{t("database.edit-environment")}
</h2>
- <button className="p-1 hover:bg-control-bg rounded" onClick={onClose}>
+ <button
+ className="p-1 hover:bg-control-bg rounded-xs"
+ onClick={onClose}
+ >
&times;
</button>
</div>
@@ -1338,35 +1342,15 @@ export function InstancesPage() {
</table>
{/* Pagination footer */}
- <div className="flex items-center justify-end gap-x-2 mx-4">
- <div className="flex items-center gap-x-2">
- <span className="text-sm text-control-light">
- {t("common.rows-per-page")}
- </span>
- <select
- className="border border-control-border rounded-sm text-sm pl-2 pr-6 py-1 min-w-[5rem]"
- value={pageSize}
- onChange={(e) => setPageSize(Number(e.target.value))}
- >
- {pageSizeOptions.map((size) => (
- <option key={size} value={size}>
- {size}
- </option>
- ))}
- </select>
- </div>
- {hasMore && (
- <Button
- variant="ghost"
- size="sm"
- disabled={isFetchingMore}
- onClick={loadMore}
- >
- <span className="text-sm text-control-light">
- {isFetchingMore ? t("common.loading") : t("common.load-more")}
- </span>
- </Button>
- )}
+ <div className="mx-4">
+ <PagedTableFooter
+ pageSize={pageSize}
+ pageSizeOptions={pageSizeOptions}
+ onPageSizeChange={setPageSize}
+ hasMore={hasMore}
+ isFetchingMore={isFetchingMore}
+ onLoadMore={loadMore}
+ />
</div>
</div>
</div>
diff --git a/frontend/src/react/pages/settings/MCPPage.tsx b/frontend/src/react/pages/settings/MCPPage.tsx
index 636197f526..f2d94e1542 100644
--- a/frontend/src/react/pages/settings/MCPPage.tsx
+++ b/frontend/src/react/pages/settings/MCPPage.tsx
@@ -199,7 +199,7 @@ export function MCPPage() {
{t("settings.mcp.first-prompt.description")}
</p>
</div>
- <code className="text-sm bg-gray-100 px-3 py-2 rounded">
+ <code className="text-sm bg-gray-100 px-3 py-2 rounded-xs">
{firstPromptExample}
</code>
</div>
diff --git a/frontend/src/react/pages/settings/MembersPage.tsx b/frontend/src/react/pages/settings/MembersPage.tsx
index dbf378a70a..9f4d897031 100644
--- a/frontend/src/react/pages/settings/MembersPage.tsx
+++ b/frontend/src/react/pages/settings/MembersPage.tsx
@@ -7,7 +7,6 @@ import {
Info,
Pencil,
Plus,
- Search,
Trash2,
Users,
X,
@@ -28,10 +27,15 @@ import {
} from "@/components/ProjectMember/utils";
import { DatabaseResourceSelector as DatabaseResourceSelectorComponent } from "@/react/components/DatabaseResourceSelector";
import { EnvironmentLabel } from "@/react/components/EnvironmentLabel";
-import { FeatureBadge } from "@/react/components/FeatureBadge";
+import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
+} from "@/react/components/ui/alert";
import { Badge } from "@/react/components/ui/badge";
import { Button } from "@/react/components/ui/button";
import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import {
Tabs,
TabsList,
@@ -60,13 +64,10 @@ import {
isDefaultProject,
userBindingPrefix,
} from "@/types";
-import { PRESET_PROJECT_ROLES, PRESET_ROLES } from "@/types/iam";
import { ExprSchema as ConditionExprSchema } from "@/types/proto-es/google/type/expr_pb";
import { State } from "@/types/proto-es/v1/common_pb";
import { type Binding, BindingSchema } from "@/types/proto-es/v1/iam_policy_pb";
-import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import {
- displayRoleDescription,
displayRoleTitle,
formatAbsoluteDateTime,
hasProjectPermissionV2,
@@ -79,7 +80,7 @@ import {
stringifyConditionExpression,
} from "@/utils/issue/cel";
import { AccountMultiSelect } from "./shared/AccountMultiSelect";
-import { RoleMultiSelect } from "./shared/RoleMultiSelect";
+import { RoleSelect } from "./shared/RoleSelect";
import { UserAvatar } from "./shared/UserAvatar";
const EMPTY_ROLE_SET = new Set<string>();
@@ -470,163 +471,6 @@ function MemberTableByRole({
);
}
-// ============================================================
-// ProjectRoleSelect — single-select dropdown for project roles
-// ============================================================
-
-function ProjectRoleSelect({
- value,
- onChange,
-}: {
- value: string;
- onChange: (role: string) => void;
-}) {
- const { t } = useTranslation();
- const roleStore = useRoleStore();
- const subscriptionStore = useSubscriptionV1Store();
- const roleList = useVueState(() => [...roleStore.roleList]);
- const hasCustomRoleFeature = useVueState(() =>
- subscriptionStore.hasInstanceFeature(PlanFeature.FEATURE_CUSTOM_ROLES)
- );
- const [open, setOpen] = useState(false);
- const [search, setSearch] = useState("");
- const containerRef = useRef<HTMLDivElement>(null);
- const inputRef = useRef<HTMLInputElement>(null);
-
- const handleClickOutside = useCallback(() => {
- setOpen(false);
- setSearch("");
- }, []);
- useClickOutside(containerRef, open, handleClickOutside);
-
- const groups = useMemo(() => {
- const kw = search.toLowerCase();
- const matchRole = (name: string) =>
- !kw || displayRoleTitle(name).toLowerCase().includes(kw);
-
- const project = PRESET_PROJECT_ROLES.filter(matchRole);
- const custom = roleList
- .filter((r) => !PRESET_ROLES.includes(r.name))
- .map((r) => r.name)
- .filter(matchRole);
-
- const result: { label: string; roles: string[] }[] = [];
- if (project.length > 0)
- result.push({ label: t("role.project-roles.self"), roles: project });
- if (custom.length > 0)
- result.push({ label: t("role.custom-roles.self"), roles: custom });
- return result;
- }, [roleList, search, t]);
-
- const isCustomRole = (name: string) => !PRESET_ROLES.includes(name);
-
- const select = (roleName: string) => {
- const isCustom = isCustomRole(roleName);
- if (isCustom && !hasCustomRoleFeature) return;
- onChange(roleName);
- setOpen(false);
- setSearch("");
- };
-
- return (
- <div ref={containerRef} className="relative">
- <div
- className={cn(
- "flex items-center min-h-[2.25rem] w-full rounded-xs border border-control-border bg-transparent px-2 py-1 text-sm cursor-pointer",
- open && "ring-2 ring-accent border-accent"
- )}
- onClick={() => {
- setOpen(!open);
- requestAnimationFrame(() => inputRef.current?.focus());
- }}
- >
- {open ? (
- <input
- ref={inputRef}
- className="flex-1 min-w-[4rem] outline-hidden text-sm bg-transparent"
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- placeholder={
- value
- ? displayRoleTitle(value)
- : t("settings.members.assign-role")
- }
- />
- ) : (
- <span className={cn("flex-1", !value && "text-control-placeholder")}>
- {value
- ? displayRoleTitle(value)
- : t("settings.members.assign-role")}
- </span>
- )}
- <ChevronDown className="ml-auto h-4 w-4 shrink-0 text-control-light" />
- </div>
-
- {open && (
- <div className="absolute z-50 mt-1 w-full bg-white border border-control-border rounded-sm shadow-lg max-h-60 overflow-auto">
- {groups.length === 0 && (
- <div className="px-3 py-2 text-sm text-control-light">
- {t("common.no-data")}
- </div>
- )}
- {groups.map((group) => (
- <div key={group.label}>
- <div className="px-3 py-1.5 text-xs font-medium text-control-light uppercase tracking-wide bg-gray-50">
- {group.label}
- </div>
- {group.roles.map((roleName) => {
- const selected = value === roleName;
- const isCustom = isCustomRole(roleName);
- const blocked = isCustom && !hasCustomRoleFeature;
- return (
- <div
- key={roleName}
- className={cn(
- "flex items-center gap-x-2 px-3 py-1.5 text-sm hover:bg-gray-50",
- selected && "bg-accent/5",
- blocked
- ? "opacity-50 cursor-not-allowed"
- : "cursor-pointer"
- )}
- onClick={() => select(roleName)}
- >
- <div
- className={cn(
- "h-4 w-4 rounded-full border flex items-center justify-center shrink-0",
- selected
- ? "bg-accent border-accent text-white"
- : "border-control-border"
- )}
- >
- {selected && <Check className="h-3 w-3" />}
- </div>
- <div className="flex flex-col">
- <div className="flex items-center gap-x-1">
- <span>{displayRoleTitle(roleName)}</span>
- {blocked && (
- <FeatureBadge
- feature={PlanFeature.FEATURE_CUSTOM_ROLES}
- clickable={false}
- />
- )}
- </div>
- {displayRoleDescription(roleName) && (
- <span className="text-xs text-control-light">
- {displayRoleDescription(roleName)}
- </span>
- )}
- </div>
- </div>
- );
- })}
- </div>
- ))}
- </div>
- )}
- </div>
- );
-}
-
// ============================================================
// Expiration presets
// ============================================================
@@ -934,7 +778,12 @@ function ProjectRoleBindingForm({
<label className="block text-sm font-medium text-control">
{t("settings.members.assign-role")}
</label>
- <ProjectRoleSelect value={form.role} onChange={handleRoleChange} />
+ <RoleSelect
+ value={form.role ? [form.role] : []}
+ onChange={(roles) => handleRoleChange(roles[0] ?? "")}
+ multiple={false}
+ scope="project"
+ />
</div>
{/* Permissions display */}
@@ -1654,7 +1503,7 @@ function EditMemberRoleDrawer({
<label className="block text-sm font-medium text-control">
{t("settings.members.select-role", { count: 2 })}
</label>
- <RoleMultiSelect
+ <RoleSelect
value={selectedRoles}
onChange={setSelectedRoles}
scope={projectName ? "project" : undefined}
@@ -1700,10 +1549,19 @@ function EditMemberRoleDrawer({
export function MembersPage({ projectId }: { projectId?: string }) {
const { t } = useTranslation();
const workspaceStore = useWorkspaceV1Store();
+ const actuatorStore = useActuatorV1Store();
+ const subscriptionStore = useSubscriptionV1Store();
const currentUser = useVueState(() => useCurrentUserV1().value);
const projectStore = useProjectV1Store();
const projectIamPolicyStore = useProjectIamPolicyStore();
+ const activeUserCount = useVueState(() => actuatorStore.activeUserCount);
+ const userCountLimit = useVueState(() => subscriptionStore.userCountLimit);
+ const remainingUserCount = useMemo(
+ () => Math.max(0, userCountLimit - activeUserCount),
+ [userCountLimit, activeUserCount]
+ );
+
const projectName = projectId
? `${projectNamePrefix}${projectId}`
: undefined;
@@ -1833,6 +1691,22 @@ export function MembersPage({ projectId }: { projectId?: string }) {
return (
<div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">
+ {!projectName && remainingUserCount <= 3 && (
+ <Alert variant="warning" className="mb-2">
+ <AlertTitle>{t("subscription.usage.user-count.title")}</AlertTitle>
+ <AlertDescription>
+ {remainingUserCount > 0
+ ? t("subscription.usage.user-count.remaining", {
+ total: userCountLimit,
+ count: remainingUserCount,
+ })
+ : t("subscription.usage.user-count.runoutof", {
+ total: userCountLimit,
+ })}{" "}
+ {t("subscription.usage.user-count.upgrade")}
+ </AlertDescription>
+ </Alert>
+ )}
{projectName && (
<div className="textinfolabel px-4 pt-4">
{t("project.members.description")}{" "}
@@ -1847,16 +1721,12 @@ export function MembersPage({ projectId }: { projectId?: string }) {
</div>
)}
- <div className="flex items-center justify-between mb-4">
- <div className="relative">
- <Input
- placeholder={t("settings.members.search-member")}
- value={memberSearchText}
- onChange={(e) => setMemberSearchText(e.target.value)}
- className="h-8 text-sm pr-8"
- />
- <Search className="absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
- </div>
+ <div className="flex items-center justify-between gap-x-2 mb-4">
+ <SearchInput
+ placeholder={t("settings.members.search-member")}
+ value={memberSearchText}
+ onChange={(e) => setMemberSearchText(e.target.value)}
+ />
<div className="flex items-center gap-x-2">
{memberViewTab === "MEMBERS" && (
<Button
diff --git a/frontend/src/react/pages/settings/ProjectsPage.tsx b/frontend/src/react/pages/settings/ProjectsPage.tsx
index ca7b3915b3..a7a7130bcf 100644
--- a/frontend/src/react/pages/settings/ProjectsPage.tsx
+++ b/frontend/src/react/pages/settings/ProjectsPage.tsx
@@ -45,6 +45,7 @@ import {
hasProjectPermissionV2,
hasWorkspacePermissionV2,
} from "@/utils";
+import { PagedTableFooter } from "./shared/usePagedData";
// ============================================================
// Escape key stack for overlays
@@ -305,7 +306,7 @@ function CreateProjectDrawer({
{t("quick-action.create-project")}
</h2>
<button
- className="p-1 hover:bg-control-bg rounded"
+ className="p-1 hover:bg-control-bg rounded-xs"
onClick={closeDrawer}
>
<X className="h-5 w-5" />
@@ -550,7 +551,7 @@ function BatchOperationsBar({
projects={selectedProjects}
iconColor="text-red-600"
/>
- <div className="rounded-xs border border-error bg-error/5 p-3">
+ <div className="rounded-sm border border-error bg-error/5 p-3">
<p className="text-sm font-medium text-error">
{t("common.cannot-undo-this-action")}
</p>
@@ -650,7 +651,7 @@ function ProjectActionDropdown({
return (
<div ref={dropdownRef} className="relative">
<button
- className="p-1 hover:bg-control-bg rounded"
+ className="p-1 hover:bg-control-bg rounded-xs"
onClick={(e) => {
e.stopPropagation();
setOpen(!open);
@@ -1179,35 +1180,15 @@ export function ProjectsPage() {
</table>
{/* Pagination footer */}
- <div className="flex items-center justify-end gap-x-2 mx-4">
- <div className="flex items-center gap-x-2">
- <span className="text-sm text-control-light">
- {t("common.rows-per-page")}
- </span>
- <select
- className="border border-control-border rounded-sm text-sm pl-2 pr-6 py-1 min-w-[5rem]"
- value={pageSize}
- onChange={(e) => setPageSize(Number(e.target.value))}
- >
- {pageSizeOptions.map((size) => (
- <option key={size} value={size}>
- {size}
- </option>
- ))}
- </select>
- </div>
- {hasMore && (
- <Button
- variant="ghost"
- size="sm"
- disabled={isFetchingMore}
- onClick={loadMore}
- >
- <span className="text-sm text-control-light">
- {isFetchingMore ? t("common.loading") : t("common.load-more")}
- </span>
- </Button>
- )}
+ <div className="mx-4">
+ <PagedTableFooter
+ pageSize={pageSize}
+ pageSizeOptions={pageSizeOptions}
+ onPageSizeChange={setPageSize}
+ hasMore={hasMore}
+ isFetchingMore={isFetchingMore}
+ onLoadMore={loadMore}
+ />
</div>
</div>
diff --git a/frontend/src/react/pages/settings/RolesPage.tsx b/frontend/src/react/pages/settings/RolesPage.tsx
index c00251ccf5..e0e81ff380 100644
--- a/frontend/src/react/pages/settings/RolesPage.tsx
+++ b/frontend/src/react/pages/settings/RolesPage.tsx
@@ -1,7 +1,7 @@
import { create } from "@bufbuild/protobuf";
import { Code, ConnectError } from "@connectrpc/connect";
import { cloneDeep, sortBy, uniq } from "lodash-es";
-import { Pencil, Plus, Search, Trash2, X } from "lucide-react";
+import { Pencil, Plus, Trash2, X } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { FeatureAttention } from "@/react/components/FeatureAttention";
@@ -19,6 +19,7 @@ import {
import { Badge } from "@/react/components/ui/badge";
import { Button } from "@/react/components/ui/button";
import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import { Textarea } from "@/react/components/ui/textarea";
import { useVueState } from "@/react/hooks/useVueState";
import {
@@ -44,6 +45,7 @@ import {
isCustomRole,
} from "@/utils";
import { extractGrpcErrorMessage, getErrorCode } from "@/utils/connect";
+import { RoleSelect } from "./shared/RoleSelect";
// Escape key stack: only the topmost overlay handles Escape.
const escapeStack: (() => void)[] = [];
@@ -136,16 +138,14 @@ function PermissionTransfer({
</span>
</div>
<div className="px-3 py-2 border-b">
- <div className="relative">
- <Input
- placeholder={t("common.search")}
- value={sourceFilter}
- onChange={(e) => setSourceFilter(e.target.value)}
- className="h-8 text-sm pr-8"
- disabled={disabled}
- />
- <Search className="absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
- </div>
+ <SearchInput
+ placeholder={t("common.search")}
+ value={sourceFilter}
+ onChange={(e) => setSourceFilter(e.target.value)}
+ className="h-8"
+ wrapperClassName="flex-none"
+ disabled={disabled}
+ />
</div>
<div className="flex-1 overflow-auto">
{sourceItems.map((p) => (
@@ -241,18 +241,11 @@ function ImportPermissionModal({
<label className="textlabel mb-1 block">
{t("role.select-role")}
</label>
- <select
- value={selectedRoleName}
- onChange={(e) => setSelectedRoleName(e.target.value)}
- className="flex h-9 w-full rounded-xs border border-control-border bg-transparent px-3 py-1 text-sm"
- >
- <option value="">--</option>
- {roleList.map((role) => (
- <option key={role.name} value={role.name}>
- {displayRoleTitle(role.name)}
- </option>
- ))}
- </select>
+ <RoleSelect
+ value={selectedRoleName ? [selectedRoleName] : []}
+ onChange={(roles) => setSelectedRoleName(roles[0] ?? "")}
+ multiple={false}
+ />
</div>
{selectedRole && (
diff --git a/frontend/src/react/pages/settings/SQLReviewPage.tsx b/frontend/src/react/pages/settings/SQLReviewPage.tsx
index 0cad81863c..48b21ddbb4 100644
--- a/frontend/src/react/pages/settings/SQLReviewPage.tsx
+++ b/frontend/src/react/pages/settings/SQLReviewPage.tsx
@@ -1,18 +1,10 @@
-import {
- Check,
- ExternalLink,
- Pencil,
- Plus,
- Search,
- Trash2,
- X,
-} from "lucide-react";
+import { Check, ExternalLink, Pencil, Plus, Trash2, X } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { ResourceLink } from "@/react/components/sql-review/ResourceLink";
import { Badge } from "@/react/components/ui/badge";
import { Button } from "@/react/components/ui/button";
-import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import { Tooltip } from "@/react/components/ui/tooltip";
import { useVueState } from "@/react/hooks/useVueState";
import { router } from "@/router";
@@ -140,7 +132,7 @@ function PolicyTable({
type="checkbox"
checked={policy.enforce}
onChange={(e) => toggleEnabled(policy, e.target.checked)}
- className="h-4 w-4 rounded border-control-border accent-accent"
+ className="h-4 w-4 rounded-xs border-control-border accent-accent"
/>
) : policy.enforce ? (
<Check className="w-4 h-4 text-control-light" />
@@ -313,16 +305,13 @@ export function SQLReviewPage() {
</div>
<div className="flex justify-end items-center gap-x-2">
- <div className="relative max-w-full">
- <Search className="absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-control-light pointer-events-none" />
- <Input
- value={searchText}
- onChange={(e) => setSearchText(e.target.value)}
- placeholder={t("common.filter-by-name")}
- className="pl-8"
- autoFocus
- />
- </div>
+ <SearchInput
+ value={searchText}
+ onChange={(e) => setSearchText(e.target.value)}
+ placeholder={t("common.filter-by-name")}
+ autoFocus
+ wrapperClassName="max-w-full"
+ />
{hasCreatePermission && (
<Button onClick={navigateToCreate}>
<Plus className="w-4 h-4 mr-1" />
diff --git a/frontend/src/react/pages/settings/ServiceAccountsPage.tsx b/frontend/src/react/pages/settings/ServiceAccountsPage.tsx
index e3985974e8..1fe86685e5 100644
--- a/frontend/src/react/pages/settings/ServiceAccountsPage.tsx
+++ b/frontend/src/react/pages/settings/ServiceAccountsPage.tsx
@@ -31,7 +31,7 @@ import type { Project } from "@/types/proto-es/v1/project_service_pb";
import type { ServiceAccount } from "@/types/proto-es/v1/service_account_service_pb";
import type { User } from "@/types/proto-es/v1/user_service_pb";
import { hasProjectPermissionV2, hasWorkspacePermissionV2 } from "@/utils";
-import { RoleMultiSelect } from "./shared/RoleMultiSelect";
+import { RoleSelect } from "./shared/RoleSelect";
import { UserAvatar } from "./shared/UserAvatar";
import { PagedTableFooter, usePagedData } from "./shared/usePagedData";
@@ -571,7 +571,7 @@ function CreateServiceAccountDrawer({
<label className="block text-sm font-medium text-control">
{t("settings.members.table.roles")}
</label>
- <RoleMultiSelect
+ <RoleSelect
value={roles}
onChange={setRoles}
disabled={false}
@@ -763,7 +763,7 @@ export function ServiceAccountsPage({ projectId }: { projectId?: string }) {
{/* Inactive list */}
{showInactive && (
- <div className="flex flex-col gap-y-3">
+ <div className="flex flex-col gap-y-4">
<h3 className="text-base font-medium">
{t("settings.members.inactive-service-accounts")}
</h3>
diff --git a/frontend/src/react/pages/settings/UsersPage.tsx b/frontend/src/react/pages/settings/UsersPage.tsx
index 2d83ed85c6..964da0ba59 100644
--- a/frontend/src/react/pages/settings/UsersPage.tsx
+++ b/frontend/src/react/pages/settings/UsersPage.tsx
@@ -8,7 +8,6 @@ import {
EyeOff,
Pencil,
Plus,
- Search,
Settings,
Trash2,
Undo2,
@@ -18,14 +17,10 @@ import { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { ComponentPermissionGuard } from "@/react/components/ComponentPermissionGuard";
import { FeatureBadge } from "@/react/components/FeatureBadge";
-import {
- Alert,
- AlertDescription,
- AlertTitle,
-} from "@/react/components/ui/alert";
import { Badge } from "@/react/components/ui/badge";
import { Button } from "@/react/components/ui/button";
import { Input } from "@/react/components/ui/input";
+import { SearchInput } from "@/react/components/ui/search-input";
import { Tooltip } from "@/react/components/ui/tooltip";
import { useEscapeKey } from "@/react/hooks/useEscapeKey";
import { useVueState } from "@/react/hooks/useVueState";
@@ -63,7 +58,7 @@ import {
} from "@/types/proto-es/v1/user_service_pb";
import { hasWorkspacePermissionV2 } from "@/utils";
import { AADSyncDrawer } from "./shared/AADSyncDrawer";
-import { RoleMultiSelect } from "./shared/RoleMultiSelect";
+import { RoleSelect } from "./shared/RoleSelect";
import { UserAvatar } from "./shared/UserAvatar";
import { PagedTableFooter, usePagedData } from "./shared/usePagedData";
@@ -577,12 +572,16 @@ function CreateUserDrawer({
password,
});
if (roles.length > 0) {
- await workspaceStore.patchIamPolicy([
- {
- member: getUserEmailInBinding(createdUser.email),
- roles,
- },
- ]);
+ try {
+ await workspaceStore.patchIamPolicy([
+ {
+ member: getUserEmailInBinding(createdUser.email),
+ roles,
+ },
+ ]);
+ } catch {
+ // do nothing
+ }
}
onCreated(createdUser);
pushNotification({
@@ -696,7 +695,7 @@ function CreateUserDrawer({
<label className="block text-sm font-medium text-control">
{t("settings.members.table.roles")}
</label>
- <RoleMultiSelect
+ <RoleSelect
value={roles}
onChange={setRoles}
disabled={false}
@@ -844,8 +843,6 @@ export function UsersPage() {
const userStore = useUserStore();
const isSaaSMode = useVueState(() => actuatorStore.isSaaSMode);
- const activeUserCount = useVueState(() => actuatorStore.activeUserCount);
- const userCountLimit = useVueState(() => subscriptionStore.userCountLimit);
const hasDirectorySyncFeature = useVueState(() =>
subscriptionStore.hasInstanceFeature(PlanFeature.FEATURE_DIRECTORY_SYNC)
@@ -861,11 +858,6 @@ export function UsersPage() {
const [showAadSyncDrawer, setShowAadSyncDrawer] = useState(false);
const [editingUser, setEditingUser] = useState<User | undefined>(undefined);
- const remainingUserCount = useMemo(
- () => Math.max(0, userCountLimit - activeUserCount),
- [userCountLimit, activeUserCount]
- );
-
// Active users paged data
const fetchActiveUsers = useCallback(
async (params: { pageSize: number; pageToken: string }) => {
@@ -932,34 +924,13 @@ export function UsersPage() {
return (
<div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">
- {!isSaaSMode && remainingUserCount <= 3 && (
- <Alert variant="warning" className="mb-2">
- <AlertTitle>{t("subscription.usage.user-count.title")}</AlertTitle>
- <AlertDescription>
- {remainingUserCount > 0
- ? t("subscription.usage.user-count.remaining", {
- total: userCountLimit,
- count: remainingUserCount,
- })
- : t("subscription.usage.user-count.runoutof", {
- total: userCountLimit,
- })}{" "}
- {t("subscription.usage.user-count.upgrade")}
- </AlertDescription>
- </Alert>
- )}
-
{/* Action bar */}
- <div className="flex items-center justify-between mb-4">
- <div className="relative">
- <Input
- placeholder={t("common.filter-by-name")}
- value={userSearchText}
- onChange={(e) => setUserSearchText(e.target.value)}
- className="h-8 text-sm pr-8"
- />
- <Search className="absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
- </div>
+ <div className="flex items-center justify-between gap-x-2 mb-4">
+ <SearchInput
+ placeholder={t("common.filter-by-name")}
+ value={userSearchText}
+ onChange={(e) => setUserSearchText(e.target.value)}
+ />
<div className="flex items-center gap-x-2">
<Button
variant="outline"
@@ -1028,20 +999,16 @@ export function UsersPage() {
)}
{showInactiveUsers && (
- <div className="flex flex-col gap-y-3">
+ <div className="flex flex-col gap-y-4">
<div className="flex items-center justify-between">
<h3 className="text-base font-medium">
{t("settings.members.inactive-users")}
</h3>
- <div className="relative">
- <Input
- placeholder={t("common.filter-by-name")}
- value={inactiveUserSearchText}
- onChange={(e) => setInactiveUserSearchText(e.target.value)}
- className="h-8 text-sm pr-8"
- />
- <Search className="absolute right-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
- </div>
+ <SearchInput
+ placeholder={t("common.filter-by-name")}
+ value={inactiveUserSearchText}
+ onChange={(e) => setInactiveUserSearchText(e.target.value)}
+ />
</div>
{inactiveUsers.isLoading && inactiveUsers.dataList.length === 0 ? (
diff --git a/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx b/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx
index 95259d8efb..9d29a0124b 100644
--- a/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx
+++ b/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx
@@ -371,7 +371,7 @@ export function WorkloadIdentitiesPage({ projectId }: { projectId?: string }) {
</label>
{showInactive && (
- <div className="flex flex-col gap-y-3">
+ <div className="flex flex-col gap-y-4">
<p className="text-lg font-medium leading-7">
{t("settings.members.inactive-workload-identities")}
</p>
diff --git a/frontend/src/react/pages/settings/profile/ProfilePage.tsx b/frontend/src/react/pages/settings/profile/ProfilePage.tsx
index 21640d3241..b66e692110 100644
--- a/frontend/src/react/pages/settings/profile/ProfilePage.tsx
+++ b/frontend/src/react/pages/settings/profile/ProfilePage.tsx
@@ -612,13 +612,13 @@ export function ProfilePage({ principalEmail }: ProfilePageProps) {
<div className="relative" ref={ellipsisMenuRef}>
<button
type="button"
- className="p-1 rounded hover:bg-control-bg"
+ className="p-1 rounded-xs hover:bg-control-bg"
onClick={() => setShowEllipsisMenu((v) => !v)}
>
<Ellipsis className="w-8" />
</button>
{showEllipsisMenu && (
- <div className="absolute right-0 mt-1 z-10 bg-white border border-control-border rounded shadow-md py-1 min-w-36">
+ <div className="absolute right-0 mt-1 z-10 bg-white border border-control-border rounded-sm shadow-md py-1 min-w-36">
<button
type="button"
className="w-full text-left px-3 py-1.5 text-sm hover:bg-control-bg"
diff --git a/frontend/src/react/pages/settings/shared/AccountMultiSelect.tsx b/frontend/src/react/pages/settings/shared/AccountMultiSelect.tsx
index 1f7e93c7cc..f81e642ddb 100644
--- a/frontend/src/react/pages/settings/shared/AccountMultiSelect.tsx
+++ b/frontend/src/react/pages/settings/shared/AccountMultiSelect.tsx
@@ -134,7 +134,7 @@ function SpecialAccountOption({
<span className="text-sm font-medium truncate">
{match.email.split("@")[0]}
</span>
- <span className="text-xs text-control-light bg-gray-100 rounded px-1">
+ <span className="text-xs text-control-light bg-gray-100 rounded-xs px-1">
{label}
</span>
</div>
@@ -291,7 +291,7 @@ export function AccountMultiSelect({
className={cn(
"flex flex-wrap items-center gap-1 min-h-[2.25rem] w-full rounded-xs border border-control-border bg-transparent px-2 py-1 text-sm cursor-pointer",
disabled && "opacity-50 cursor-not-allowed",
- open && "ring-2 ring-accent border-accent"
+ open && "border-accent"
)}
onClick={() => {
if (!disabled) {
@@ -320,7 +320,7 @@ export function AccountMultiSelect({
)}
</span>
))}
- {!open && value.length === 0 && (
+ {value.length === 0 && (
<span className="text-control-placeholder">
{t("settings.members.select-account", { count: 2 })}
</span>
@@ -405,7 +405,7 @@ export function AccountMultiSelect({
{displayName}
</span>
{isCurrentUser && (
- <span className="text-xs text-control-light bg-gray-100 rounded px-1">
+ <span className="text-xs text-control-light bg-gray-100 rounded-xs px-1">
{t("common.you")}
</span>
)}
diff --git a/frontend/src/react/pages/settings/shared/RoleMultiSelect.tsx b/frontend/src/react/pages/settings/shared/RoleMultiSelect.tsx
deleted file mode 100644
index 241eb4c4cf..0000000000
--- a/frontend/src/react/pages/settings/shared/RoleMultiSelect.tsx
+++ /dev/null
@@ -1,210 +0,0 @@
-import { Check, ChevronDown, X } from "lucide-react";
-import { useCallback, useMemo, useRef, useState } from "react";
-import { useTranslation } from "react-i18next";
-import { FeatureBadge } from "@/react/components/FeatureBadge";
-import { useClickOutside } from "@/react/hooks/useClickOutside";
-import { useVueState } from "@/react/hooks/useVueState";
-import { cn } from "@/react/lib/utils";
-import { useRoleStore, useSubscriptionV1Store } from "@/store";
-import {
- PRESET_PROJECT_ROLES,
- PRESET_ROLES,
- PRESET_WORKSPACE_ROLES,
-} from "@/types/iam";
-import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
-import { displayRoleDescription, displayRoleTitle } from "@/utils";
-
-export function RoleMultiSelect({
- value,
- onChange,
- disabled,
- scope,
-}: {
- value: string[];
- onChange: (roles: string[]) => void;
- disabled?: boolean;
- scope?: "project";
-}) {
- const { t } = useTranslation();
- const roleStore = useRoleStore();
- const subscriptionStore = useSubscriptionV1Store();
- const roleList = useVueState(() => [...roleStore.roleList]);
- const hasCustomRoleFeature = useVueState(() =>
- subscriptionStore.hasInstanceFeature(PlanFeature.FEATURE_CUSTOM_ROLES)
- );
- const [open, setOpen] = useState(false);
- const [search, setSearch] = useState("");
- const containerRef = useRef<HTMLDivElement>(null);
- const inputRef = useRef<HTMLInputElement>(null);
-
- const handleClickOutside = useCallback(() => {
- setOpen(false);
- setSearch("");
- }, []);
- useClickOutside(containerRef, open, handleClickOutside);
-
- const groups = useMemo(() => {
- const kw = search.toLowerCase();
- const matchRole = (name: string) =>
- !kw || displayRoleTitle(name).toLowerCase().includes(kw);
-
- const workspace = PRESET_WORKSPACE_ROLES.filter(matchRole);
- const project = PRESET_PROJECT_ROLES.filter(matchRole);
- const custom = roleList
- .filter((r) => !PRESET_ROLES.includes(r.name))
- .map((r) => r.name)
- .filter(matchRole);
-
- const result: { label: string; roles: string[] }[] = [];
- if (scope !== "project" && workspace.length > 0)
- result.push({
- label: t("role.workspace-roles.self"),
- roles: workspace,
- });
- if (project.length > 0)
- result.push({ label: t("role.project-roles.self"), roles: project });
- if (custom.length > 0)
- result.push({ label: t("role.custom-roles.self"), roles: custom });
- return result;
- }, [roleList, search, scope, t]);
-
- const isCustomRole = (name: string) => !PRESET_ROLES.includes(name);
-
- const toggle = (roleName: string) => {
- if (disabled) return;
- // Block selecting custom roles without the plan feature
- if (isCustomRole(roleName) && !hasCustomRoleFeature) return;
- if (value.includes(roleName)) {
- onChange(value.filter((r) => r !== roleName));
- } else {
- onChange([...value, roleName]);
- }
- };
-
- const remove = (roleName: string) => {
- if (disabled) return;
- onChange(value.filter((r) => r !== roleName));
- };
-
- return (
- <div ref={containerRef} className="relative">
- {/* Trigger */}
- <div
- className={cn(
- "flex flex-wrap items-center gap-1 min-h-[2.25rem] w-full rounded-xs border border-control-border bg-transparent px-2 py-1 text-sm cursor-pointer",
- disabled && "opacity-50 cursor-not-allowed",
- open && "ring-2 ring-accent border-accent"
- )}
- onClick={() => {
- if (!disabled) {
- setOpen(!open);
- requestAnimationFrame(() => inputRef.current?.focus());
- }
- }}
- >
- {value.map((roleName) => (
- <span
- key={roleName}
- className="inline-flex items-center gap-x-1 rounded-xs bg-gray-100 px-1.5 py-0.5 text-xs"
- >
- {displayRoleTitle(roleName)}
- {!disabled && (
- <button
- type="button"
- className="hover:text-error"
- onClick={(e) => {
- e.stopPropagation();
- remove(roleName);
- }}
- >
- <X className="h-3 w-3" />
- </button>
- )}
- </span>
- ))}
- {open && (
- <input
- ref={inputRef}
- className="flex-1 min-w-[4rem] outline-hidden text-sm bg-transparent"
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- placeholder={
- value.length === 0
- ? t("settings.members.select-role", { count: 2 })
- : ""
- }
- />
- )}
- {!open && value.length === 0 && (
- <span className="text-control-placeholder">
- {t("settings.members.select-role", { count: 2 })}
- </span>
- )}
- <ChevronDown className="ml-auto h-4 w-4 shrink-0 text-control-light" />
- </div>
-
- {/* Dropdown */}
- {open && (
- <div className="absolute z-50 mt-1 w-full bg-white border border-control-border rounded-sm shadow-lg max-h-60 overflow-auto">
- {groups.length === 0 && (
- <div className="px-3 py-2 text-sm text-control-light">
- {t("common.no-data")}
- </div>
- )}
- {groups.map((group) => (
- <div key={group.label}>
- <div className="px-3 py-1.5 text-xs font-medium text-control-light uppercase tracking-wide bg-gray-50">
- {group.label}
- </div>
- {group.roles.map((roleName) => {
- const selected = value.includes(roleName);
- const isCustom = isCustomRole(roleName);
- const blocked = isCustom && !hasCustomRoleFeature;
- return (
- <div
- key={roleName}
- className={cn(
- "flex items-center gap-x-2 px-3 py-1.5 text-sm hover:bg-gray-50",
- selected && "bg-accent/5",
- blocked
- ? "opacity-50 cursor-not-allowed"
- : "cursor-pointer"
- )}
- onClick={() => toggle(roleName)}
- >
- <div
- className={cn(
- "h-4 w-4 rounded-xs border flex items-center justify-center shrink-0",
- selected
- ? "bg-accent border-accent text-white"
- : "border-control-border"
- )}
- >
- {selected && <Check className="h-3 w-3" />}
- </div>
- <div className="flex flex-col">
- <div className="flex items-center gap-x-1">
- <span>{displayRoleTitle(roleName)}</span>
- {blocked && (
- <FeatureBadge
- feature={PlanFeature.FEATURE_CUSTOM_ROLES}
- clickable={false}
- />
- )}
- </div>
- {displayRoleDescription(roleName) && (
- <span className="text-xs text-control-light">
- {displayRoleDescription(roleName)}
- </span>
- )}
- </div>
- </div>
- );
- })}
- </div>
- ))}
- </div>
- )}
- </div>
- );
-}
diff --git a/frontend/src/react/pages/settings/shared/RoleSelect.tsx b/frontend/src/react/pages/settings/shared/RoleSelect.tsx
new file mode 100644
index 0000000000..069fdfaee1
--- /dev/null
+++ b/frontend/src/react/pages/settings/shared/RoleSelect.tsx
@@ -0,0 +1,279 @@
+import { Check, ChevronDown, Search, X } from "lucide-react";
+import { useEffect, useMemo, useRef, useState } from "react";
+import { createPortal } from "react-dom";
+import { useTranslation } from "react-i18next";
+import { FeatureBadge } from "@/react/components/FeatureBadge";
+import { useVueState } from "@/react/hooks/useVueState";
+import { cn } from "@/react/lib/utils";
+import { useRoleStore, useSubscriptionV1Store } from "@/store";
+import {
+ PRESET_PROJECT_ROLES,
+ PRESET_ROLES,
+ PRESET_WORKSPACE_ROLES,
+} from "@/types/iam";
+import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
+import { displayRoleDescription, displayRoleTitle } from "@/utils";
+
+interface RoleSelectProps {
+ /** Selected role(s). For single mode pass a single-element array. */
+ value: string[];
+ onChange: (roles: string[]) => void;
+ disabled?: boolean;
+ /** Restrict to project roles only. */
+ scope?: "project";
+ /** Single-select mode: selecting a role replaces the previous selection and closes the dropdown. */
+ multiple?: boolean;
+ placeholder?: string;
+}
+
+export function RoleSelect({
+ value,
+ onChange,
+ disabled,
+ scope,
+ multiple = true,
+ placeholder,
+}: RoleSelectProps) {
+ const { t } = useTranslation();
+ const roleStore = useRoleStore();
+ const subscriptionStore = useSubscriptionV1Store();
+ const roleList = useVueState(() => [...roleStore.roleList]);
+ const hasCustomRoleFeature = useVueState(() =>
+ subscriptionStore.hasInstanceFeature(PlanFeature.FEATURE_CUSTOM_ROLES)
+ );
+ const [open, setOpen] = useState(false);
+ const [search, setSearch] = useState("");
+ const containerRef = useRef<HTMLDivElement>(null);
+ const dropdownRef = useRef<HTMLDivElement>(null);
+ const inputRef = useRef<HTMLInputElement>(null);
+ const [dropdownStyle, setDropdownStyle] = useState<React.CSSProperties>({});
+
+ const defaultPlaceholder = multiple
+ ? t("settings.members.select-role", { count: 2 })
+ : t("settings.members.assign-role");
+
+ // Calculate dropdown position relative to viewport (for portal rendering)
+ useEffect(() => {
+ if (!open || !containerRef.current) return;
+ const rect = containerRef.current.getBoundingClientRect();
+ setDropdownStyle({
+ position: "fixed",
+ top: rect.bottom + 4,
+ left: rect.left,
+ width: rect.width,
+ });
+ }, [open]);
+
+ // Click outside: close if click is outside both trigger and portal dropdown
+ useEffect(() => {
+ if (!open) return;
+ const handler = (e: MouseEvent) => {
+ const target = e.target as Node;
+ if (containerRef.current?.contains(target)) return;
+ if (dropdownRef.current?.contains(target)) return;
+ setOpen(false);
+ setSearch("");
+ };
+ document.addEventListener("mousedown", handler);
+ return () => document.removeEventListener("mousedown", handler);
+ }, [open]);
+
+ const groups = useMemo(() => {
+ const kw = search.toLowerCase();
+ const matchRole = (name: string) =>
+ !kw || displayRoleTitle(name).toLowerCase().includes(kw);
+
+ const workspace = PRESET_WORKSPACE_ROLES.filter(matchRole);
+ const project = PRESET_PROJECT_ROLES.filter(matchRole);
+ const custom = roleList
+ .filter((r) => !PRESET_ROLES.includes(r.name))
+ .map((r) => r.name)
+ .filter(matchRole);
+
+ const result: { label: string; roles: string[] }[] = [];
+ if (scope !== "project" && workspace.length > 0)
+ result.push({
+ label: t("role.workspace-roles.self"),
+ roles: workspace,
+ });
+ if (project.length > 0)
+ result.push({ label: t("role.project-roles.self"), roles: project });
+ if (custom.length > 0)
+ result.push({ label: t("role.custom-roles.self"), roles: custom });
+ return result;
+ }, [roleList, search, scope, t]);
+
+ const isCustomRole = (name: string) => !PRESET_ROLES.includes(name);
+
+ const selectRole = (roleName: string) => {
+ if (disabled) return;
+ if (isCustomRole(roleName) && !hasCustomRoleFeature) return;
+
+ if (multiple) {
+ if (value.includes(roleName)) {
+ onChange(value.filter((r) => r !== roleName));
+ } else {
+ onChange([...value, roleName]);
+ }
+ } else {
+ onChange([roleName]);
+ setOpen(false);
+ setSearch("");
+ }
+ };
+
+ const remove = (roleName: string) => {
+ if (disabled) return;
+ onChange(value.filter((r) => r !== roleName));
+ };
+
+ const displayValue = multiple
+ ? null
+ : value.length > 0
+ ? displayRoleTitle(value[0])
+ : null;
+
+ return (
+ <div ref={containerRef} className="relative">
+ {/* Trigger */}
+ <div
+ className={cn(
+ "flex flex-wrap items-center gap-1 min-h-[2.25rem] w-full rounded-xs border border-control-border bg-transparent px-2 py-1 text-sm cursor-pointer",
+ disabled && "opacity-50 cursor-not-allowed",
+ open && "border-accent"
+ )}
+ onClick={() => {
+ if (!disabled) {
+ setOpen(!open);
+ requestAnimationFrame(() => inputRef.current?.focus());
+ }
+ }}
+ >
+ {/* Multi: show chips */}
+ {multiple &&
+ value.map((roleName) => (
+ <span
+ key={roleName}
+ className="inline-flex items-center gap-x-1 rounded-xs bg-gray-100 px-1.5 py-0.5 text-xs"
+ >
+ {displayRoleTitle(roleName)}
+ {!disabled && (
+ <button
+ type="button"
+ className="hover:text-error"
+ onClick={(e) => {
+ e.stopPropagation();
+ remove(roleName);
+ }}
+ >
+ <X className="h-3 w-3" />
+ </button>
+ )}
+ </span>
+ ))}
+ {/* Single: show selected label */}
+ {!multiple && (
+ <span
+ className={cn(
+ "flex-1",
+ !displayValue && "text-control-placeholder"
+ )}
+ >
+ {displayValue || placeholder || defaultPlaceholder}
+ </span>
+ )}
+ {/* Multi placeholder */}
+ {multiple && value.length === 0 && (
+ <span className="text-control-placeholder">
+ {placeholder || defaultPlaceholder}
+ </span>
+ )}
+ <ChevronDown className="ml-auto h-4 w-4 shrink-0 text-control-light" />
+ </div>
+
+ {/* Dropdown (portal to escape overflow containers) */}
+ {open &&
+ createPortal(
+ <div
+ ref={dropdownRef}
+ style={dropdownStyle}
+ className="z-[999] bg-white border border-control-border rounded-sm shadow-lg max-h-72 flex flex-col"
+ >
+ {/* Search input inside dropdown */}
+ <div className="flex items-center gap-x-2 px-3 py-2 border-b sticky top-0 bg-white shrink-0">
+ <Search className="h-4 w-4 text-control-light shrink-0" />
+ <input
+ ref={inputRef}
+ className="flex-1 outline-hidden border-none shadow-none text-sm bg-transparent"
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ placeholder={t("common.filter")}
+ />
+ </div>
+
+ <div className="overflow-auto">
+ {groups.length === 0 && (
+ <div className="px-3 py-2 text-sm text-control-light">
+ {t("common.no-data")}
+ </div>
+ )}
+ {groups.map((group) => (
+ <div key={group.label}>
+ <div className="px-3 py-1.5 text-xs font-medium text-control-light uppercase tracking-wide bg-gray-50">
+ {group.label}
+ </div>
+ {group.roles.map((roleName) => {
+ const selected = value.includes(roleName);
+ const isCustom = isCustomRole(roleName);
+ const blocked = isCustom && !hasCustomRoleFeature;
+ return (
+ <div
+ key={roleName}
+ className={cn(
+ "flex items-center gap-x-2 px-3 py-1.5 text-sm hover:bg-gray-50",
+ selected && "bg-accent/5",
+ blocked
+ ? "opacity-50 cursor-not-allowed"
+ : "cursor-pointer"
+ )}
+ onClick={() => selectRole(roleName)}
+ >
+ <div
+ className={cn(
+ "h-4 w-4 border flex items-center justify-center shrink-0",
+ multiple ? "rounded-xs" : "rounded-full",
+ selected
+ ? "bg-accent border-accent text-white"
+ : "border-control-border"
+ )}
+ >
+ {selected && <Check className="h-3 w-3" />}
+ </div>
+ <div className="flex flex-col">
+ <div className="flex items-center gap-x-1">
+ <span>{displayRoleTitle(roleName)}</span>
+ {blocked && (
+ <FeatureBadge
+ feature={PlanFeature.FEATURE_CUSTOM_ROLES}
+ clickable={false}
+ />
+ )}
+ </div>
+ {displayRoleDescription(roleName) && (
+ <span className="text-xs text-control-light">
+ {displayRoleDescription(roleName)}
+ </span>
+ )}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ ))}
+ </div>
+ </div>,
+ document.body
+ )}
+ </div>
+ );
+}
diff --git a/frontend/src/react/pages/settings/two-factor/RecoveryCodesView.tsx b/frontend/src/react/pages/settings/two-factor/RecoveryCodesView.tsx
index a94f3e4218..1821e395ba 100644
--- a/frontend/src/react/pages/settings/two-factor/RecoveryCodesView.tsx
+++ b/frontend/src/react/pages/settings/two-factor/RecoveryCodesView.tsx
@@ -29,7 +29,7 @@ export function RecoveryCodesView({
return (
<div className="w-full flex flex-col gap-y-4 my-8">
- <div className="flex gap-3 rounded-md border border-blue-200 bg-blue-50 p-4">
+ <div className="flex gap-3 rounded-sm border border-blue-200 bg-blue-50 p-4">
<Info className="w-5 h-5 text-blue-600 shrink-0 mt-0.5" />
<div>
<p className="text-sm font-medium text-blue-800">
@@ -46,7 +46,7 @@ export function RecoveryCodesView({
</div>
</div>
<div className="w-full mx-auto flex flex-col justify-start items-start">
- <ul className="w-full grid grid-cols-2 list-disc list-inside mx-auto gap-4 gap-x-24 p-8 px-12 border rounded-md bg-gray-50">
+ <ul className="w-full grid grid-cols-2 list-disc list-inside mx-auto gap-4 gap-x-24 p-8 px-12 border rounded-xs bg-gray-50">
{recoveryCodes.map((code) => (
<li key={code}>
<code className="ml-2">{code}</code>
diff --git a/frontend/src/react/pages/settings/two-factor/TwoFactorSetupPage.tsx b/frontend/src/react/pages/settings/two-factor/TwoFactorSetupPage.tsx
index 82a6c6292c..ee285086cb 100644
--- a/frontend/src/react/pages/settings/two-factor/TwoFactorSetupPage.tsx
+++ b/frontend/src/react/pages/settings/two-factor/TwoFactorSetupPage.tsx
@@ -258,7 +258,7 @@ export function TwoFactorSetupPage({ cancelAction }: TwoFactorSetupPageProps) {
<div className="w-full max-w-2xl mx-auto flex flex-col justify-start items-start gap-y-4 my-8">
<p>{t("two-factor.setup-steps.setup-auth-app.description")}</p>
<div
- className={`w-full border rounded-md p-3 ${
+ className={`w-full border rounded-sm p-3 ${
isExpired || isExpiringSoon
? "bg-red-50 border-red-200"
: "bg-yellow-50 border-yellow-200"