Repository navigation
🌱 [scanner] refactor: split Navbar.tsx - #6971
Conversation
Extract ContributeDropdown, CommunityDropdown, GithubDropdown, NavbarLogo, and MobileMenu into src/components/navbar/, following the pattern already established by useGithubStats.ts and useNavDropdowns.ts. Navbar.tsx is now a slim ~116-line composition shell wiring the existing hooks into the extracted subcomponents. No visual or behavioral changes: same JSX structure, classNames, data-dropdown/data-dropdown-menu/data-dropdown-button attributes (relied on by useNavDropdowns.ts), and translation keys. Co-authored-by: Copilot <[email protected]> Signed-off-by: kubestellar-hive[bot] <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellar-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @kubestellar-hive[bot]. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
…, #6813) (#6990) - scripts/netlify-ignore.test.ts: add NODE_ENV to the literal spawnEnv object so it satisfies NodeJS.ProcessEnv (TS2741), fixing the TypeScript type-check regression from #6972. - Add src/__tests__/NavbarSubcomponents.render.test.tsx covering the six sub-components extracted from Navbar.tsx in #6971 (NavbarLogo, ContributeDropdown, CommunityDropdown, GithubDropdown, MobileMenu, and the navbar/index.ts export surface), restoring src/components/navbar/** above its 95/95/90/80 coverage thresholds. - #6813 (missing vite devDependency) was already fixed on main by PR #6834; verified vite is present in package.json and no longer reproduces, so it is not addressed here. Signed-off-by: kubestellar-hive[bot] <[email protected]> Co-authored-by: kubestellar-hive[bot] <[email protected]>
Refs #6697
Summary
Splits
src/components/Navbar.tsx(1148 lines) into focused sub-components undersrc/components/navbar/, following the pattern already established byuseGithubStats.tsanduseNavDropdowns.tsin that directory.Changes
src/components/navbar/NavbarLogo.tsx— logo + primary center links (Docs, Live Demo, Marketplace); renders dropdown children in the same DOM position as beforesrc/components/navbar/ContributeDropdown.tsx— desktop "Contribute" dropdownsrc/components/navbar/CommunityDropdown.tsx— desktop "Community" dropdownsrc/components/navbar/GithubDropdown.tsx— GitHub stats dropdown, takesgithubStatsas a propsrc/components/navbar/MobileMenu.tsx— collapsible mobile panel, takesisMenuOpen/githubStats/tas props (mobile menu button stays inline inNavbar.tsxsince it lives in a different part of the DOM tree than the panel)src/components/navbar/index.ts— barrel updated to re-export the new components and theGithubStatstypesrc/components/Navbar.tsx— now a ~116-line composition shell wiringuseGithubStats/useNavDropdownsinto the subcomponentsBehavior preserved
data-dropdown/data-dropdown-menu/data-dropdown-buttonattributes relied on byuseNavDropdowns.ts's DOM queriesnext-intltranslation keys (`useTranslations("navigation")")any; all new props are explicitly typedValidation
npx tsc --noEmit -p .— passesnpx eslint src/components/Navbar.tsx src/components/navbar/— 0 errors (1 pre-existing warning in unrelated/untoucheduseNavDropdowns.ts)npm run build— succeedsNote
MobileMenu.tsxis ~500 lines because it mirrors the desktop dropdown links for small screens (the ~470-line duplication called out in the issue). Extracting a sharednavbar/links.tsdata module to de-duplicate was considered but deferred to keep this change a pure, zero-risk refactor; happy to follow up if desired.— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.78