From 6805a003c9d74ef78cd395ebcd7e48a62b121b2f Mon Sep 17 00:00:00 2001 From: cc Date: Fri, 4 Dec 2026 19:56:00 +0100 Subject: [PATCH] feat(header,home): one header for every size; a slimmer home page Header - The logo always leftmost; the filter beside it with the icons in the corner; the page's controls on a second row below lg, in line from lg; the filter centred from 2xl, each page's at a set width. - Every control one height (h-9); the platform filter a segmented control like its neighbours, in the header at every width. - Major Releases / All Builds is one toggle, "All builds" (?view=all). Home - Below 1800px no latest-release lines (the grid opens on those releases): only the way into the Time Machine, a grid card wide. - 1800px and up: the timeline as wide as its widest row and centred with the panel, so switching lines moves nothing and short rows leave no empty stretch. - Skeletons follow. Co-Authored-By: Claude Opus 5.5 --- src/app/os/files/page.tsx | 2 +- src/app/os/find/page.tsx | 2 +- src/app/os/keys/page.tsx | 2 +- src/components/directory-tabs.tsx | 21 ++- src/components/home-skeleton.tsx | 47 ++----- src/components/latest-releases.tsx | 203 +++------------------------- src/components/navtop.tsx | 142 +++++++++---------- src/components/oslist.tsx | 98 ++++++++------ src/components/release-timeline.tsx | 12 ++ 9 files changed, 195 insertions(+), 334 deletions(-) diff --git a/src/app/os/files/page.tsx b/src/app/os/files/page.tsx index 7ebf455..b8843c6 100644 --- a/src/app/os/files/page.tsx +++ b/src/app/os/files/page.tsx @@ -48,7 +48,7 @@ export default function Files() { const filterControls = ( <> -
+
-
+
+
l.sources)); const head = line.sources[0]; const latest = head ? [...head.list].sort(byVersionDesc)[0] : undefined; // The whole line, oldest first (OS X, then macOS), for the growth chart. @@ -156,7 +161,7 @@ export function DirectoryTabs({ lines }: { lines: DirectoryLine[] }) {
{lines.map((l, n) => { const active = l === line; @@ -172,7 +177,7 @@ export function DirectoryTabs({ lines }: { lines: DirectoryLine[] }) { title={`${count} builds (${n + 1})`} onClick={() => choose(l.id)} className={cn( - "rounded-md px-3 py-1 text-sm transition-colors", + "flex items-center rounded-md px-3 text-sm transition-colors", active ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground", @@ -184,11 +189,19 @@ export function DirectoryTabs({ lines }: { lines: DirectoryLine[] }) { })}
-
+ {/* Timeline and panel centred together, each its own width: the + timeline as wide as the widest row of either line (switching + lines moves nothing; no empty stretch where a line's rows are + short), the panel fixed. Widths are the timeline's own + (release-timeline.tsx): a build 6.5rem + 0.25rem gap, the axis + 6.5rem + 1.5rem gap; a size up from 2400px. */} +
{/* Up to very wide screens. */}
- {/* Phones: the platform buttons. */} -
- {[8, 12, 10].map((w) => ( - - ))} -
-
- {[0, 1].map((i) => ( -
- - - -
- {[0, 1, 2].map((j) => ( -
- - -
- ))} -
- -
- ))} + {/* The way into the Time Machine (static: the real one). */} +
{SECTIONS.map(({ cards, codenames }, s) => ( @@ -103,8 +75,13 @@ export function HomeSkeleton({ {/* Very wide screens: as directory-tabs.tsx and release-timeline.tsx. */}
-
-
    +
    +
      {ROWS.map((count, i) => (
    1. = { - iOS: "iOS", - mac: "macOS", - osx: "OS X", -}; - /** Newest first, by version number. */ export function byVersionDesc(a: OS, b: OS) { const x = a.version.split(".").map(Number); @@ -87,172 +67,31 @@ export function useFigures(groups: string[]) { return figures; } -/** Platforms that are over: no "latest" for them. */ -const RETIRED = new Set(["osx"]); - -export function LatestReleases({ groups }: { groups: Group[] }) { - const live = groups.filter((g) => !RETIRED.has(g.name)); - const figures = useFigures(live.map((g) => g.name)); +/** + * Up to very wide screens, above the grid: just the way into the Time + * Machine. The latest releases need no line of their own: the grid opens + * on them. (Very wide screens: directory-tabs.tsx.) + */ +export function LatestReleases() { return ( -
      - {live.map((group) => { - const newest = [...group.list].sort(byVersionDesc); - const latest = newest[0]; - if (!latest) return null; - const stable = latest.beta ? newest.find((os) => !os.beta) : undefined; - return ( - - ); - })} +
      ); } -export function LatestCard({ - group, - os, - stable, - figures, -}: { - group: string; - os: OS; - stable?: OS; - figures?: Figures; -}) { - const platform = PLATFORM_NAMES[group] ?? group; - const codename = os.name.endsWith(os.version) ? null : os.name; - const tag = encodeURIComponent(`${group}/${versionTag(os)}`); - return ( - - ); -} - -function Figure({ label, value }: { label: string; value?: React.ReactNode }) { - return ( -
      -
      {label}
      -
      - {value === undefined ? ( - - ) : ( - {value} - )} -
      -
      - ); -} - -/** The way into the Time Machine (a full-screen journey), in its starfield. */ -export function TimeMachineCard({ className }: { className?: string } = {}) { +/** The way into the Time Machine, one line in its starfield (about a grid + * card wide; phones: the full width). */ +export function TimeMachineCard() { return (
      -
      +
      - {options.map(({ href, label, active }) => ( - { - if (goHome()) event.preventDefault(); - } - : undefined - } - aria-current={active ? "page" : undefined} - className={`px-3 py-1 text-sm rounded-md transition-colors ${ - active - ? "bg-background text-foreground shadow-sm font-medium" - : "text-muted-foreground hover:text-foreground" - }`} - > - {label} - - ))} -
      + { + if (goHome()) event.preventDefault(); + } + : undefined + } + aria-current={on ? "page" : undefined} + title={on ? "Showing every build" : "Show every build"} + className={cn( + "inline-flex h-9 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-lg border px-3 text-sm transition-colors min-[1800px]:hidden", + on + ? "border-primary/40 bg-primary/15 font-medium text-foreground" + : "border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground", + )} + > + + All builds + ); } @@ -150,47 +148,51 @@ export function NavTop() { // Glass, no border: content scrolling under it shows through, blurred, // which marks the edge; nearly opaque where blur isn't supported.
      - {/* Large screens: three columns, the filter centred between the page - controls (left) and the icons (right). */} -
      - {/* Left group: logo + breadcrumb + left portal */} -
      -

      + {/* + Four pieces: the logo, the page's controls (All builds and the + platform; a release's version and Keys/Files), the filter, the icons. + - Below lg: row 1 is the logo, the filter across, the icons (the + theme toggle in the corner); row 2, the page's controls. + - lg: one row, logo and page controls, the filter, the icons. + - 2xl: three columns, the filter centred. + The logo and page controls share a wrapper that is only a box from + lg ("contents" below, so each takes its own place in the rows). + Controls share one height (h-9) so everything lines up. + */} +
      +
      +

      entdb

      - {isHome && } - {isHome && ( -
      - )} - {isOSPage && os && } +
      + {isHome && } + {isHome && ( +
      + )} + {isOSPage && os && ( + + )} +
      - {/* Filter sits next to the page controls (not pushed to the far edge, - which left a wide gap on large screens); the theme toggle takes - the far right. Wraps to its own row when there's no room. */} - {/* With a filter it needs room to be usable, so it takes its own - row rather than shrinking to a few letters. */} -
      - {showHeaderControls && ( -
      - )} -
      - - -
      + {showHeaderControls && ( +
      + )} + +
      + +

      diff --git a/src/components/oslist.tsx b/src/components/oslist.tsx index 862fabc..323f90a 100644 --- a/src/components/oslist.tsx +++ b/src/components/oslist.tsx @@ -262,7 +262,7 @@ export default function OSList() { > {/* The filter is usable before the list loads (no header shift). */} -
      +
      0 && ( <> - {/* Platform buttons - in header on desktop, inline on mobile */} + {/* Platform filter: in the header beside the filter (a segmented + control, like its neighbours), at every width. Very wide + screens: the directory's tabs choose instead. */} - {/* Very wide screens: the directory's tabs choose instead. */} -
      - {groups.map((group) => ( - - ))} -
      +
      - {/* Mobile platform buttons - shown inline in content */} -
      - {groups.map((group) => ( - - ))} -
      - {isFiltering ? (
      {filteredCount} of {totalCount} builds @@ -359,7 +330,7 @@ export default function OSList() { // the Time Machine. // (Very wide screens: under the directory's tabs instead.)
      - +
      )} @@ -481,3 +452,50 @@ export default function OSList() {
      ); } + +/** + * Show one platform (or all: pressing the shown one again). A segmented + * control styled like the header's others (Major Releases / All Builds, + * Keys / Files), so they line up: same track, padding and height. + */ +function PlatformFilter({ + groups, + selected, + onToggle, + className, +}: { + groups: Group[]; + selected: string | null; + onToggle: (name: string) => void; + className?: string; +}) { + return ( +
      + Platform + {groups.map((group) => { + const active = selected === group.name; + return ( + + ); + })} +
      + ); +} diff --git a/src/components/release-timeline.tsx b/src/components/release-timeline.tsx index 1c43495..2fc0ef4 100644 --- a/src/components/release-timeline.tsx +++ b/src/components/release-timeline.tsx @@ -71,6 +71,18 @@ function stopsOf(group: string, list: OS[]): Stop[] { return stops.reverse(); } +/** The most builds any version of these lines has (the widest row). */ +export function widestRow(lines: { group: string; list: OS[] }[][]) { + return Math.max( + 1, + ...lines.flatMap((sources) => + sources.flatMap(({ group, list }) => + stopsOf(group, list).map((stop) => stop.builds.length), + ), + ), + ); +} + /** * How long the pointer must rest on a build before its card opens: longer * than crossing a build on the way somewhere (tens of ms), short enough to