Skip to content

Commit 0f76c2a

Browse files
feat(landing-page): fold Agent into a Product mega menu (#5705)
The top nav listed Product and Agent as sibling tabs. Product is really the umbrella for what Open Design ships, so promote it to a multi-column mega menu whose columns are top-level categories: a Products column (Open Design / HTML Anything / HTML Video) and an Agent column (the coding agents, header linking to the /agents/ hub). This declutters the bar and leaves room to add more category columns (e.g. Feature) later without another top-level tab. - Product trigger opens `.nav-dropdown-mega`: flex columns, each a category with a small-caps head + list; the long Agent list caps its own height and scrolls so the panel never runs off short viewports. - Product now lights up for /agents/ pages too, since Agent lives inside it. - Remove the standalone Agent top-level tab. - Mobile drawer flattens the mega to stacked full-width categories and drops the Agent scroll cap so the list flows naturally. No new i18n keys — reuses the existing `product` / `agent` labels, so all 11 locales are covered. `astro check` passes with 0 errors. Co-authored-by: Joey <236967869+joeylee12629-star@users.noreply.github.com>
1 parent 94a5bd2 commit 0f76c2a

2 files changed

Lines changed: 133 additions & 52 deletions

File tree

apps/landing-page/app/_components/header.tsx

Lines changed: 65 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,16 @@ export function Header({
208208
</button>
209209
<nav id='primary-nav' data-nav-primary>
210210
<ul className='nav-links'>
211-
{/* Product — the Open Design products. The trigger lights up only
212-
for its own family; every other section maps to its own
213-
trigger below, so a sub-page never marks Product by accident.
214-
It is a <button> (not a link) so it never navigates — Product
215-
used to bounce to the homepage — but its dropdown is revealed
216-
by the SAME pure-CSS :hover / :focus-within rule as the hub
217-
menus, so it works with no JS (first paint / script failure)
218-
and on touch (tapping focuses the button → :focus-within). */}
211+
{/* Product — a mega menu whose columns are top-level categories:
212+
the Open Design product family and the Agent catalog today,
213+
with room to add more (e.g. Feature) as its own column later.
214+
The trigger is a <button> (not a link) so it never navigates —
215+
Product used to bounce to the homepage — but its panel is
216+
revealed by the SAME pure-CSS :hover / :focus-within rule as
217+
the hub menus, so it works with no JS (first paint / script
218+
failure) and on touch (tapping focuses the button →
219+
:focus-within). It lights up for the whole product family AND
220+
for /agents/ pages now that Agent lives inside it. */}
219221
<li className='has-dropdown'>
220222
<button
221223
type='button'
@@ -224,36 +226,73 @@ export function Header({
224226
(active === 'product' ||
225227
active === 'home' ||
226228
active === 'html-anything' ||
227-
active === 'html-video'
229+
active === 'html-video' ||
230+
active === 'agent'
228231
? ' is-active'
229232
: '')
230233
}
231234
>
232235
{productMenuCopy.product}
233236
<span className='dropdown-caret' aria-hidden='true'></span>
234237
</button>
235-
<ul className='nav-dropdown' aria-label={productMenuCopy.product}>
236-
<li>
237-
<a href={href('/')}>
238-
<span className='dropdown-name'>{productMenuCopy.openDesignName}</span>
239-
<span className='dropdown-blurb'>{productMenuCopy.openDesignBlurb}</span>
240-
</a>
238+
<ul
239+
className='nav-dropdown nav-dropdown-mega'
240+
aria-label={productMenuCopy.product}
241+
>
242+
{/* Products column — the Open Design product family. Names
243+
only (no blurbs): keeps the column compact and aligned
244+
with the Agent column, and avoids per-locale width blowups
245+
from long descriptions. */}
246+
<li className='nav-mega-col'>
247+
<span className='nav-mega-col-head'>{productMenuCopy.product}</span>
248+
<ul className='nav-mega-list'>
249+
<li>
250+
<a href={href('/')}>
251+
<span className='dropdown-name'>{productMenuCopy.openDesignName}</span>
252+
</a>
253+
</li>
254+
<li>
255+
<a
256+
href={href('/html-anything/')}
257+
className={active === 'html-anything' ? 'is-active' : undefined}
258+
>
259+
<span className='dropdown-name'>{productMenuCopy.htmlAnythingName}</span>
260+
</a>
261+
</li>
262+
<li>
263+
<a href={href('/html-video/')}>
264+
<span className='dropdown-name'>{productMenuCopy.htmlVideoName}</span>
265+
</a>
266+
</li>
267+
</ul>
241268
</li>
242-
<li>
269+
{/* Agent column — the coding agents each with a dedicated
270+
design page. The column header links to the /agents/ hub
271+
(the old top-level Agent tab's target). The list caps its
272+
own height and scrolls so 21 rows never run the panel
273+
off-screen; the shorter Products column stays static. */}
274+
<li className='nav-mega-col nav-mega-col-agent'>
243275
<a
244-
href={href('/html-anything/')}
245-
className={active === 'html-anything' ? 'is-active' : undefined}
276+
href={href('/agents/')}
277+
className={
278+
'nav-mega-col-head' + (active === 'agent' ? ' is-active' : '')
279+
}
246280
>
247-
<span className='dropdown-name'>{productMenuCopy.htmlAnythingName}</span>
248-
<span className='dropdown-blurb'>{productMenuCopy.htmlAnythingBlurb}</span>
249-
</a>
250-
</li>
251-
<li>
252-
<a href={href('/html-video/')}>
253-
<span className='dropdown-name'>{productMenuCopy.htmlVideoName}</span>
254-
<span className='dropdown-blurb'>{productMenuCopy.htmlVideoBlurb}</span>
281+
{productMenuCopy.agent}
255282
</a>
283+
<ul className='nav-mega-list nav-mega-list-scroll'>
284+
{AGENTS.map((agent) => (
285+
<li key={agent.route}>
286+
<a href={href(`/agents/${agent.route}/`)}>
287+
<span className='dropdown-name'>{agent.name}</span>
288+
</a>
289+
</li>
290+
))}
291+
</ul>
256292
</li>
293+
{/* Future category columns (e.g. Feature) drop in here as
294+
another <li className='nav-mega-col'> with its own head +
295+
list; the panel widens automatically. */}
257296
</ul>
258297
</li>
259298

@@ -311,32 +350,6 @@ export function Header({
311350
</ul>
312351
</li>
313352

314-
{/* Agent — the coding agents with a dedicated design page. The
315-
top-level link goes to the /agents/ hub. */}
316-
<li className='has-dropdown'>
317-
<a
318-
href={href('/agents/')}
319-
className={active === 'agent' ? 'is-active' : undefined}
320-
>
321-
{productMenuCopy.agent}
322-
<span className='dropdown-caret' aria-hidden='true'></span>
323-
</a>
324-
{/* 21 coding-agent rows — reuse the tall-dropdown height cap so
325-
the panel scrolls instead of running off short viewports. */}
326-
<ul
327-
className='nav-dropdown nav-dropdown-solution'
328-
aria-label={productMenuCopy.agent}
329-
>
330-
{AGENTS.map((agent) => (
331-
<li key={agent.route}>
332-
<a href={href(`/agents/${agent.route}/`)}>
333-
<span className='dropdown-name'>{agent.name}</span>
334-
</a>
335-
</li>
336-
))}
337-
</ul>
338-
</li>
339-
340353
{/* Plugins — the three composable catalogs. */}
341354
<li className='has-dropdown'>
342355
<a

apps/landing-page/app/globals.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,63 @@ body::before {
10521052
overflow-y: auto;
10531053
}
10541054

1055+
/* Product mega menu — category columns side by side. Each `.nav-mega-col` is
1056+
one top-level category (Products, Agent, and later e.g. Feature); adding a
1057+
column just widens the panel. Reuses the base `.nav-dropdown` card chrome
1058+
(paper, border, shadow, item hover fills) and only lays the columns out.
1059+
Product is the leftmost nav item, so the panel opens rightward with no
1060+
right-edge overflow risk. */
1061+
.nav-dropdown-mega {
1062+
display: flex;
1063+
gap: 0;
1064+
min-width: 0;
1065+
max-width: min(94vw, 640px);
1066+
}
1067+
.nav-dropdown-mega .nav-mega-col {
1068+
display: flex;
1069+
flex-direction: column;
1070+
flex: 0 0 auto;
1071+
min-width: 216px;
1072+
}
1073+
.nav-dropdown-mega .nav-mega-col + .nav-mega-col {
1074+
margin-left: 6px;
1075+
padding-left: 6px;
1076+
border-left: 1px solid rgba(26, 26, 26, 0.08);
1077+
}
1078+
.nav-dropdown-mega .nav-mega-list {
1079+
margin: 0;
1080+
padding: 0;
1081+
list-style: none;
1082+
}
1083+
/* Column header — small-caps category label, matching the grouped-dropdown
1084+
label. When it is a link (Agent → /agents/ hub) it tints on hover; it
1085+
overrides the generic `.nav-dropdown a` block/padding/hover-fill styles. */
1086+
.nav-dropdown-mega .nav-mega-col-head {
1087+
display: block;
1088+
padding: 4px 12px 6px;
1089+
font-family: var(--sans);
1090+
font-size: 11px;
1091+
font-weight: 700;
1092+
letter-spacing: 0.06em;
1093+
text-transform: uppercase;
1094+
color: var(--ink-faint);
1095+
text-decoration: none;
1096+
}
1097+
a.nav-mega-col-head:hover {
1098+
background: transparent;
1099+
color: var(--coral);
1100+
}
1101+
a.nav-mega-col-head.is-active {
1102+
background: transparent;
1103+
color: var(--ink);
1104+
}
1105+
/* A long column (Agent: 21 rows) caps its own height and scrolls so the
1106+
panel never runs off short viewports; shorter columns stay static. */
1107+
.nav-dropdown-mega .nav-mega-list-scroll {
1108+
max-height: min(60vh, 420px);
1109+
overflow-y: auto;
1110+
}
1111+
10551112
/*
10561113
* Hamburger toggle. Hidden at desktop widths (≥1080px). At narrower
10571114
* viewports it replaces the inline nav-links and toggles a panel
@@ -5561,6 +5618,17 @@ footer .container {
55615618
/* Let the Solution panel flow naturally inside the flattened nav panel
55625619
instead of scrolling within a capped box. */
55635620
.nav-dropdown-solution { max-height: none; overflow: visible; }
5621+
/* Product mega menu flattens to stacked full-width categories in the mobile
5622+
drawer: drop the flex columns, dividers, and the agent scroll cap so each
5623+
category reads as a labeled vertical list. */
5624+
.nav-dropdown-mega { display: block; max-width: none; }
5625+
.nav-dropdown-mega .nav-mega-col { min-width: 0; }
5626+
.nav-dropdown-mega .nav-mega-col + .nav-mega-col {
5627+
margin-left: 0;
5628+
padding-left: 0;
5629+
border-left: none;
5630+
}
5631+
.nav-dropdown-mega .nav-mega-list-scroll { max-height: none; overflow: visible; }
55645632
}
55655633
@media (max-width: 1080px) {
55665634
.container { padding: 0 32px; }

0 commit comments

Comments
 (0)