Skip to content

🌱 [scanner] refactor: split Navbar.tsx - #6971

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-6697
Sep 16, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-6697

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refs #6697

Summary

Splits src/components/Navbar.tsx (1148 lines) into focused sub-components under src/components/navbar/, following the pattern already established by useGithubStats.ts and useNavDropdowns.ts in 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 before
  • src/components/navbar/ContributeDropdown.tsx — desktop "Contribute" dropdown
  • src/components/navbar/CommunityDropdown.tsx — desktop "Community" dropdown
  • src/components/navbar/GithubDropdown.tsx — GitHub stats dropdown, takes githubStats as a prop
  • src/components/navbar/MobileMenu.tsx — collapsible mobile panel, takes isMenuOpen/githubStats/t as props (mobile menu button stays inline in Navbar.tsx since 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 the GithubStats type
  • src/components/Navbar.tsx — now a ~116-line composition shell wiring useGithubStats/useNavDropdowns into the subcomponents

Behavior preserved

  • Same JSX structure, classNames, and conditionals
  • Same data-dropdown/data-dropdown-menu/data-dropdown-button attributes relied on by useNavDropdowns.ts's DOM queries
  • Same next-intl translation keys (`useTranslations("navigation")")
  • No new TypeScript any; all new props are explicitly typed

Validation

  • npx tsc --noEmit -p . — passes
  • npx eslint src/components/Navbar.tsx src/components/navbar/ — 0 errors (1 pre-existing warning in unrelated/untouched useNavDropdowns.ts)
  • npm run build — succeeds

Note

MobileMenu.tsx is ~500 lines because it mirrors the desktop dropdown links for small screens (the ~470-line duplication called out in the issue). Extracting a shared navbar/links.ts data 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

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]>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 16, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit b9853de
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6aa9dc8a8cb3340008f58b69
😎 Deploy Preview https://deploy-preview-6971--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow kubestellar-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2026
@kubestellar-prow

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@hivecommons-hive
hivecommons-hive Bot merged commit 8451883 into main Sep 16, 2026
15 of 18 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-6697 branch September 16, 2026 00:03
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

hivecommons-hive Bot added a commit that referenced this pull request Sep 17, 2026
…, #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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. frontend needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant