From 63bf5bdc87c9aecf17c27d99a1298d7331f3423a Mon Sep 17 00:00:00 2001 From: Shaheer Sarfaraz <53654735+DaKheera47@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:36:16 +0000 Subject: [PATCH] fix: move docs button to sidebar footer and open in new tab (#184) * fix(ui): move docs to sidebar footer button with new-tab icon * sidebar documentation --- docs-site/docs/features/orchestrator.md | 5 + orchestrator/src/client/components/layout.tsx | 99 ++++++++++--------- .../src/client/components/navigation.ts | 15 --- 3 files changed, 56 insertions(+), 63 deletions(-) diff --git a/docs-site/docs/features/orchestrator.md b/docs-site/docs/features/orchestrator.md index 0126206..34d62f6 100644 --- a/docs-site/docs/features/orchestrator.md +++ b/docs-site/docs/features/orchestrator.md @@ -57,6 +57,11 @@ Ghostwriter is available in `discovered` and `ready` job views. For details, see [Ghostwriter](/docs/next/features/ghostwriter). +### Opening documentation from the sidebar + +1. Open the sidebar menu. +2. In the footer section under `Version `, click **Documentation**, which opens the locally hosted docs in a new tab. + ### Generating PDFs PDF generation uses: diff --git a/orchestrator/src/client/components/layout.tsx b/orchestrator/src/client/components/layout.tsx index 3b86cb5..d95c572 100644 --- a/orchestrator/src/client/components/layout.tsx +++ b/orchestrator/src/client/components/layout.tsx @@ -2,7 +2,7 @@ * Shared layout components for consistent page structure. */ -import { type LucideIcon, Menu } from "lucide-react"; +import { ExternalLink, type LucideIcon, Menu } from "lucide-react"; import type React from "react"; import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; @@ -60,22 +60,12 @@ export const PageHeader: React.FC = ({ const setNavOpen = onNavOpenChange ?? setInternalNavOpen; const { version, updateAvailable } = useVersionCheck(); - const handleNavClick = ( - to: string, - activePaths?: string[], - external?: boolean, - ) => { + const handleNavClick = (to: string, activePaths?: string[]) => { if (isNavActive(location.pathname, to, activePaths)) { setNavOpen(false); return; } setNavOpen(false); - if (external) { - setTimeout(() => { - window.location.href = to; - }, 150); - return; - } setTimeout(() => navigate(to), 150); }; @@ -95,46 +85,59 @@ export const PageHeader: React.FC = ({ JobOps {showVersionFooter && (
- - Version {version} - {updateAvailable && ( - - - - - -

Update available

-
-
- )} -
+
+ + Version {version} + {updateAvailable && ( + + + + + +

Update available

+
+
+ )} +
+ +
)} diff --git a/orchestrator/src/client/components/navigation.ts b/orchestrator/src/client/components/navigation.ts index 5e4f840..ad6ea30 100644 --- a/orchestrator/src/client/components/navigation.ts +++ b/orchestrator/src/client/components/navigation.ts @@ -1,5 +1,4 @@ import { - BookOpen, Columns3, Home, Inbox, @@ -8,26 +7,13 @@ import { Shield, } from "lucide-react"; -declare const __APP_VERSION__: string; - export type NavLink = { to: string; label: string; icon: typeof Home; activePaths?: string[]; - external?: boolean; }; -const releaseVersion = (() => { - if (typeof __APP_VERSION__ !== "string") return null; - const match = __APP_VERSION__.match(/^v\d+\.\d+\.\d+/); - return match ? match[0] : null; -})(); - -const docsLabel = releaseVersion - ? `Documentation (${releaseVersion})` - : "Documentation"; - export const NAV_LINKS: NavLink[] = [ { to: "/overview", label: "Overview", icon: Home }, { @@ -48,7 +34,6 @@ export const NAV_LINKS: NavLink[] = [ activePaths: ["/applications/in-progress"], }, { to: "/tracking-inbox", label: "Tracking Inbox", icon: Inbox }, - { to: "/docs", label: docsLabel, icon: BookOpen, external: true }, { to: "/visa-sponsors", label: "Visa Sponsors", icon: Shield }, { to: "/settings", label: "Settings", icon: Settings }, ];