Repository navigation
refactor(navbar): delete the v1 navbar and footer (J6) - #331
Merged
Merged
Conversation
The v2 navbar, the v2 footer and the menu hooks import NavItem and DropdownItem from the v1 navbar folder, which is about to be deleted. The types file now lives in app/components/navbar-v2/types.ts and every import points there.
Since #324 the layout renders only the v2 navbar and footer, and no module imports the v1 ones. - Delete app/components/navbar/ and app/components/Footer.tsx, with the v1 navbar test. - Drop the NavbarScrollState and ScrollDirection types, used only by the v1 scroll hook. - Remove the footer.company, footer.services, footer.method, footer.resources and footer.newsletter keys from both locales. Only the v1 footer used them. - Move the check of the challenge load flag, read by shouldRevalidate in the main route, from the v1 navbar test to the useMenuItems test. It was its only test.
- Component inventory: replace the outdated navigation table with the v2 navbar parts, note where the navigation types live, and mark NewsletterForm as no longer rendered. - ADR 0001: remove the deleted v1 footer and mobile menu from the shared component follow-up table. - Source tree: list navbar-v2 and footer-v2 in place of Header.tsx and Footer.tsx.
The deleted v1 navbar test was the only check on how the challenge entries are built and shown. - useMenuItems: each published challenge maps to an entry with its label, tagline, localised path and palette. Reset the challenge load flag after each test, since it is module state. - NavbarBar mobile menu: the close button closes the dialog, and the challenges from the layout data appear in the menu. - LayoutMain: update the comment that named the v1 footer.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #250. Part of #212 (J6).
Since #324,
app/components/LayoutMain.tsxrenders only the v2 navbar and footer. This PR deletes the v1 ones.Changes
app/components/navbar/types.tsis nowapp/components/navbar-v2/types.ts. All 14 importers point there. The navbar-v2 files use the~/components/navbar-v2/typesalias, which keeps each change to one line in files the J5: studio page with a PersonCard per member #244 branch also edits.app/components/navbar/(navbar, mobile menu, dropdown parts, styles, scroll hook, test) andapp/components/Footer.tsx. A grep overapp/,e2e/, the tests and the/design-systempages finds no importer. The v2 code used no v1 helper: it has its ownuse-scrolled.ts.NavbarScrollStateandScrollDirectionare dropped. Only the v1 scroll hook used them.locales/fr/common.jsonandlocales/en/common.json:footer.company.*,footer.services.*,footer.method.*,footer.resources.*andfooter.newsletter.*. Only the v1 footer used them, and no code buildsfooter.*keys dynamically. The remainingfooter.*keys are all used by the v2 footer.shouldRevalidatereads inapp/routes/_main.tsx(inapp/hooks/useMenuItems.test.tsx);app/components/navbar-v2/navbar-bar.test.tsx).navbar-v2/andfooter-v2/.Left as is, for follow-up
app/components/NewsletterForm.tsxandapp/components/ui/Spinner.tsxare no longer rendered anywhere: the v1 footer and navbar were their only users.NewsletterFormis the only newsletter sign-up, so removing it is a product decision. The inventory marks both as unused.app/components/LanguageSwitcher.tsxwas already unused before this PR.docs/development/j1-route-review-checklist.mdwere written for the v1 navbar. Check they still apply before the next rerun.specs/still names the v1 paths. Those files are history and stay unchanged.Pages this can alter
None by design: the deleted code was no longer rendered. The navigation types moved without change.
Checks
pnpm check,pnpm typecheckandpnpm test:run(86 files, 1238 tests) pass. A code review of the branch diff found no critical or high issue. Its test gap and doc findings are fixed in the last two commits.