fix(pages): add dedicated features route#496
Conversation
|
|
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| <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); |
There was a problem hiding this comment.
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);|
Hi @oozan, Thanks for working on this — the dedicated /features route is exactly what issue #495 needs. While reviewing your changes, I noticed a small regression: when visiting the home page ( I've tested a fix locally that preserves your approach while addressing the regression. Changes1. <Route path="/" element={} /> 2. { path: '/features', labelKey: 'navbar.features' }, 3. const isActive = tab.path === '/features' This way the Features tab highlights on both Would you like me to push these changes to your branch, or would you prefer to apply them yourself? If you're busy, I can open a separate PR building on yours. Thanks again for the contribution! |
Summary
/featuresrouteTesting
npm run typechecknpm run buildCloses #495
AI assistance was used to prepare the initial patch and automation. I reviewed the change and validated it with the repository frontend checks.