diff --git a/src/components/layout/MainContent.tsx b/src/components/layout/MainContent.tsx
index 0315a63..62892a3 100644
--- a/src/components/layout/MainContent.tsx
+++ b/src/components/layout/MainContent.tsx
@@ -59,9 +59,7 @@ export function MainContent({ viewName, id, section }: MainContentProps) {
function renderView(schema: Schema | null, viewName?: string, id?: string, section?: string): ReactNode {
if (!viewName) {
- return (
-
Select a view from the sidebar.
- );
+ return
;
}
if (viewName.startsWith('Dashboard/')) {
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index 95cdf14..300df08 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -16,13 +16,8 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/comp
import { useUIStore } from '@/stores/uiStore';
import { useAccountStore } from '@/stores/accountStore';
import { useSchemaStore } from '@/stores/schemaStore';
-import {
- visibleLayouts,
- findFirstVisibleLinkInLayout,
- findFirstAccessibleLinkInLayout,
- isLinkEnterprise,
- isLinkVisible,
-} from '@/lib/layout';
+import { visibleLayouts, isLinkEnterprise, isLinkVisible } from '@/lib/layout';
+import { sectionLandingLink } from '@/lib/lastVisited';
import type { Layout, LayoutItem, LayoutSubItem } from '@/types/schema';
function LucideIcon({ name, className }: { name: string; className?: string }) {
@@ -341,9 +336,7 @@ export function Sidebar() {
const handleSectionClick = (target: Layout) => {
setActiveSection(target.name);
const canGet = (prefix: string) => permissions.includes(`${prefix}Get`);
- const first =
- findFirstAccessibleLinkInLayout(schema, target, edition, canGet, hasPermission) ??
- findFirstVisibleLinkInLayout(schema, target, edition, canGet, hasPermission);
+ const first = sectionLandingLink(schema, target, edition, canGet, hasPermission);
if (first) navigate(`/${target.name}/${first}`);
};
diff --git a/src/components/layout/TopBar.tsx b/src/components/layout/TopBar.tsx
index f58017a..573b934 100644
--- a/src/components/layout/TopBar.tsx
+++ b/src/components/layout/TopBar.tsx
@@ -22,7 +22,8 @@ import {
import Logo from '@/components/common/Logo';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import { EnterpriseUpsell } from '@/components/common/EnterpriseUpsell';
-import { findFirstAccessibleLinkInLayout, findFirstVisibleLinkInLayout, visibleLayouts } from '@/lib/layout';
+import { visibleLayouts } from '@/lib/layout';
+import { sectionLandingLink } from '@/lib/lastVisited';
import { useUIStore } from '@/stores/uiStore';
import { useAuthStore } from '@/stores/authStore';
import { buildEndSessionUrl, getPostLogoutRedirectUri } from '@/services/auth/oauth';
@@ -144,9 +145,7 @@ export function TopBar() {
onClick={() => {
setActiveSection(layout.name);
const canGet = (prefix: string) => hasObjectPermission(prefix, 'Get');
- const firstLink =
- findFirstAccessibleLinkInLayout(schema, layout, edition, canGet, hasPermission) ??
- findFirstVisibleLinkInLayout(schema, layout, edition, canGet, hasPermission);
+ const firstLink = sectionLandingLink(schema, layout, edition, canGet, hasPermission);
if (firstLink) {
navigate(`/${layout.name}/${firstLink}`);
}
diff --git a/src/components/lists/DynamicList.tsx b/src/components/lists/DynamicList.tsx
index 456bbb6..e048048 100644
--- a/src/components/lists/DynamicList.tsx
+++ b/src/components/lists/DynamicList.tsx
@@ -25,6 +25,7 @@ import {
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { Combobox } from '@/components/ui/combobox';
import { Badge } from '@/components/ui/badge';
import { Checkbox } from '@/components/ui/checkbox';
import { formatSize as fmtSize, formatDuration as fmtDuration } from '@/lib/durationFormat';
@@ -65,6 +66,8 @@ import type { Schema, Field, MassAction, ItemAction, Filter as FilterDef } from
import type { JmapSetResponse, JmapSetError } from '@/types/jmap';
import type { ResolvedSchema } from '@/lib/schemaResolver';
+const ENUM_FILTER_COMBOBOX_THRESHOLD = 15;
+
const PAGE_SIZE = 25;
const MAX_REPORTED_ERRORS = 3;
@@ -285,9 +288,11 @@ function renderCellValue(
case 'object': {
if (value && typeof value === 'object' && !Array.isArray(value)) {
- const obj = value as Record
;
- if ('@type' in obj && typeof obj['@type'] === 'string') {
- return obj['@type'];
+ const typeName = (value as Record)['@type'];
+ if (typeof typeName === 'string') {
+ const objSchema = schema.schemas[ft.objectName];
+ const variant = objSchema?.type === 'multiple' ? objSchema.variants.find((v) => v.name === typeName) : null;
+ return {variant?.label ?? typeName};
}
}
return -;
@@ -869,6 +874,20 @@ export function DynamicList({ viewName }: DynamicListProps) {
case 'enum': {
const enumVariants = schema!.enums[filterDef.enumName] ?? [];
+ if (enumVariants.length > ENUM_FILTER_COMBOBOX_THRESHOLD) {
+ return wrapper(
+ ({ value: v.name, label: v.label })),
+ ]}
+ value={value || '__all__'}
+ onValueChange={(v) => handleFilterSelectChange(filterDef.field, v)}
+ searchPlaceholder={t('common.searchPlaceholder', 'Search...')}
+ emptyText={t('field.noMatches', 'No matches')}
+ />,
+ );
+ }
return wrapper(