Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

fix(ui): give the detail pager a fixed slot so header actions can't shift it

Sergey Kozyrenko648bd1a0184e
diff --git a/frontend/src/components/layouts/app/app-header.tsx b/frontend/src/components/layouts/app/app-header.tsx
index 73de02bf..3a4c896a 100644
--- a/frontend/src/components/layouts/app/app-header.tsx
+++ b/frontend/src/components/layouts/app/app-header.tsx
@@ -55,8 +55,23 @@ export function AppHeaderAction({
);
}
-export function AppHeaderActions({ children, className }: { children: ReactNode; className?: string }) {
- return <div className={cn('flex shrink-0 items-center gap-2 px-4', className)}>{children}</div>;
+export function AppHeaderActions({
+ children,
+ className,
+ pager,
+}: {
+ children?: ReactNode;
+ className?: string;
+ pager?: ReactNode;
+}) {
+ // Pass a detail prev/next control as `pager`, not as a child: as the trailing child it stays edge-pinned,
+ // so a conditional neighbour (e.g. a Report button that loads late) can't shift it under the cursor mid-click.
+ return (
+ <div className={cn('flex shrink-0 items-center gap-2 px-4', className)}>
+ {children}
+ {pager}
+ </div>
+ );
}
export function AppHeaderContent({ children, className }: { children: ReactNode; className?: string }) {
diff --git a/frontend/src/features/knowledges/knowledge-header.tsx b/frontend/src/features/knowledges/knowledge-header.tsx
index 07bb52e9..da4e5ab0 100644
--- a/frontend/src/features/knowledges/knowledge-header.tsx
+++ b/frontend/src/features/knowledges/knowledge-header.tsx
@@ -192,15 +192,19 @@ export function KnowledgeHeader({
</BreadcrumbList>
</Breadcrumb>
</AppHeaderContent>
- <AppHeaderActions>
- {canShowActions && !isMobile && (
- <DetailNavigationToolbar<Knowledge>
- controller={knowledgeNav}
- renderItem={renderKnowledgeItem}
- sheetIcon={<LibraryBig className="size-4" />}
- sheetTitle="Knowledges"
- />
- )}
+ <AppHeaderActions
+ pager={
+ canShowActions &&
+ !isMobile && (
+ <DetailNavigationToolbar<Knowledge>
+ controller={knowledgeNav}
+ renderItem={renderKnowledgeItem}
+ sheetIcon={<LibraryBig className="size-4" />}
+ sheetTitle="Knowledges"
+ />
+ )
+ }
+ >
{canAnonymize && !isMobile && (
<AppHeaderAction
disabled={isAnonymizeDisabled}
diff --git a/frontend/src/pages/flows/flow.tsx b/frontend/src/pages/flows/flow.tsx
index b16a0ae9..36eba66c 100644
--- a/frontend/src/pages/flows/flow.tsx
+++ b/frontend/src/pages/flows/flow.tsx
@@ -278,15 +278,19 @@ function Flow() {
</BreadcrumbList>
</Breadcrumb>
</AppHeaderContent>
- <AppHeaderActions>
- {flow && !isMobile && (
- <DetailNavigationToolbar<FlowItem>
- controller={flowNav}
- renderItem={renderFlowItem}
- sheetIcon={<GitFork className="size-4" />}
- sheetTitle="Flows"
- />
- )}
+ <AppHeaderActions
+ pager={
+ flow &&
+ !isMobile && (
+ <DetailNavigationToolbar<FlowItem>
+ controller={flowNav}
+ renderItem={renderFlowItem}
+ sheetIcon={<GitFork className="size-4" />}
+ sheetTitle="Flows"
+ />
+ )
+ }
+ >
{flowId && !isMobile && (
<Button
aria-label="Toggle favorite"
diff --git a/frontend/src/pages/templates/template.tsx b/frontend/src/pages/templates/template.tsx
index 38fe67ac..a2ed3f66 100644
--- a/frontend/src/pages/templates/template.tsx
+++ b/frontend/src/pages/templates/template.tsx
@@ -455,15 +455,19 @@ function Template() {
</BreadcrumbList>
</Breadcrumb>
</AppHeaderContent>
- <AppHeaderActions>
- {canShowActions && !isMobile && (
- <DetailNavigationToolbar<Template>
- controller={templateNav}
- renderItem={renderTemplateItem}
- sheetIcon={<FileText className="size-4" />}
- sheetTitle="Templates"
- />
- )}
+ <AppHeaderActions
+ pager={
+ canShowActions &&
+ !isMobile && (
+ <DetailNavigationToolbar<Template>
+ controller={templateNav}
+ renderItem={renderTemplateItem}
+ sheetIcon={<FileText className="size-4" />}
+ sheetTitle="Templates"
+ />
+ )
+ }
+ >
{(isNew || !!templateData?.flowTemplate) && (
<AppHeaderAction
disabled={!isNew && !hasUnsavedChanges}