fix(#112): remove dead admin breadcrumb code, add logout aria-label
Review feedback: breadcrumb memo had an unused isAdminPage branch (TopBar no longer renders on admin pages). Added aria-label to icon-only logout button for screen readers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -203,23 +203,6 @@ function LayoutContent() {
|
||||
|
||||
const isAdminPage = location.pathname.startsWith('/admin');
|
||||
const breadcrumb = useMemo(() => {
|
||||
if (isAdminPage) {
|
||||
const LABELS: Record<string, string> = {
|
||||
admin: 'Admin',
|
||||
rbac: 'Users & Roles',
|
||||
audit: 'Audit Log',
|
||||
oidc: 'OIDC',
|
||||
database: 'Database',
|
||||
clickhouse: 'ClickHouse',
|
||||
appconfig: 'App Config',
|
||||
};
|
||||
const parts = location.pathname.split('/').filter(Boolean);
|
||||
return parts.map((part, i) => ({
|
||||
label: LABELS[part] ?? part,
|
||||
...(i < parts.length - 1 ? { href: '/' + parts.slice(0, i + 1).join('/') } : {}),
|
||||
}));
|
||||
}
|
||||
// Scope trail as breadcrumb items
|
||||
const items: { label: string; href?: string }[] = [
|
||||
{ label: 'All Applications', href: `/${scope.tab}` },
|
||||
];
|
||||
@@ -234,7 +217,7 @@ function LayoutContent() {
|
||||
delete items[items.length - 1].href;
|
||||
}
|
||||
return items;
|
||||
}, [location.pathname, isAdminPage, scope.tab, scope.appId, scope.routeId]);
|
||||
}, [scope.tab, scope.appId, scope.routeId]);
|
||||
|
||||
const handleLogout = useCallback(() => {
|
||||
logout();
|
||||
|
||||
Reference in New Issue
Block a user