Skip to content

Header: hover-open dropdowns, per-item underline, Model dropdown#1059

Merged
PavelMakarchuk merged 1 commit into
mainfrom
explore/header-hover-redesign
May 26, 2026
Merged

Header: hover-open dropdowns, per-item underline, Model dropdown#1059
PavelMakarchuk merged 1 commit into
mainfrom
explore/header-hover-redesign

Conversation

@PavelMakarchuk
Copy link
Copy Markdown
Contributor

Reworks the desktop header to feel more responsive and to expose Model sections directly instead of bouncing users through the model overview.

Behaviour

  • Dropdowns open on hover (About, Model) with a 100ms intent delay and a 200ms grace delay before close. A transparent paddingTop "bridge" inside the same hover container fills the 10px visual gap between trigger and panel, so the cursor doesn't trigger close while travelling to the panel.
  • Click toggles still work for touch and keyboard. Escape and outside-click close the dropdown as before.
  • Center-out underline grow on hover (white 2px bar, transform: scaleX(0→1)). The active page — or any child of a dropdown trigger — keeps the underline lit, so the bar always shows where you are.
  • Focus = hover affordance so keyboard users get the same feedback as pointer users.

Model dropdown

  • The flat Model → /model link expands into a sidebar mirror:
    • Rules — Coverage, Parameters, Variables
    • Data — Pipeline, Calibration, Validation
    • Behavioral responses
  • Children are indented one level under their parent. Parents (Rules, Data, Behavioral responses) are clickable to their overview pages, which were just added in policyengine-model#41.
  • All Model links use <a> via a new external flag on DropdownItem so the Vercel multizone rewrite is hit instead of a client-side route that the website zone can't fulfil.

Mobile

  • MobileMenu now walks the nested children too and honors external, so Model sub-pages route correctly on touch devices.

Small things

  • Logo→nav gap bumped from 12px to 40px so the logo reads as an anchor rather than another menu entry.
  • Per-property transition delays on dropdown rows: the cascading entrance reveal staggers opacity only, while hover background/color stay instant. Fixes the visible lag when sweeping the cursor across rows of an open dropdown.
  • CountrySelector hover inlined after removing the shared hoverHandlers helper (it no longer fit the underline pattern).

Test plan

  • Hover any nav item → underline grows from center; leaving the item retracts it
  • Hover About → dropdown opens after ~100ms; mousing down into a child via the gap does not close it
  • Hover Model → same; children render indented with slightly muted color, parents clickable
  • Sweep mouse rapidly across dropdown rows → hover background tracks the cursor with no perceptible delay (regression check for the per-property delay fix)
  • Navigate to /us/research → Research underline stays lit
  • Navigate to /us/model/rules/coverage → Model underline stays lit (active state walks dropdown children)
  • Tab through nav with keyboard → each item lights up on focus; Escape closes an open dropdown
  • Resize to mobile → menu icon opens slide-out; Model dropdown shows nested children indented; clicking a Model child crosses zones correctly
  • Click anywhere outside an open dropdown → it closes

🤖 Generated with Claude Code

Reworks the desktop nav to feel more responsive and to expose Model
sections directly instead of bouncing through the model overview.

Behaviour
- Dropdowns (About, Model) open on hover with a 100ms intent delay and
  close on a 200ms grace delay; a transparent paddingTop "bridge"
  inside the same hover container fills the 10px visual gap so the
  cursor doesn't trigger close while travelling to the panel. Click
  toggles still work for touch/keyboard, and Escape + outside-click
  close as before.
- Each nav item now gets a center-out underline-grow on hover. The
  active page (or any of its children, for dropdown triggers) keeps
  the underline lit, so the bar always shows where you are.
- Focus produces the same affordance as hover so keyboard users get
  the same feedback.

Model dropdown
- Was a single flat link to /model. Now expands into a sidebar-mirror:
  Rules (Coverage, Parameters, Variables), Data (Pipeline,
  Calibration, Validation), Behavioral responses. Children are
  indented one level. Parents (Rules, Data, Behavioral) are clickable
  to their overview pages — these are real pages as of
  PolicyEngine/policyengine-model#41. All Model links use <a> via a
  new `external` flag on DropdownItem so the Vercel multizone rewrite
  is hit instead of a client-side route that the website zone can't
  fulfil.

