Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pages/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const App: React.FC = () => {
<ScrollToTop />
<Routes>
<Route path="/" element={<LandingPage><FeaturesPage /></LandingPage>} />
<Route path="/features" element={<LandingPage><FeaturesPage /></LandingPage>} />
<Route path="/benchmark" element={<LandingPage><BenchmarkPage /></LandingPage>} />
<Route path="/quickstart" element={<LandingPage><QuickStartPage /></LandingPage>} />
<Route path="/docs" element={<DocsPage />} />
Expand Down
4 changes: 2 additions & 2 deletions pages/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const LANG_OPTIONS: { value: Language; label: string }[] = [
];

const navTabs = [
{ path: '/', labelKey: 'navbar.features' },
{ path: '/features', labelKey: 'navbar.features' },
{ path: '/benchmark', labelKey: 'navbar.benchmark' },
{ path: '/quickstart', labelKey: 'navbar.quickstart' },
{ path: '/docs', labelKey: 'navbar.docs' },
Expand Down Expand Up @@ -80,7 +80,7 @@ const Navbar: React.FC = () => {
{!isMobile && (
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
{navTabs.map((tab) => {
const isActive = tab.path === '/' ? currentPath === '/' : currentPath.startsWith(tab.path);
const isActive = currentPath.startsWith(tab.path);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential regression: When the user visits the root path /, no nav tab will be highlighted as active. Previously, the special-case logic (tab.path === '/' ? currentPath === '/' : ...) ensured the features tab was active on /. Since App.tsx still serves FeaturesPage at both / and /features, users landing on / will see no active tab indicator.

Consider adding back a check for the root path, e.g.:

const isActive = tab.path === '/features' ? (currentPath === '/' || currentPath.startsWith('/features')) : currentPath.startsWith(tab.path);

return (
<button
key={tab.path}
Expand Down
Loading