Add the unified AmplHeader to @ampl/kit (v0.3.0)#5
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds AmplHeader as the unified two-band AMPL header for the kit and wires the auth app root to use it, while preserving the deprecated SiteHeader export for compatibility.
Changes:
- Introduces the
kit/ui/ampl-headercomponent set, default tool registry, public types, mobile sheet, account menu, and shared lab navigation. - Adds
LocaleSwitcherdark variant, shared sign-out action helper, header/switcher i18n strings, and a new accent-pale theme token. - Updates auth root rendering, docs, version metadata, and SSR tests for the new header.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
app/root.tsx |
Replaces the old SiteHeader composition with AmplHeader and dark locale switcher. |
CONSUMING.md |
Documents AmplHeader, props, usage patterns, CSP notes, and v0.3.0 release notes. |
kit/README.md |
Adds kit-level AmplHeader usage documentation. |
kit/locales/en.ts |
Adds English header, nav, and switcher strings. |
kit/locales/es.ts |
Adds Spanish header, nav, and switcher strings. |
kit/theme.css |
Adds --color-accent-pale and updates accent-deep usage comments. |
kit/ui/AccountWidget.tsx |
Reuses the shared sign-out URL helper. |
kit/ui/LocaleSwitcher.tsx |
Adds the on-dark visual variant. |
kit/ui/index.ts |
Exports AmplHeader, DEFAULT_TOOLS, and header types; marks SiteHeader deprecated. |
kit/ui/lib/sign-out.ts |
Adds shared logout form action URL builder. |
kit/ui/ampl-header/AccountMenu.tsx |
Adds signed-in account dropdown for the header. |
kit/ui/ampl-header/AmplHeader.tsx |
Adds top-level header composition and mobile sheet state. |
kit/ui/ampl-header/InstitutionalBand.tsx |
Adds logo/lab-nav band and mobile menu toggle. |
kit/ui/ampl-header/MobileSheet.tsx |
Adds hamburger-controlled mobile navigation/account sheet. |
kit/ui/ampl-header/ToolSwitcher.tsx |
Adds cross-tool native disclosure switcher. |
kit/ui/ampl-header/WorkshopBand.tsx |
Adds plum tool band with contextual nav, locale switcher, and auth controls. |
kit/ui/ampl-header/index.ts |
Adds barrel exports for the header module. |
kit/ui/ampl-header/lab-nav.ts |
Adds shared lab-site navigation link registry. |
kit/ui/ampl-header/tools.ts |
Adds default AMPL tool registry. |
kit/ui/ampl-header/types.ts |
Adds public header prop/data contracts. |
package.json |
Bumps package version to 0.3.0. |
package-lock.json |
Syncs lockfile package version. |
tests/kit/AmplHeader.test.ts |
Adds SSR rendering coverage for header states and variants. |
tests/kit/LocaleSwitcher.test.ts |
Adds coverage for default and dark locale switcher variants. |
tests/routes/root-header.test.ts |
Updates root header SSR tests for AmplHeader. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| aria-haspopup="true" | ||
| className="flex cursor-pointer list-none items-center gap-[11px] whitespace-nowrap" | ||
| > | ||
| <span className="font-display text-[12px] uppercase tracking-[1.5px] text-accent-pale">Workshop</span> |
|
|
||
| {/* Contextual tool nav — desktop only; mobile uses the sheet. */} | ||
| {hasNav && ( | ||
| <nav className="hidden flex-1 items-center gap-[22px] md:flex"> |
|
|
||
| {/* Tool nav */} | ||
| {((nav && nav.length > 0) || context) && ( | ||
| <nav className="mt-5 flex flex-col gap-3 border-t border-white/20 pt-5"> |
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.
Adds
AmplHeader, the shared two-band header for every ampl.tools tool: a white institutional band (AMPL lockup + lab-site nav, owned by the kit, with full/compact sizing) and a deep-plum WORKSHOP band (cross-tool switcher, contextual nav, EN/ES, and a signed-in account chip or sign-in link), plus a hamburger mobile sheet. All tool variation flows through props.AmplHeaderexported from@ampl/kit/ui, with theDEFAULT_TOOLSregistry and supporting types.--color-accent-paletoken, anon-darkLocaleSwitchervariant, and a shared sign-out helper.AmplHeader(full masthead).SiteHeaderis deprecated in favour ofAmplHeaderbut retained for backward compatibility.CONSUMING.mdand the kit README. No database migrations. Bumps@ampl/kitto 0.3.0 (additive, minor).