Mobile
- MobileMenu now walks the nested children too and honors `external`
  so Model sub-pages route correctly on touch devices.

Small things
- Logo→nav gap bumped from 12px to 40px so the logo reads as an
  anchor instead of another menu entry.
- Per-property transition delays on dropdown rows: the cascading
  entrance reveal staggers `opacity` only, while hover
  background/color stay instant — fixes the lag when sweeping the
  cursor across rows in an open dropdown.
- CountrySelector hover inlined after removing the shared
  hoverHandlers helper (it no longer fit the underline pattern).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment May 26, 2026 2:06pm
policyengine-calculator Ready Ready Preview, Comment May 26, 2026 2:06pm
policyengine-calculator-next Ready Ready Preview, Comment May 26, 2026 2:06pm
policyengine-website Ready Ready Preview, Comment May 26, 2026 2:06pm

Request Review

@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review May 26, 2026 14:08
@PavelMakarchuk PavelMakarchuk merged commit f730e7d into main May 26, 2026
14 checks passed
PavelMakarchuk added a commit to PolicyEngine/policyengine-model that referenced this pull request May 26, 2026
…pdown) (#42)

Mirrors the website header changes (PolicyEngine/policyengine-app-v2#1059)
so users see consistent navigation across zones.

- Dropdowns open on hover with a 100ms intent delay and a 200ms close
  grace; a transparent paddingTop "bridge" inside the same hover
  container fills the 10px gap so the cursor doesn't trigger close
  while travelling to the panel. Click toggles, Escape, and
  outside-click still work for touch / keyboard.
- Per-item center-out underline grow on hover. The active page (or any
  child of a dropdown trigger) keeps the underline lit so the bar
  shows where you are. Active-state walks dropdown children
  recursively so visiting /us/model/rules/coverage lights up Model.
- Model is now a dropdown with the full sidebar mirror: Rules
  (Coverage / Parameters / Variables), Data (Pipeline / Calibration /
  Validation), Behavioral responses. Children are indented one level.
- Per-property transition delays on dropdown rows: the cascading
  entry reveal staggers opacity only; hover background/color stay
  instant.
- Logo→nav gap bumped from spacing.md (12px) to 40px so the logo
  reads as an anchor instead of another menu entry.
- MobileMenu now walks nested children too and indents them.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PavelMakarchuk added a commit to PolicyEngine/household-api-docs that referenced this pull request May 26, 2026
…pdown) (#21)

Mirrors the website header changes (PolicyEngine/policyengine-app-v2#1059)
so users see consistent navigation across zones.

- Dropdowns open on hover with a 100ms intent delay and a 200ms close
  grace; a transparent paddingTop "bridge" inside the same hover
  container fills the 10px gap so the cursor doesn't trigger close
  while travelling to the panel. Click toggles, Escape, and
  outside-click still work for touch / keyboard.
- Per-item center-out underline grow on hover. The active page (or
  any child of a dropdown trigger) keeps the underline lit so the bar
  shows where you are. Active-state walks dropdown children
  recursively.
- Model is now a dropdown with the full sidebar mirror: Rules
  (Coverage / Parameters / Variables), Data (Pipeline / Calibration /
  Validation), Behavioral responses. Children are indented one level.
- Per-property transition delays on dropdown rows: the cascading
  entry reveal staggers opacity only; hover background/color stay
  instant.
- Logo→nav gap bumped from spacing.md (12px) to 40px so the logo
  reads as an anchor instead of another menu entry.
- MobileMenu now walks nested children too and indents them.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PavelMakarchuk added a commit that referenced this pull request Jun 5, 2026
* Align calculator header with main website header

The calculator-app shell (/us/reports etc.) still rendered through
StandardLayout → HomeHeader, which kept the pre-#1059 design (click-open
dropdowns, no per-item underline, missing Model/Python/Events). Update
NavItem to mirror the website Header (hover-open, underline with active
detection, nested children), expand the navItems in HomeHeader to match,
and teach MobileMenu to render nested children.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Remove HomeHeader from the website-migration guard

These files were ported to website/src/components/Header.tsx, but the
calculator-app still renders the legacy HomeHeader via StandardLayout, so
they have to stay editable in app/. Drop the matching entries from the
PR guard and document the situation in CLAUDE.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant