From a790440660cc55e2b38981680d2c4596376dace9 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:13:31 -0800 Subject: [PATCH 01/18] Restyle theme tokens for the Shelf redesign Warm paper/ink colour scales back uiColor and the root primary theme, system font stacks replace the never-loaded Inter, headings get heavier and tighter, radii drop the squircle bumps, buttons become pills with a solid ink primary, and shadows are warm-tinted. Co-Authored-By: Claude Opus 5.5 --- src/components/AppCard.tsx | 1 - src/components/AppListRow.tsx | 1 - src/components/AppTagCard.tsx | 3 -- src/components/AppTagHero.tsx | 2 - src/components/DirectoryListingReviewCard.tsx | 1 - src/components/EcosystemCategoryCard.tsx | 1 - src/components/GameDetailsPanel.tsx | 1 - src/components/HeroImage.tsx | 1 - src/components/funding-popover-chip.tsx | 3 -- src/components/product-listing-form.tsx | 6 --- src/design-system/alert/index.tsx | 1 - src/design-system/aspect-ratio/index.tsx | 1 - src/design-system/avatar/index.tsx | 2 - src/design-system/card/index.tsx | 1 - src/design-system/checkbox/index.tsx | 1 - src/design-system/color-area/index.tsx | 2 - src/design-system/color-slider/index.tsx | 1 - src/design-system/color-swatch/index.tsx | 2 - src/design-system/disclosure/index.tsx | 1 - src/design-system/file-drop-zone/index.tsx | 1 - src/design-system/image-cropper/index.tsx | 1 - src/design-system/kbd/index.tsx | 1 - src/design-system/menubar/index.tsx | 1 - src/design-system/page/Page.tsx | 1 - src/design-system/segmented-control/index.tsx | 3 -- src/design-system/sidebar/index.tsx | 1 - src/design-system/skeleton/index.tsx | 1 - src/design-system/tabs/index.tsx | 1 - src/design-system/theme/color.stylex.tsx | 29 ++++++----- .../theme/colors/paper.stylex.tsx | 44 ++++++++++++++++ src/design-system/theme/radius.stylex.tsx | 47 +++++------------ src/design-system/theme/shadow.stylex.tsx | 23 ++++---- src/design-system/theme/typography.stylex.tsx | 25 +++++---- src/design-system/theme/useButtonStyles.ts | 52 ++++++++++++------- src/design-system/theme/useCalendarStyles.ts | 1 - src/design-system/theme/useDialogStyles.ts | 1 - src/design-system/theme/useInputStyles.ts | 8 ++- .../theme/useListBoxItemStyles.ts | 1 - src/design-system/theme/usePopoverStyles.ts | 1 - src/design-system/tooltip/index.tsx | 1 - src/design-system/tree/index.tsx | 1 - src/design-system/typography/index.tsx | 2 - src/design-system/video/index.tsx | 1 - src/routes/__root.tsx | 39 +++++++------- src/routes/_header-layout.index.tsx | 1 - src/routes/_header-layout.notifications.tsx | 1 - ...eader-layout.products.$productId.index.tsx | 1 - src/routes/_header-layout.profile.$actor.tsx | 2 - src/routes/login.tsx | 1 - src/styles.css | 10 ++++ 50 files changed, 162 insertions(+), 173 deletions(-) create mode 100644 src/design-system/theme/colors/paper.stylex.tsx diff --git a/src/components/AppCard.tsx b/src/components/AppCard.tsx index a3d7883..f6b7aca 100644 --- a/src/components/AppCard.tsx +++ b/src/components/AppCard.tsx @@ -63,7 +63,6 @@ const styles = stylex.create({ }, surface: { borderRadius: radius.lg, - cornerShape: "squircle", boxShadow: { default: shadow.sm, [stylex.when.ancestor(":hover")]: shadow.lg, diff --git a/src/components/AppListRow.tsx b/src/components/AppListRow.tsx index 06dc54b..b0fbc6f 100644 --- a/src/components/AppListRow.tsx +++ b/src/components/AppListRow.tsx @@ -63,7 +63,6 @@ const styles = stylex.create({ }, surface: { borderRadius: radius.md, - cornerShape: "squircle", backgroundColor: { default: uiColor.bg, [stylex.when.ancestor(":hover")]: uiColor.component1, diff --git a/src/components/AppTagCard.tsx b/src/components/AppTagCard.tsx index 2de1006..03266bc 100644 --- a/src/components/AppTagCard.tsx +++ b/src/components/AppTagCard.tsx @@ -47,7 +47,6 @@ import { getAppTagAccent, getAppTagEmoji } from "../lib/app-tag-visuals"; const styles = stylex.create({ cardLink: { borderRadius: radius["2xl"], - cornerShape: "squircle", textDecoration: "none", boxShadow: shadow.md, display: "flex", @@ -64,7 +63,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["8xl"], color: "white", display: "flex", @@ -98,7 +96,6 @@ const styles = stylex.create({ "::before": { inset: 0, borderRadius: radius.xl, - cornerShape: "squircle", boxShadow: shadow["xl"], content: "''", opacity: 0, diff --git a/src/components/AppTagHero.tsx b/src/components/AppTagHero.tsx index e3e10c9..36dddc1 100644 --- a/src/components/AppTagHero.tsx +++ b/src/components/AppTagHero.tsx @@ -62,7 +62,6 @@ const styles = stylex.create({ }, imageFrame: { borderRadius: radius["2xl"], - cornerShape: "squircle", overflow: "hidden", maxHeight: "240px", width: "100%", @@ -85,7 +84,6 @@ const styles = stylex.create({ borderRadius: radius["2xl"], borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", overflow: "hidden", display: "flex", flexDirection: "column", diff --git a/src/components/DirectoryListingReviewCard.tsx b/src/components/DirectoryListingReviewCard.tsx index 51fe991..c2b6b35 100644 --- a/src/components/DirectoryListingReviewCard.tsx +++ b/src/components/DirectoryListingReviewCard.tsx @@ -162,7 +162,6 @@ const styles = stylex.create({ repliesToggleRow: { borderRadius: radius.md, borderWidth: 0, - cornerShape: "squircle", gap: gap["2xl"], alignItems: "center", backgroundColor: "transparent", diff --git a/src/components/EcosystemCategoryCard.tsx b/src/components/EcosystemCategoryCard.tsx index c44e42d..7da114c 100644 --- a/src/components/EcosystemCategoryCard.tsx +++ b/src/components/EcosystemCategoryCard.tsx @@ -53,7 +53,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["8xl"], overflow: "hidden", textDecoration: "none", diff --git a/src/components/GameDetailsPanel.tsx b/src/components/GameDetailsPanel.tsx index 678e5e5..a67d367 100644 --- a/src/components/GameDetailsPanel.tsx +++ b/src/components/GameDetailsPanel.tsx @@ -104,7 +104,6 @@ const styles = stylex.create({ borderRadius: radius.lg, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap.md, display: "flex", flexDirection: "column", diff --git a/src/components/HeroImage.tsx b/src/components/HeroImage.tsx index 3545874..996aa4e 100644 --- a/src/components/HeroImage.tsx +++ b/src/components/HeroImage.tsx @@ -37,7 +37,6 @@ const styles = stylex.create({ }, frame: { borderRadius: radius["3xl"], - cornerShape: "squircle", overflow: "hidden", position: "relative", zIndex: 1, diff --git a/src/components/funding-popover-chip.tsx b/src/components/funding-popover-chip.tsx index fdd6e93..602055f 100644 --- a/src/components/funding-popover-chip.tsx +++ b/src/components/funding-popover-chip.tsx @@ -69,7 +69,6 @@ const styles = stylex.create({ borderRadius: radius.md, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", alignItems: "center", backgroundColor: successColor.bgSubtle, color: successColor.text1, @@ -144,7 +143,6 @@ const styles = stylex.create({ borderRadius: radius.md, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["2xl"], paddingBlock: verticalSpace.sm, textDecoration: "none", @@ -182,7 +180,6 @@ const styles = stylex.create({ /** Each "Depends on" row — full row clickable, plain link semantics. */ dependsRow: { borderRadius: radius.md, - cornerShape: "squircle", gap: gap.lg, paddingBlock: verticalSpace.sm, paddingInline: horizontalSpace.md, diff --git a/src/components/product-listing-form.tsx b/src/components/product-listing-form.tsx index 2c6ade8..3799923 100644 --- a/src/components/product-listing-form.tsx +++ b/src/components/product-listing-form.tsx @@ -327,7 +327,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", overflow: "hidden", aspectRatio: "16 / 9", backgroundColor: uiColor.overlayBackdrop, @@ -339,7 +338,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", overflow: "hidden", backgroundColor: uiColor.overlayBackdrop, objectFit: "cover", @@ -393,7 +391,6 @@ const styles = stylex.create({ borderRadius: radius.lg, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap.sm, overflow: "hidden", backgroundColor: uiColor.bg, @@ -419,7 +416,6 @@ const styles = stylex.create({ }, }, screenshotPreviewImage: { - cornerShape: "squircle", overflow: "hidden", backgroundColor: uiColor.overlayBackdrop, display: "block", @@ -488,7 +484,6 @@ const styles = stylex.create({ borderRadius: radius.md, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", boxShadow: shadow.md, display: "block", objectFit: "cover", @@ -500,7 +495,6 @@ const styles = stylex.create({ borderRadius: radius.md, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", backgroundColor: uiColor.bgSubtle, boxSizing: "border-box", height: size["5xl"], diff --git a/src/design-system/alert/index.tsx b/src/design-system/alert/index.tsx index a3bde2f..3540da1 100644 --- a/src/design-system/alert/index.tsx +++ b/src/design-system/alert/index.tsx @@ -43,7 +43,6 @@ const styles = stylex.create({ borderRadius: radius.lg, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["lg"], gridTemplateAreas: { default: "'icon content'", diff --git a/src/design-system/aspect-ratio/index.tsx b/src/design-system/aspect-ratio/index.tsx index 2b05a1b..a477823 100644 --- a/src/design-system/aspect-ratio/index.tsx +++ b/src/design-system/aspect-ratio/index.tsx @@ -13,7 +13,6 @@ const styles = stylex.create({ position: "relative", }, rounded: { - cornerShape: "squircle", borderBottomLeftRadius: radius.lg, borderBottomRightRadius: radius.lg, borderTopLeftRadius: radius.lg, diff --git a/src/design-system/avatar/index.tsx b/src/design-system/avatar/index.tsx index ca363d5..e5646da 100644 --- a/src/design-system/avatar/index.tsx +++ b/src/design-system/avatar/index.tsx @@ -34,8 +34,6 @@ const styles = stylex.create({ display: "flex", justifyContent: "center", position: "relative", - - cornerShape: "squircle", }, wrapperSm: { borderRadius: { diff --git a/src/design-system/card/index.tsx b/src/design-system/card/index.tsx index a6f0ed5..d06c9da 100644 --- a/src/design-system/card/index.tsx +++ b/src/design-system/card/index.tsx @@ -28,7 +28,6 @@ const styles = stylex.create({ borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", overflow: "hidden", boxShadow: shadow["sm"], display: "flex", diff --git a/src/design-system/checkbox/index.tsx b/src/design-system/checkbox/index.tsx index 0d41244..65cd9e5 100644 --- a/src/design-system/checkbox/index.tsx +++ b/src/design-system/checkbox/index.tsx @@ -45,7 +45,6 @@ const styles = stylex.create({ borderRadius: radius.sm, borderWidth: 2, - cornerShape: "squircle", height: sizeSpace["md"], width: sizeSpace["md"], }, diff --git a/src/design-system/color-area/index.tsx b/src/design-system/color-area/index.tsx index efdebd2..c6b6bb7 100644 --- a/src/design-system/color-area/index.tsx +++ b/src/design-system/color-area/index.tsx @@ -17,7 +17,6 @@ import { size as sizeSpace } from "../theme/semantic-spacing.stylex"; const styles = stylex.create({ colorArea: { borderRadius: radius["md"], - cornerShape: "squircle", filter: { ":is([data-disabled])": "grayscale(1)", }, @@ -29,7 +28,6 @@ const styles = stylex.create({ borderStyle: "solid", borderWidth: 2, - cornerShape: "squircle", boxShadow: " 0 0 0 1px black, inset 0 0 0 1px black", boxSizing: "border-box", filter: { diff --git a/src/design-system/color-slider/index.tsx b/src/design-system/color-slider/index.tsx index af578a7..8779e3e 100644 --- a/src/design-system/color-slider/index.tsx +++ b/src/design-system/color-slider/index.tsx @@ -56,7 +56,6 @@ const styles = stylex.create({ }, track: { borderRadius: radius.full, - cornerShape: "squircle", gridColumnEnd: "track", gridColumnStart: "track", gridRowEnd: "track", diff --git a/src/design-system/color-swatch/index.tsx b/src/design-system/color-swatch/index.tsx index d78303a..dcb5d61 100644 --- a/src/design-system/color-swatch/index.tsx +++ b/src/design-system/color-swatch/index.tsx @@ -18,8 +18,6 @@ const styles = stylex.create({ borderStyle: "solid", borderWidth: 1, boxSizing: "border-box", - - cornerShape: "squircle", }, swatchSm: { borderRadius: radius.xs, diff --git a/src/design-system/disclosure/index.tsx b/src/design-system/disclosure/index.tsx index 4cf03e1..6d9d5b1 100644 --- a/src/design-system/disclosure/index.tsx +++ b/src/design-system/disclosure/index.tsx @@ -52,7 +52,6 @@ const styles = stylex.create({ ":is([data-size=sm] *)": sizeSpace["sm"], }, - cornerShape: "squircle", gap: gap["md"], alignItems: "center", backgroundColor: { diff --git a/src/design-system/file-drop-zone/index.tsx b/src/design-system/file-drop-zone/index.tsx index 65d4221..38d31c8 100644 --- a/src/design-system/file-drop-zone/index.tsx +++ b/src/design-system/file-drop-zone/index.tsx @@ -111,7 +111,6 @@ const styles = stylex.create({ paddingRight: horizontalSpace["2xl"], paddingTop: verticalSpace["2xl"], - cornerShape: "squircle", overflow: "hidden", backgroundColor: { default: uiColor.bgSubtle, diff --git a/src/design-system/image-cropper/index.tsx b/src/design-system/image-cropper/index.tsx index 21e9e51..443607b 100644 --- a/src/design-system/image-cropper/index.tsx +++ b/src/design-system/image-cropper/index.tsx @@ -18,7 +18,6 @@ const styles = stylex.create({ borderRadius: radius.md, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", outline: { default: "none", ":focus-visible": `2px solid ${uiColor.solid1}`, diff --git a/src/design-system/kbd/index.tsx b/src/design-system/kbd/index.tsx index 0df02f6..a8c1219 100644 --- a/src/design-system/kbd/index.tsx +++ b/src/design-system/kbd/index.tsx @@ -18,7 +18,6 @@ const styles = stylex.create({ borderStyle: "solid", borderWidth: "1px", - cornerShape: "squircle", backgroundColor: uiColor.component2, boxShadow: `0 2px 0 1px ${uiColor.border2}`, color: uiColor.text1, diff --git a/src/design-system/menubar/index.tsx b/src/design-system/menubar/index.tsx index 8d7602c..fab86b1 100644 --- a/src/design-system/menubar/index.tsx +++ b/src/design-system/menubar/index.tsx @@ -50,7 +50,6 @@ const styles = stylex.create({ borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["xs"], alignItems: "center", backgroundColor: { diff --git a/src/design-system/page/Page.tsx b/src/design-system/page/Page.tsx index 6066ab8..21ff8a1 100644 --- a/src/design-system/page/Page.tsx +++ b/src/design-system/page/Page.tsx @@ -166,7 +166,6 @@ const sharedStyles = stylex.create({ icon: { borderRadius: radius.lg, // eslint-disable-next-line @stylexjs/sort-keys - cornerShape: "squircle", alignItems: "center", backgroundColor: primaryColor.solid1, boxShadow: shadow["lg"], diff --git a/src/design-system/segmented-control/index.tsx b/src/design-system/segmented-control/index.tsx index 139b0b3..1b9ff53 100644 --- a/src/design-system/segmented-control/index.tsx +++ b/src/design-system/segmented-control/index.tsx @@ -36,7 +36,6 @@ const styles = stylex.create({ paddingRight: horizontalSpace["xxs"], paddingTop: verticalSpace["xxs"], - cornerShape: "squircle", gap: gap["md"], alignItems: "center", backgroundColor: uiColor.component1, @@ -62,7 +61,6 @@ const styles = stylex.create({ textBoxTrim: "trim-both", borderWidth: 0, - cornerShape: "squircle", gap: gap["xs"], alignItems: "center", backgroundColor: "transparent", @@ -97,7 +95,6 @@ const styles = stylex.create({ selectionIndicator: { borderRadius: radius.md, - cornerShape: "squircle", backgroundColor: uiColor.bgSubtle, boxShadow: shadow.sm, position: "absolute", diff --git a/src/design-system/sidebar/index.tsx b/src/design-system/sidebar/index.tsx index 28ff250..8f639c9 100644 --- a/src/design-system/sidebar/index.tsx +++ b/src/design-system/sidebar/index.tsx @@ -85,7 +85,6 @@ const styles = stylex.create({ borderRadius: radius.lg, borderWidth: 0, - cornerShape: "squircle", textDecoration: "none", alignItems: "center", backgroundColor: { diff --git a/src/design-system/skeleton/index.tsx b/src/design-system/skeleton/index.tsx index f57579b..210b641 100644 --- a/src/design-system/skeleton/index.tsx +++ b/src/design-system/skeleton/index.tsx @@ -57,7 +57,6 @@ const styles = stylex.create({ }, rectangle: { borderRadius: radius.xl, - cornerShape: "squircle", }, sizeSm: { height: sizeSpace["3xl"], diff --git a/src/design-system/tabs/index.tsx b/src/design-system/tabs/index.tsx index 916ca48..8d3dfe1 100644 --- a/src/design-system/tabs/index.tsx +++ b/src/design-system/tabs/index.tsx @@ -211,7 +211,6 @@ const styles = stylex.create({ }, focusRing: { borderRadius: radius.md, - cornerShape: "squircle", outline: { default: "none", ":is([data-focus-visible] *)": `2px solid ${uiColor.solid1}`, diff --git a/src/design-system/theme/color.stylex.tsx b/src/design-system/theme/color.stylex.tsx index 5349893..267dfa8 100644 --- a/src/design-system/theme/color.stylex.tsx +++ b/src/design-system/theme/color.stylex.tsx @@ -1,25 +1,26 @@ import * as stylex from "@stylexjs/stylex"; import { green } from "./colors/green.stylex"; -import { mauve, mauveInverted } from "./colors/mauve.stylex"; +import { mauveInverted } from "./colors/mauve.stylex"; +import { paper } from "./colors/paper.stylex"; import { pink } from "./colors/pink.stylex"; import { red } from "./colors/red.stylex"; import { yellow } from "./colors/yellow.stylex"; export const uiColor = stylex.defineVars({ - overlayBackdrop: "light-dark(rgba(4, 1, 1, 0.5), rgba(0, 0, 0, 0.75))", - bg: mauve.bg, - bgSubtle: mauve.bgSubtle, - component1: mauve.component1, - component2: mauve.component2, - component3: mauve.component3, - border1: mauve.border1, - border2: mauve.border2, - border3: mauve.border3, - solid1: mauve.solid1, - solid2: mauve.solid2, - text1: mauve.text1, - text2: mauve.text2, + overlayBackdrop: "light-dark(rgba(25, 24, 22, 0.42), rgba(0, 0, 0, 0.7))", + bg: paper.bg, + bgSubtle: paper.bgSubtle, + component1: paper.component1, + component2: paper.component2, + component3: paper.component3, + border1: paper.border1, + border2: paper.border2, + border3: paper.border3, + solid1: paper.solid1, + solid2: paper.solid2, + text1: paper.text1, + text2: paper.text2, textContrast: "white", }); diff --git a/src/design-system/theme/colors/paper.stylex.tsx b/src/design-system/theme/colors/paper.stylex.tsx new file mode 100644 index 0000000..f2d338b --- /dev/null +++ b/src/design-system/theme/colors/paper.stylex.tsx @@ -0,0 +1,44 @@ +import * as stylex from "@stylexjs/stylex"; + +/** + * Warm neutral scale for the Shelf look: paper-coloured page, near-white + * surfaces, hairline rules and near-black ink. Same step names as the Radix + * scales so it can back `uiColor` directly. + * + * Note the direction: `bg` is the raised surface (cards, header) and + * `bgSubtle` is the page itself, matching how the layout already uses them. + */ +export const paper = stylex.defineVars({ + bg: "light-dark(#fffdf9, #1b1a17)", + bgSubtle: "light-dark(#f6f4ef, #12110f)", + component1: "light-dark(#f0ede6, #211f1c)", + component2: "light-dark(#e9e5dc, #282623)", + component3: "light-dark(#e1dcd1, #312e2a)", + border1: "light-dark(#e7e2d8, #2a2825)", + border2: "light-dark(#d6cfc1, #3a3732)", + border3: "light-dark(#bdb5a5, #504b44)", + solid1: "light-dark(#8d877b, #6f6b62)", + solid2: "light-dark(#7f7a6f, #827d73)", + text1: "light-dark(#6c675d, #9b968b)", + text2: "light-dark(#191816, #f2efe8)", +}); + +/** + * "Ink" accent: solid near-black (near-white in dark mode) used for primary + * buttons, selected states, stars and links. Backs `primaryColor` at the root. + */ +export const ink = stylex.defineVars({ + bg: "light-dark(#fffdf9, #1b1a17)", + bgSubtle: "light-dark(#f6f4ef, #12110f)", + component1: "light-dark(#efece5, #23211e)", + component2: "light-dark(#e6e2d8, #2c2a26)", + component3: "light-dark(#dcd6ca, #36332e)", + border1: "light-dark(#d6cfc1, #3a3732)", + border2: "light-dark(#bdb5a5, #504b44)", + border3: "light-dark(#191816, #f2efe8)", + solid1: "light-dark(#191816, #f2efe8)", + solid2: "light-dark(#33312d, #d9d5cc)", + text1: "light-dark(#46433d, #c8c3b8)", + text2: "light-dark(#191816, #f2efe8)", + textContrast: "light-dark(#fffdf9, #12110f)", +}); diff --git a/src/design-system/theme/radius.stylex.tsx b/src/design-system/theme/radius.stylex.tsx index 01912c5..20386b4 100644 --- a/src/design-system/theme/radius.stylex.tsx +++ b/src/design-system/theme/radius.stylex.tsx @@ -1,39 +1,18 @@ import * as stylex from "@stylexjs/stylex"; -import { mediaQueries } from "./media-queries.stylex"; - +/** + * Shelf radii: plain rounded corners (no squircle-specific bumps) so cards, + * images and inputs look the same in every browser. Buttons and chips use + * `full` for pills. + */ export const radius = stylex.defineVars({ - xs: { - default: "0.3rem", - [mediaQueries.supportsSquircle]: "0.5rem", - }, - sm: { - default: "0.4rem", - [mediaQueries.supportsSquircle]: "0.75rem", - }, - md: { - default: "0.5rem", - [mediaQueries.supportsSquircle]: "1rem", - }, - lg: { - default: "0.75rem", - [mediaQueries.supportsSquircle]: "1.5rem", - }, - xl: { - default: "1.35rem", - [mediaQueries.supportsSquircle]: "2.5rem", - }, - "2xl": { - default: "1.5rem", - [mediaQueries.supportsSquircle]: "3rem", - }, - "3xl": { - default: "1.9rem", - [mediaQueries.supportsSquircle]: "3.5rem", - }, - "4xl": { - default: "2.1rem", - [mediaQueries.supportsSquircle]: "4rem", - }, + xs: "0.375rem", + sm: "0.5rem", + md: "0.75rem", + lg: "1rem", + xl: "1.25rem", + "2xl": "1.5rem", + "3xl": "1.75rem", + "4xl": "2rem", full: "calc(infinity * 1px)", }); diff --git a/src/design-system/theme/shadow.stylex.tsx b/src/design-system/theme/shadow.stylex.tsx index 0d6fd8c..9b31d16 100644 --- a/src/design-system/theme/shadow.stylex.tsx +++ b/src/design-system/theme/shadow.stylex.tsx @@ -1,16 +1,17 @@ import * as stylex from "@stylexjs/stylex"; +/** Warm-tinted shadows (ink at low alpha) that sit well on the paper background. */ export const shadow = stylex.defineVars({ - "2xs": "0 1px rgb(0 0 0 / 0.05)", - xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)", - sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", - md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", - lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)", - xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)", - "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)", + "2xs": "0 1px rgb(25 24 22 / 0.04)", + xs: "0 1px 2px 0 rgb(25 24 22 / 0.05)", + sm: "0 1px 2px rgb(25 24 22 / 0.04), 0 4px 12px -6px rgb(25 24 22 / 0.14)", + md: "0 1px 2px rgb(25 24 22 / 0.04), 0 8px 24px -12px rgb(25 24 22 / 0.2)", + lg: "0 2px 4px rgb(25 24 22 / 0.04), 0 16px 40px -16px rgb(25 24 22 / 0.28)", + xl: "0 20px 50px -12px rgb(25 24 22 / 0.3)", + "2xl": "0 30px 80px -20px rgb(25 24 22 / 0.4)", none: "0 0 #0000", - inset: "inset 0 0 4px 0 rgb(0 0 0 / 0.1)", - insetSm: "inset 0 0 4px 0 rgb(0 0 0 / 0.05)", - insetMd: "inset 0 0 4px 0 rgb(0 0 0 / 0.1)", - insetLg: "inset 0 0 8px 0 rgb(0 0 0 / 0.15)", + inset: "inset 0 0 4px 0 rgb(25 24 22 / 0.1)", + insetSm: "inset 0 0 4px 0 rgb(25 24 22 / 0.05)", + insetMd: "inset 0 0 4px 0 rgb(25 24 22 / 0.1)", + insetLg: "inset 0 0 8px 0 rgb(25 24 22 / 0.15)", }); diff --git a/src/design-system/theme/typography.stylex.tsx b/src/design-system/theme/typography.stylex.tsx index 86e774f..553d8c1 100644 --- a/src/design-system/theme/typography.stylex.tsx +++ b/src/design-system/theme/typography.stylex.tsx @@ -4,10 +4,13 @@ import { breakpoints } from "./media-queries.stylex"; import { verticalSpace } from "./semantic-spacing.stylex"; export const fontFamily = stylex.defineVars({ - title: "'Inter', sans-serif", - sans: "'Inter', sans-serif", + // System stacks: SF Pro on Apple platforms, Segoe/Roboto elsewhere, Inter if + // it happens to be installed. Nothing is downloaded. + title: + '"SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif', + sans: '"SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif', serif: "Georgia, serif", - mono: "Monaco, monospace", + mono: 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, monospace', }); export const fontWeight = stylex.defineVars({ @@ -50,6 +53,9 @@ export const lineHeight = stylex.defineVars({ }); export const tracking = stylex.defineVars({ + /** Display headlines (Shelf). */ + display: "-0.045em", + snug: "-0.03em", tighter: "-0.05em", tight: "-0.025em", normal: "0em", @@ -72,8 +78,8 @@ export const typeramp = stylex.create({ marginBottom: 0, marginLeft: 0, - fontWeight: fontWeight["extrabold"], - letterSpacing: tracking["tight"], + fontWeight: fontWeight["bold"], + letterSpacing: tracking["display"], lineHeight: lineHeight.sm, scrollMarginBlockStart: verticalSpace["12xl"], marginRight: 0, @@ -92,11 +98,10 @@ export const typeramp = stylex.create({ marginBottom: 0, marginLeft: 0, - fontWeight: fontWeight.semibold, - letterSpacing: tracking["tight"], + fontWeight: fontWeight["bold"], + letterSpacing: tracking["display"], lineHeight: lineHeight.sm, scrollMarginBlockStart: verticalSpace["12xl"], - borderBottomWidth: 1, marginRight: 0, marginTop: 0, }, @@ -110,8 +115,8 @@ export const typeramp = stylex.create({ marginBottom: 0, marginLeft: 0, - fontWeight: fontWeight["semibold"], - letterSpacing: tracking["tight"], + fontWeight: fontWeight["bold"], + letterSpacing: tracking["snug"], lineHeight: lineHeight.sm, scrollMarginBlockStart: verticalSpace["12xl"], marginRight: 0, diff --git a/src/design-system/theme/useButtonStyles.ts b/src/design-system/theme/useButtonStyles.ts index a4a2913..0876ad1 100644 --- a/src/design-system/theme/useButtonStyles.ts +++ b/src/design-system/theme/useButtonStyles.ts @@ -8,15 +8,16 @@ import type { ButtonVariant, Size } from "../theme/types"; import { ButtonGroupContext } from "../button/context"; import { SizeContext } from "../context"; import { animationDuration } from "./animations.stylex"; -import { uiColor } from "./color.stylex"; +import { primaryColor, uiColor } from "./color.stylex"; import { radius } from "./radius.stylex"; -import { critical, primary, ui } from "./semantic-color.stylex"; +import { critical, ui } from "./semantic-color.stylex"; import { gap, horizontalSpace, size as sizeSpace, } from "./semantic-spacing.stylex"; import { shadow } from "./shadow.stylex"; +import { spacing } from "./spacing.stylex"; import { fontFamily, fontSize, fontWeight } from "./typography.stylex"; const styles = stylex.create({ @@ -29,19 +30,19 @@ const styles = stylex.create({ textBoxTrim: "trim-both", textDecoration: "none", - borderRadius: radius.md, + borderRadius: radius.full, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["xs"], alignItems: "center", boxSizing: "border-box", display: "inline-flex", flexShrink: 0, fontFamily: fontFamily["sans"], - fontWeight: fontWeight["medium"], + fontWeight: fontWeight["semibold"], justifyContent: "center", + letterSpacing: "-0.005em", opacity: { ":disabled": 0.5, }, @@ -49,10 +50,15 @@ const styles = stylex.create({ ":disabled": "none", }, transitionDuration: animationDuration.fast, - transitionProperty: "background-color, color", + transitionProperty: + "background-color, border-color, color, opacity, transform", transitionTimingFunction: "ease-in-out", userSelect: "none", whiteSpace: "nowrap", + transform: { + default: null, + ":is([data-pressed])": "scale(0.98)", + }, ":is(*) svg": { flexShrink: 0, @@ -62,8 +68,8 @@ const styles = stylex.create({ }, }, small: { - fontSize: fontSize["xs"], - height: sizeSpace["2xl"], + fontSize: fontSize["sm"], + height: sizeSpace["3xl"], paddingLeft: { default: horizontalSpace["md"], }, @@ -79,7 +85,7 @@ const styles = stylex.create({ medium: { gap: gap["sm"], fontSize: fontSize["sm"], - height: sizeSpace["3xl"], + height: spacing["9"], paddingLeft: { default: horizontalSpace["xl"], ":has(svg+*)": horizontalSpace["md"], @@ -88,7 +94,7 @@ const styles = stylex.create({ }, large: { gap: gap["md"], - fontSize: fontSize["sm"], + fontSize: "0.9375rem", height: sizeSpace["4xl"], paddingLeft: { default: horizontalSpace["3xl"], @@ -106,11 +112,23 @@ const styles = stylex.create({ }, paddingRight: horizontalSpace["4xl"], }, + // Shelf: primary is a solid ink pill; secondary is a surface pill with a + // hairline that darkens to ink on hover. + primarySolid: { + backgroundColor: { + default: primaryColor.solid1, + ":is([data-hovered])": primaryColor.solid2, + ":disabled": primaryColor.solid1, + }, + borderColor: primaryColor.solid1, + color: primaryColor.textContrast, + }, secondary: { + backgroundColor: uiColor.bg, borderColor: { - default: uiColor.border1, - ":is([data-hovered])": uiColor.border2, - ":is([data-pressed])": uiColor.border3, + default: uiColor.border2, + ":is([data-hovered])": uiColor.text2, + ":is([data-pressed])": uiColor.text2, }, }, tertiary: { @@ -166,14 +184,8 @@ export const useButtonStyles = ({ group?.orientation === "vertical" && group.variant === "grouped" && styles.groupVertical, - variant === "primary" && [ - primary.bgAction, - primary.borderInteractive, - primary.text, - styles.shadow, - ], + variant === "primary" && styles.primarySolid, variant === "secondary" && [ - ui.bgUi, styles.secondary, ui.text, group?.orientation === "horizontal" && diff --git a/src/design-system/theme/useCalendarStyles.ts b/src/design-system/theme/useCalendarStyles.ts index 98dc1c6..dcc86e3 100644 --- a/src/design-system/theme/useCalendarStyles.ts +++ b/src/design-system/theme/useCalendarStyles.ts @@ -29,7 +29,6 @@ export interface CalendarProps const styles = stylex.create({ cell: { borderRadius: radius.md, - cornerShape: "squircle", textDecoration: { ":is([data-unavailable])": "line-through", }, diff --git a/src/design-system/theme/useDialogStyles.ts b/src/design-system/theme/useDialogStyles.ts index c3a0f64..770fa3b 100644 --- a/src/design-system/theme/useDialogStyles.ts +++ b/src/design-system/theme/useDialogStyles.ts @@ -40,7 +40,6 @@ const styles = stylex.create({ }, modal: { borderRadius: radius.xl, - cornerShape: "squircle", outline: "none", overflow: "hidden", boxShadow: shadow["lg"], diff --git a/src/design-system/theme/useInputStyles.ts b/src/design-system/theme/useInputStyles.ts index ef4a65f..aa0add9 100644 --- a/src/design-system/theme/useInputStyles.ts +++ b/src/design-system/theme/useInputStyles.ts @@ -16,7 +16,6 @@ import { uiColor, warningColor, } from "./color.stylex"; -import { blue } from "./colors/blue.stylex"; import { radius } from "./radius.stylex"; import { ui } from "./semantic-color.stylex"; import { @@ -93,7 +92,6 @@ const styles = stylex.create({ paddingRight: 0, paddingTop: 0, - cornerShape: "squircle", outline: "none", overflow: "hidden", boxSizing: "border-box", @@ -124,7 +122,7 @@ const styles = stylex.create({ borderColor: { default: uiColor.border1, ":is([data-focus-visible],:has([data-focused][data-focus-always-visible]))": - blue.border3, + uiColor.text2, ":is([data-hovered]:not(:has(:is([data-invalid]))))": uiColor.border2, }, borderStyle: "solid", @@ -192,7 +190,7 @@ const styles = stylex.create({ borderColor: { default: uiColor.border1, ":is([data-focus-visible],:has([data-focused][data-focus-always-visible]))": - blue.border3, + uiColor.text2, ":is([data-hovered]:not(:has(:is([data-invalid]))))": uiColor.border2, }, borderStyle: "solid", @@ -250,7 +248,7 @@ const styles = stylex.create({ borderColor: { default: "transparent", ":is([data-focus-visible],:has([data-focused][data-focus-always-visible]))": - blue.border3, + uiColor.text2, ":is([data-hovered]:not(:has(* [data-hovered])),:has(input[data-hovered])):not(:disabled)": uiColor.component2, ":is([data-pressed=true]):not(:disabled)": uiColor.component3, diff --git a/src/design-system/theme/useListBoxItemStyles.ts b/src/design-system/theme/useListBoxItemStyles.ts index 03acaea..2c72891 100644 --- a/src/design-system/theme/useListBoxItemStyles.ts +++ b/src/design-system/theme/useListBoxItemStyles.ts @@ -45,7 +45,6 @@ const styles = stylex.create({ lg: { minHeight: sizeSpace["5xl"] }, itemInner: { borderRadius: radius.md, - cornerShape: "squircle", gap: gap["xl"], alignItems: "center", backgroundColor: { diff --git a/src/design-system/theme/usePopoverStyles.ts b/src/design-system/theme/usePopoverStyles.ts index 1bce86c..3aedd2a 100644 --- a/src/design-system/theme/usePopoverStyles.ts +++ b/src/design-system/theme/usePopoverStyles.ts @@ -12,7 +12,6 @@ import { shadow } from "./shadow.stylex"; const styles = stylex.create({ popover: { borderRadius: radius.lg, - cornerShape: "squircle", outline: "none", overflow: "auto", boxShadow: shadow["md"], diff --git a/src/design-system/tooltip/index.tsx b/src/design-system/tooltip/index.tsx index b535dca..65a35df 100644 --- a/src/design-system/tooltip/index.tsx +++ b/src/design-system/tooltip/index.tsx @@ -25,7 +25,6 @@ import { fontFamily, fontSize, lineHeight } from "../theme/typography.stylex"; const tooltipStyle = stylex.create({ content: { borderRadius: radius.md, - cornerShape: "squircle", backgroundColor: uiInverted.bg, boxShadow: shadow["sm"], color: uiInverted.text1, diff --git a/src/design-system/tree/index.tsx b/src/design-system/tree/index.tsx index 66e8e2f..12b1ffa 100644 --- a/src/design-system/tree/index.tsx +++ b/src/design-system/tree/index.tsx @@ -106,7 +106,6 @@ const styles = stylex.create({ }, dragButton: { borderRadius: radius.sm, - cornerShape: "squircle", alignItems: "center", display: "flex", justifyContent: "center", diff --git a/src/design-system/typography/index.tsx b/src/design-system/typography/index.tsx index a6f02cc..69f445b 100644 --- a/src/design-system/typography/index.tsx +++ b/src/design-system/typography/index.tsx @@ -38,7 +38,6 @@ const styles = stylex.create({ borderRadius: radius.lg, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", display: "flex", position: "relative", marginBottom: verticalSpace["7xl"], @@ -104,7 +103,6 @@ const styles = stylex.create({ }, inlineCode: { borderRadius: radius.sm, - cornerShape: "squircle", fontSize: "0.95em", position: "relative", paddingBottom: verticalSpace["xs"], diff --git a/src/design-system/video/index.tsx b/src/design-system/video/index.tsx index 5194687..d97e8f7 100644 --- a/src/design-system/video/index.tsx +++ b/src/design-system/video/index.tsx @@ -57,7 +57,6 @@ const styles = stylex.create({ borderColor: uiColor.border1, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", overflow: "hidden", backgroundColor: "inherit", position: "relative", diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 54b0af5..616b2d6 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -19,7 +19,7 @@ import { useLayoutEffect } from "react"; import type { Locale } from "../lib/locale"; import { primaryColor } from "../design-system/theme/color.stylex"; -import { blue } from "../design-system/theme/colors/blue.stylex"; +import { ink } from "../design-system/theme/colors/paper.stylex"; import { initI18n } from "../i18n"; import { user } from "../integrations/tanstack-query/api-user.functions"; import TanStackQueryDevtools from "../integrations/tanstack-query/devtools"; @@ -53,20 +53,22 @@ const detectLocale = createServerFn({ method: "GET" }).handler( */ const MIGRATED_TOP_LEVEL_PATHS: ReadonlySet = new Set(["/about"]); +// Shelf: the primary colour is ink (near-black, near-white in dark mode) — +// solid primary buttons, selected states, stars and links all read as ink. const primaryColorTheme = stylex.createTheme(primaryColor, { - bg: blue.bg, - bgSubtle: blue.bgSubtle, - component1: blue.component1, - component2: blue.component2, - component3: blue.component3, - border1: blue.border1, - border2: blue.border2, - border3: blue.border3, - solid1: blue.solid1, - solid2: blue.solid2, - text1: blue.text1, - text2: blue.text2, - textContrast: "white", + bg: ink.bg, + bgSubtle: ink.bgSubtle, + component1: ink.component1, + component2: ink.component2, + component3: ink.component3, + border1: ink.border1, + border2: ink.border2, + border3: ink.border3, + solid1: ink.solid1, + solid2: ink.solid2, + text1: ink.text1, + text2: ink.text2, + textContrast: ink.textContrast, }); if (import.meta.env.DEV) { @@ -93,18 +95,13 @@ html[data-theme="system"] { color-scheme: light; } `.trim(); /** - * Inherited outline color for focused elements (matches `blue.border3`). + * Inherited outline color for focused elements: the Shelf accent blue. * Defined as global CSS so we do not use legacy contextual selectors under * `stylex.create()` (disallowed by @stylexjs/valid-styles). */ const GLOBAL_FOCUS_OUTLINE_CSS = ` :is(*) * { - outline-color: light-dark(#5eb1ef, #2870bd); -} -@media (color-gamut: p3) { - :is(*) * { - outline-color: light-dark(color(display-p3 0.451 0.688 0.917), color(display-p3 0.239 0.434 0.72)); - } + outline-color: light-dark(#1c4ef5, #7b97ff); } `.trim(); diff --git a/src/routes/_header-layout.index.tsx b/src/routes/_header-layout.index.tsx index 53cb943..3c6c274 100644 --- a/src/routes/_header-layout.index.tsx +++ b/src/routes/_header-layout.index.tsx @@ -128,7 +128,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", listStyle: "none", backgroundColor: uiColor.bg, paddingBottom: verticalSpace.lg, diff --git a/src/routes/_header-layout.notifications.tsx b/src/routes/_header-layout.notifications.tsx index 5d89910..bdcfb34 100644 --- a/src/routes/_header-layout.notifications.tsx +++ b/src/routes/_header-layout.notifications.tsx @@ -52,7 +52,6 @@ const styles = stylex.create({ borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap["2xl"], alignItems: "flex-start", backgroundColor: uiColor.bg, diff --git a/src/routes/_header-layout.products.$productId.index.tsx b/src/routes/_header-layout.products.$productId.index.tsx index 8918bd3..f3272d2 100644 --- a/src/routes/_header-layout.products.$productId.index.tsx +++ b/src/routes/_header-layout.products.$productId.index.tsx @@ -212,7 +212,6 @@ const styles = stylex.create({ borderRadius: radius["xl"], borderStyle: "dashed", borderWidth: 1, - cornerShape: "squircle", paddingBottom: verticalSpace["8xl"], paddingTop: verticalSpace["8xl"], }, diff --git a/src/routes/_header-layout.profile.$actor.tsx b/src/routes/_header-layout.profile.$actor.tsx index b5fdb62..ac1c1b3 100644 --- a/src/routes/_header-layout.profile.$actor.tsx +++ b/src/routes/_header-layout.profile.$actor.tsx @@ -83,7 +83,6 @@ const styles = stylex.create({ borderRadius: radius["lg"], borderStyle: "solid", borderWidth: 1, - cornerShape: "squircle", gap: gap.lg, textDecoration: "none", alignItems: "center", @@ -110,7 +109,6 @@ const styles = stylex.create({ borderRadius: radius["xl"], borderStyle: "dashed", borderWidth: 1, - cornerShape: "squircle", paddingBottom: verticalSpace["6xl"], paddingLeft: horizontalSpace["xl"], paddingRight: horizontalSpace["xl"], diff --git a/src/routes/login.tsx b/src/routes/login.tsx index 6b6778c..33d9e6c 100644 --- a/src/routes/login.tsx +++ b/src/routes/login.tsx @@ -95,7 +95,6 @@ const styles = stylex.create({ savedHandleButton: { padding: sizeSpace.xxs, borderRadius: radius["lg"], - cornerShape: "squircle", gap: gapSpace.xl, textDecoration: "none", alignItems: "center", diff --git a/src/styles.css b/src/styles.css index 293d3b1..af287d4 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,3 +1,13 @@ body { margin: 0; + /* Shelf paper; matches uiColor.bgSubtle so overscroll never flashes white. */ + background-color: light-dark(#f6f4ef, #12110f); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-rendering: optimizeLegibility; +} + +::selection { + background-color: light-dark(#1c4ef5, #7b97ff); + color: light-dark(#fff, #12110f); } From f44dcdb4a4c8e885fd9363c93f89b7c9cd7fb273 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:13:43 -0800 Subject: [PATCH 02/18] Sort StyleX keys in button styles Co-Authored-By: Claude Opus 5.5 --- src/design-system/theme/useButtonStyles.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/design-system/theme/useButtonStyles.ts b/src/design-system/theme/useButtonStyles.ts index 0876ad1..aa5f3c7 100644 --- a/src/design-system/theme/useButtonStyles.ts +++ b/src/design-system/theme/useButtonStyles.ts @@ -49,16 +49,16 @@ const styles = stylex.create({ pointerEvents: { ":disabled": "none", }, + transform: { + default: null, + ":is([data-pressed])": "scale(0.98)", + }, transitionDuration: animationDuration.fast, transitionProperty: "background-color, border-color, color, opacity, transform", transitionTimingFunction: "ease-in-out", userSelect: "none", whiteSpace: "nowrap", - transform: { - default: null, - ":is([data-pressed])": "scale(0.98)", - }, ":is(*) svg": { flexShrink: 0, @@ -115,21 +115,21 @@ const styles = stylex.create({ // Shelf: primary is a solid ink pill; secondary is a surface pill with a // hairline that darkens to ink on hover. primarySolid: { + borderColor: primaryColor.solid1, backgroundColor: { default: primaryColor.solid1, ":is([data-hovered])": primaryColor.solid2, ":disabled": primaryColor.solid1, }, - borderColor: primaryColor.solid1, color: primaryColor.textContrast, }, secondary: { - backgroundColor: uiColor.bg, borderColor: { default: uiColor.border2, ":is([data-hovered])": uiColor.text2, ":is([data-pressed])": uiColor.text2, }, + backgroundColor: uiColor.bg, }, tertiary: { borderColor: { From a729c9c4b9f76724705d2d30dbb5cc8c37f86df7 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:16:18 -0800 Subject: [PATCH 03/18] Add shared Shelf listing components ListingIcon (hairline ring, initial fallback when the icon 404s), ListingRating (average only from 3+ reviews), ListingRow, ListingCard, GameCoverCard, IconStack, and section/page-hero building blocks. Co-Authored-By: Claude Opus 5.5 --- src/components/shelf/GameCoverCard.tsx | 127 +++++++++++++ src/components/shelf/IconStack.tsx | 41 +++++ src/components/shelf/ListingCard.tsx | 136 ++++++++++++++ src/components/shelf/ListingIcon.tsx | 95 ++++++++++ src/components/shelf/ListingRating.tsx | 74 ++++++++ src/components/shelf/ListingRow.tsx | 240 +++++++++++++++++++++++++ src/components/shelf/Section.tsx | 230 ++++++++++++++++++++++++ src/components/shelf/format.ts | 20 +++ 8 files changed, 963 insertions(+) create mode 100644 src/components/shelf/GameCoverCard.tsx create mode 100644 src/components/shelf/IconStack.tsx create mode 100644 src/components/shelf/ListingCard.tsx create mode 100644 src/components/shelf/ListingIcon.tsx create mode 100644 src/components/shelf/ListingRating.tsx create mode 100644 src/components/shelf/ListingRow.tsx create mode 100644 src/components/shelf/Section.tsx create mode 100644 src/components/shelf/format.ts diff --git a/src/components/shelf/GameCoverCard.tsx b/src/components/shelf/GameCoverCard.tsx new file mode 100644 index 0000000..774bd0f --- /dev/null +++ b/src/components/shelf/GameCoverCard.tsx @@ -0,0 +1,127 @@ +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { useState } from "react"; + +import { animationDuration } from "../../design-system/theme/animations.stylex"; +import { uiColor } from "../../design-system/theme/color.stylex"; +import { shadow } from "../../design-system/theme/shadow.stylex"; +import { fontWeight } from "../../design-system/theme/typography.stylex"; +import { getDirectoryListingSlug } from "../../lib/directory-listing-slugs"; +import { ListingIcon } from "./ListingIcon"; + +const styles = stylex.create({ + card: { + textDecoration: "none", + color: "inherit", + display: "block", + outlineColor: uiColor.text2, + outlineOffset: 4, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + minWidth: 0, + }, + cover: { + borderRadius: 16, + overflow: "hidden", + placeItems: "center", + aspectRatio: "16 / 9", + backgroundColor: uiColor.component1, + boxShadow: { + default: shadow.none, + [stylex.when.ancestor(":hover")]: shadow.md, + }, + display: "grid", + position: "relative", + transitionDuration: animationDuration.slow, + transitionProperty: "box-shadow", + "::after": { + inset: 0, + borderRadius: "inherit", + boxShadow: `inset 0 0 0 1px ${uiColor.border1}`, + content: "''", + pointerEvents: "none", + position: "absolute", + }, + }, + noCover: { + backgroundImage: `radial-gradient(circle at 50% 40%, ${uiColor.bg}, ${uiColor.component1})`, + }, + image: { + display: "block", + objectFit: "cover", + height: "100%", + width: "100%", + }, + row: { + alignItems: "center", + columnGap: 12, + display: "flex", + rowGap: 12, + marginTop: 14, + }, + text: { + minWidth: 0, + }, + name: { + overflow: "hidden", + color: uiColor.text2, + fontSize: 15, + fontWeight: fontWeight.semibold, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + tagline: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + marginTop: 1, + }, +}); + +/** A game (or any listing with a 16:9 cover) as cover art plus a name line. */ +export function GameCoverCard({ + listing, +}: { + listing: { + name: string; + slug?: string | null; + iconUrl: string | null; + heroImageUrl: string | null; + tagline: string; + }; +}) { + const [coverFailed, setCoverFailed] = useState(false); + const hasCover = Boolean(listing.heroImageUrl) && !coverFailed; + + return ( + +
+ {hasCover ? ( + setCoverFailed(true)} + {...stylex.props(styles.image)} + /> + ) : ( + + )} +
+
+ +
+
{listing.name}
+
{listing.tagline}
+
+
+
+ ); +} diff --git a/src/components/shelf/IconStack.tsx b/src/components/shelf/IconStack.tsx new file mode 100644 index 0000000..e40ae2d --- /dev/null +++ b/src/components/shelf/IconStack.tsx @@ -0,0 +1,41 @@ +import * as stylex from "@stylexjs/stylex"; + +import { uiColor } from "../../design-system/theme/color.stylex"; +import { ListingIcon } from "./ListingIcon"; + +const styles = stylex.create({ + stack: { + display: "inline-flex", + flexShrink: 0, + }, + item: { + boxShadow: `0 0 0 2px ${uiColor.bgSubtle}`, + marginLeft: { default: -6, ":first-child": 0 }, + }, +}); + +/** Up to four overlapping app icons, e.g. "apps that use this data". */ +export function IconStack({ + listings, + size = 24, + max = 4, +}: { + listings: Array<{ name: string; iconUrl: string | null }>; + size?: number; + max?: number; +}) { + if (listings.length === 0) return null; + return ( + + {listings.slice(0, max).map((listing) => ( + + ))} + + ); +} diff --git a/src/components/shelf/ListingCard.tsx b/src/components/shelf/ListingCard.tsx new file mode 100644 index 0000000..e60068a --- /dev/null +++ b/src/components/shelf/ListingCard.tsx @@ -0,0 +1,136 @@ +import type { ReactNode } from "react"; + +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; + +import { animationDuration } from "../../design-system/theme/animations.stylex"; +import { uiColor } from "../../design-system/theme/color.stylex"; +import { shadow } from "../../design-system/theme/shadow.stylex"; +import { fontWeight } from "../../design-system/theme/typography.stylex"; +import { formatAppTagLabel } from "../../lib/app-tag-metadata"; +import { getDirectoryListingSlug } from "../../lib/directory-listing-slugs"; +import { ListingIcon } from "./ListingIcon"; +import { ListingRating } from "./ListingRating"; + +const styles = stylex.create({ + card: { + padding: 20, + borderColor: { + default: uiColor.border1, + ":hover": uiColor.border2, + }, + borderRadius: 20, + borderStyle: "solid", + borderWidth: 1, + textDecoration: "none", + backgroundColor: uiColor.bg, + boxShadow: { default: shadow.none, ":hover": shadow.md }, + color: "inherit", + columnGap: 16, + display: "flex", + flexDirection: "column", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + rowGap: 16, + transform: { default: null, ":hover": "translateY(-2px)" }, + transitionDuration: animationDuration.slow, + transitionProperty: "border-color, box-shadow, transform", + minWidth: 0, + }, + name: { + overflow: "hidden", + color: uiColor.text2, + fontSize: 16, + fontWeight: fontWeight.semibold, + letterSpacing: "-0.01em", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + tagline: { + overflow: "hidden", + WebkitBoxOrient: "vertical", + WebkitLineClamp: 2, + color: uiColor.text1, + display: "-webkit-box", + fontSize: 14, + lineHeight: 1.45, + marginTop: 4, + }, + foot: { + alignItems: "center", + color: uiColor.text1, + columnGap: 8, + display: "flex", + fontSize: 13, + justifyContent: "space-between", + rowGap: 8, + marginTop: "auto", + }, + tag: { + borderRadius: 999, + overflow: "hidden", + paddingBlock: 2, + paddingInline: 8, + backgroundColor: uiColor.component1, + color: uiColor.text2, + fontSize: 12, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, +}); + +export type CardListing = { + name: string; + slug?: string | null; + iconUrl: string | null; + tagline: string; + rating: number | string | null; + reviewCount: number; + appTags?: Array; + listingType?: string | null; +}; + +/** + * Text-first listing card: icon, name, two-line tagline, and a footer with the + * rating (or a custom `meta`, e.g. "Added today") and the first tag. + */ +export function ListingCard({ + listing, + meta, +}: { + listing: CardListing; + /** Replaces the rating in the footer. */ + meta?: ReactNode; +}) { + const tag = + listing.listingType === "game" + ? "Game" + : listing.appTags?.[0] + ? formatAppTagLabel(listing.appTags[0]) + : null; + + return ( + + +
+
{listing.name}
+
{listing.tagline}
+
+
+ {meta ?? ( + + )} + {tag ? {tag} : null} +
+
+ ); +} diff --git a/src/components/shelf/ListingIcon.tsx b/src/components/shelf/ListingIcon.tsx new file mode 100644 index 0000000..a36b0dc --- /dev/null +++ b/src/components/shelf/ListingIcon.tsx @@ -0,0 +1,95 @@ +import * as stylex from "@stylexjs/stylex"; +import { useState } from "react"; + +import { uiColor } from "../../design-system/theme/color.stylex"; +import { + fontFamily, + fontWeight, +} from "../../design-system/theme/typography.stylex"; + +const styles = stylex.create({ + root: { + overflow: "hidden", + placeItems: "center", + backgroundColor: uiColor.bg, + display: "inline-grid", + flexShrink: 0, + position: "relative", + // A hairline ring drawn over the image so white-edged icons don't melt + // into the paper background. + "::after": { + inset: 0, + borderRadius: "inherit", + boxShadow: `inset 0 0 0 1px ${uiColor.border1}`, + content: "''", + pointerEvents: "none", + position: "absolute", + }, + }, + image: { + display: "block", + objectFit: "cover", + height: "100%", + width: "100%", + }, + fallback: { + backgroundImage: "linear-gradient(160deg, #8b929c, #5d636c)", + color: "white", + fontFamily: fontFamily.title, + fontWeight: fontWeight.bold, + letterSpacing: "-0.02em", + }, + size: (size: number) => ({ + borderRadius: `${Math.round(size / 4.2)}px`, + fontSize: `${Math.round(size / 2.3)}px`, + height: `${size}px`, + width: `${size}px`, + }), +}); + +/** + * A listing's app icon at a fixed pixel size. Falls back to the name's first + * letter when there is no icon or the image fails to load (about 8% of icon + * URLs 404 on the Bluesky CDN). + */ +export function ListingIcon({ + name, + src, + size, + style, +}: { + name: string; + src: string | null | undefined; + size: number; + style?: stylex.StyleXStyles; +}) { + const [failed, setFailed] = useState(false); + const showImage = Boolean(src) && !failed; + + return ( + + {showImage ? ( + setFailed(true)} + {...stylex.props(styles.image)} + /> + ) : ( + name.trim().slice(0, 1).toUpperCase() + )} + + ); +} diff --git a/src/components/shelf/ListingRating.tsx b/src/components/shelf/ListingRating.tsx new file mode 100644 index 0000000..6a58d3c --- /dev/null +++ b/src/components/shelf/ListingRating.tsx @@ -0,0 +1,74 @@ +import * as stylex from "@stylexjs/stylex"; +import { Star } from "lucide-react"; + +import { uiColor } from "../../design-system/theme/color.stylex"; +import { MIN_REVIEWS_FOR_AVERAGE, formatReviewCount } from "./format"; + +const styles = stylex.create({ + rate: { + alignItems: "center", + color: uiColor.text2, + columnGap: "0.25em", + display: "inline-flex", + fontVariantNumeric: "tabular-nums", + rowGap: "0.25em", + whiteSpace: "nowrap", + }, + count: { + color: uiColor.text1, + }, + muted: { + color: uiColor.text1, + whiteSpace: "nowrap", + }, + star: { + fill: "currentColor", + flexShrink: 0, + }, +}); + +/** + * Compact rating for rows and cards: "★ 4.8 (37)" once a listing has enough + * reviews for an average to mean something, "1 review" below that, and + * nothing (or `emptyLabel`) when there are none, so lists never show rows of + * empty stars. + */ +export function ListingRating({ + rating, + reviewCount, + showCount = false, + emptyLabel, + style, +}: { + rating: number | string | null | undefined; + reviewCount: number; + showCount?: boolean; + emptyLabel?: string; + style?: stylex.StyleXStyles; +}) { + if (!reviewCount) { + return emptyLabel ? ( + {emptyLabel} + ) : null; + } + if (reviewCount < MIN_REVIEWS_FOR_AVERAGE || rating == null) { + return ( + + {formatReviewCount(reviewCount)} + + ); + } + const value = Number(rating).toFixed(1); + return ( + + + {value} + {showCount ? ( + ({reviewCount}) + ) : null} + + ); +} diff --git a/src/components/shelf/ListingRow.tsx b/src/components/shelf/ListingRow.tsx new file mode 100644 index 0000000..342ef55 --- /dev/null +++ b/src/components/shelf/ListingRow.tsx @@ -0,0 +1,240 @@ +import type { ReactNode } from "react"; + +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ChevronRight } from "lucide-react"; + +import { animationDuration } from "../../design-system/theme/animations.stylex"; +import { uiColor } from "../../design-system/theme/color.stylex"; +import { breakpoints } from "../../design-system/theme/media-queries.stylex"; +import { + fontFamily, + fontWeight, +} from "../../design-system/theme/typography.stylex"; +import { getDirectoryListingSlug } from "../../lib/directory-listing-slugs"; +import { getListingLabels } from "../../lib/listing-labels"; +import { formatTimeAgo } from "./format"; +import { ListingIcon } from "./ListingIcon"; +import { ListingRating } from "./ListingRating"; + +export type RowListing = { + name: string; + slug?: string | null; + iconUrl: string | null; + tagline: string; + rating: number | string | null; + reviewCount: number; + productAccountHandle?: string | null; + categorySlugs?: Array; + appTags?: Array; + updatedAt?: string; +}; + +const styles = stylex.create({ + row: { + borderRadius: 12, + marginInline: -12, + paddingBlock: 14, + paddingInline: 12, + textDecoration: "none", + alignItems: "center", + backgroundColor: { + default: "transparent", + ":hover": uiColor.component1, + }, + color: "inherit", + columnGap: 16, + display: "grid", + gridTemplateColumns: "auto minmax(0, 1fr) auto 18px", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + position: "relative", + transitionDuration: animationDuration.default, + transitionProperty: "background-color", + // Hairline between rows, inset to the content so hover can bleed past it. + "::before": { + insetInline: 12, + backgroundColor: uiColor.border1, + content: "''", + position: "absolute", + height: 1, + top: 0, + }, + }, + ranked: { + gridTemplateColumns: "28px auto minmax(0, 1fr) auto 18px", + }, + rank: { + color: uiColor.text1, + fontFamily: fontFamily.title, + fontSize: 22, + fontVariantNumeric: "tabular-nums", + fontWeight: fontWeight.semibold, + letterSpacing: "-0.03em", + }, + body: { + columnGap: 3, + display: "flex", + flexDirection: "column", + rowGap: 3, + minWidth: 0, + }, + top: { + alignItems: "baseline", + columnGap: 8, + display: "flex", + rowGap: 8, + minWidth: 0, + }, + name: { + overflow: "hidden", + color: uiColor.text2, + fontSize: 16, + fontWeight: fontWeight.semibold, + letterSpacing: "-0.01em", + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + handle: { + overflow: "hidden", + color: uiColor.text1, + display: { default: "none", [breakpoints.sm]: "block" }, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + tagline: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 14, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + chips: { + columnGap: 6, + display: "flex", + flexWrap: "wrap", + rowGap: 6, + marginTop: 5, + }, + chip: { + borderRadius: 999, + paddingInline: 9, + alignItems: "center", + backgroundColor: uiColor.component1, + color: uiColor.text2, + display: "inline-flex", + fontSize: 12, + whiteSpace: "nowrap", + height: 24, + }, + aside: { + alignItems: "flex-end", + columnGap: 4, + display: { default: "none", [breakpoints.md]: "flex" }, + flexDirection: "column", + fontSize: 13, + rowGap: 4, + }, + muted: { + color: uiColor.text1, + whiteSpace: "nowrap", + }, + chevron: { + color: { + default: uiColor.border3, + [stylex.when.ancestor(":hover")]: uiColor.text2, + }, + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "translateX(2px)", + }, + transitionDuration: animationDuration.default, + transitionProperty: "color, transform", + }, +}); + +/** + * One listing as a list row: icon, name and handle, tagline, optional label + * chips, and rating / last update on the right. The whole row is the link. + * + * Variants: `detailed` (Browse) shows chips and "Updated …"; `compact` is a + * single-line row for side-by-side lists; `rank` adds a leading number. + */ +export function ListingRow({ + listing, + rank, + variant = "detailed", + badge, + byline, +}: { + listing: RowListing; + rank?: number; + variant?: "detailed" | "compact"; + badge?: ReactNode; + /** Replaces the @handle beside the name (e.g. a game's developer). */ + byline?: string | null; +}) { + const detailed = variant === "detailed"; + const handle = listing.productAccountHandle?.replace(/^@/, ""); + const aside = byline ?? (handle ? `@${handle}` : null); + const labels = + detailed && listing.categorySlugs && listing.appTags + ? getListingLabels({ + categorySlugs: listing.categorySlugs, + appTags: listing.appTags, + }).slice(0, 3) + : []; + + return ( + + {rank == null ? null : ( + + {rank} + + )} + + + + {listing.name} + {badge} + {aside ? {aside} : null} + + {listing.tagline} + {labels.length > 0 ? ( + + {labels.map((label) => ( + + {label.label} + + ))} + + ) : null} + + + + {detailed && listing.updatedAt ? ( + + Updated {formatTimeAgo(listing.updatedAt)} + + ) : null} + + + + ); +} diff --git a/src/components/shelf/Section.tsx b/src/components/shelf/Section.tsx new file mode 100644 index 0000000..ba72c70 --- /dev/null +++ b/src/components/shelf/Section.tsx @@ -0,0 +1,230 @@ +import type { LinkComponentProps } from "@tanstack/react-router"; +import type { ReactNode } from "react"; + +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ArrowLeft, ArrowRight } from "lucide-react"; + +import { animationDuration } from "../../design-system/theme/animations.stylex"; +import { uiColor } from "../../design-system/theme/color.stylex"; +import { breakpoints } from "../../design-system/theme/media-queries.stylex"; +import { + fontFamily, + fontWeight, +} from "../../design-system/theme/typography.stylex"; + +const styles = stylex.create({ + section: { + paddingBlock: { default: 44, [breakpoints.md]: 72 }, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + flush: { + borderTopWidth: 0, + paddingTop: 0, + }, + header: { + alignItems: "baseline", + columnGap: 24, + display: "flex", + justifyContent: "space-between", + rowGap: 24, + marginBottom: { default: 18, [breakpoints.md]: 28 }, + }, + title: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: { default: 26, [breakpoints.md]: 34 }, + fontWeight: fontWeight.bold, + letterSpacing: "-0.04em", + lineHeight: 1.1, + }, + description: { + color: uiColor.text1, + lineHeight: 1.5, + marginBottom: 0, + marginTop: 8, + maxWidth: "38em", + }, + link: { + textDecoration: "none", + alignItems: "center", + color: { + default: uiColor.text1, + ":hover": uiColor.text2, + }, + columnGap: 4, + display: "inline-flex", + flexShrink: 0, + fontSize: 15, + rowGap: 4, + transitionDuration: animationDuration.default, + transitionProperty: "color", + whiteSpace: "nowrap", + }, + arrow: { + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "translateX(2px)", + }, + transitionDuration: animationDuration.default, + transitionProperty: "transform", + }, + arrowBack: { + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "translateX(-2px)", + }, + transitionDuration: animationDuration.default, + transitionProperty: "transform", + }, + hero: { + paddingBottom: { default: 24, [breakpoints.md]: 36 }, + paddingTop: { default: 28, [breakpoints.md]: 48 }, + }, + heroRow: { + gap: { default: 20, [breakpoints.md]: 32 }, + alignItems: { default: "flex-start", [breakpoints.md]: "flex-end" }, + display: "flex", + flexDirection: { default: "column", [breakpoints.md]: "row" }, + justifyContent: "space-between", + }, + eyebrow: { + color: uiColor.text1, + fontSize: 12, + fontWeight: fontWeight.semibold, + letterSpacing: "0.12em", + textTransform: "uppercase", + marginBottom: 14, + }, + heroTitle: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: { default: 38, [breakpoints.md]: 56 }, + fontWeight: fontWeight.bold, + letterSpacing: "-0.05em", + lineHeight: 1, + textWrap: "balance", + }, + heroDescription: { + color: uiColor.text1, + fontSize: { default: 16, [breakpoints.md]: 18 }, + lineHeight: 1.5, + textWrap: "pretty", + marginBottom: 0, + marginTop: 16, + maxWidth: "40em", + }, + back: { + marginBottom: 12, + }, +}); + +/** A page band with a hairline on top: the basic rhythm of every Shelf page. */ +export function ShelfSection({ + children, + flush = false, + id, + style, +}: { + children: ReactNode; + /** No top rule or top padding (first section under a hero). */ + flush?: boolean; + id?: string; + style?: stylex.StyleXStyles; +}) { + return ( +
+ {children} +
+ ); +} + +export function SectionHeader({ + title, + description, + action, + headingLevel = 2, +}: { + title: ReactNode; + description?: ReactNode; + action?: ReactNode; + headingLevel?: 2 | 3; +}) { + const Heading = headingLevel === 2 ? "h2" : "h3"; + return ( +
+
+ {title} + {description ? ( +

{description}

+ ) : null} +
+ {action} +
+ ); +} + +/** Quiet "See all →" style link for section headers. */ +export function MoreLink({ + children, + ...props +}: LinkComponentProps & { children: ReactNode }) { + return ( + + {children} + + + ); +} + +export function BackLink({ + children, + ...props +}: LinkComponentProps & { children: ReactNode }) { + return ( + + + {children} + + ); +} + +/** Page heading block: optional back link and eyebrow, big title, lede, and a side slot. */ +export function PageHero({ + eyebrow, + title, + description, + aside, + back, +}: { + eyebrow?: ReactNode; + title: ReactNode; + description?: ReactNode; + aside?: ReactNode; + back?: ReactNode; +}) { + return ( +
+ {back} +
+
+ {eyebrow ? ( +
{eyebrow}
+ ) : null} +

{title}

+ {description ? ( +

{description}

+ ) : null} +
+ {aside} +
+
+ ); +} diff --git a/src/components/shelf/format.ts b/src/components/shelf/format.ts new file mode 100644 index 0000000..911aefe --- /dev/null +++ b/src/components/shelf/format.ts @@ -0,0 +1,20 @@ +/** Below this many reviews an average says more about one person than the app. */ +export const MIN_REVIEWS_FOR_AVERAGE = 3; + +export function formatReviewCount(count: number) { + return `${count} ${count === 1 ? "review" : "reviews"}`; +} + +const relativeTimeFormat = new Intl.RelativeTimeFormat("en", { + numeric: "auto", +}); + +/** "yesterday", "3 days ago", "2 months ago". */ +export function formatTimeAgo(iso: string) { + const days = Math.round((Date.parse(iso) - Date.now()) / 86_400_000); + if (days > -30) return relativeTimeFormat.format(days, "day"); + if (days > -365) { + return relativeTimeFormat.format(Math.round(days / 30), "month"); + } + return relativeTimeFormat.format(Math.round(days / 365), "year"); +} From aae108555a22c0315468cc77682808d2df3ced1d Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:17:54 -0800 Subject: [PATCH 04/18] Restyle site chrome for Shelf Sticky frosted header, quiet nav links that turn ink when current, page padding aligned to the 1280px shell, and a new footer with Apps / Makers / at-store link groups. Co-Authored-By: Claude Opus 5.5 --- src/components/AtStoreLogo.tsx | 2 + src/components/NotificationsBell.tsx | 4 +- src/components/SiteFooter.tsx | 147 ++++++++++++++++------ src/design-system/header-layout/index.tsx | 22 ++-- src/design-system/navbar/Navbar.tsx | 25 ++-- 5 files changed, 145 insertions(+), 55 deletions(-) diff --git a/src/components/AtStoreLogo.tsx b/src/components/AtStoreLogo.tsx index 16061aa..ae52ba0 100644 --- a/src/components/AtStoreLogo.tsx +++ b/src/components/AtStoreLogo.tsx @@ -16,6 +16,8 @@ const styles = stylex.create({ alignItems: "center", columnGap: "0.3em", display: "inline-flex", + fontFamily: fontFamily.title, + letterSpacing: "-0.035em", }, atNavbar: { color: blue.solid1, diff --git a/src/components/NotificationsBell.tsx b/src/components/NotificationsBell.tsx index 8f39e0d..8dd8567 100644 --- a/src/components/NotificationsBell.tsx +++ b/src/components/NotificationsBell.tsx @@ -5,7 +5,7 @@ import { user } from "#/integrations/tanstack-query/api-user.functions.ts"; import { Bell } from "lucide-react"; import { IconButton } from "../design-system/icon-button"; -import { criticalColor } from "../design-system/theme/color.stylex"; +import { criticalColor, uiColor } from "../design-system/theme/color.stylex"; import { size } from "../design-system/theme/semantic-spacing.stylex"; const IconButtonLink = createLink(IconButton); @@ -15,7 +15,7 @@ const styles = stylex.create({ position: "relative", }, unreadDot: { - borderColor: "white", + borderColor: uiColor.bgSubtle, borderRadius: "999px", borderStyle: "solid", borderWidth: 2, diff --git a/src/components/SiteFooter.tsx b/src/components/SiteFooter.tsx index caa9484..4a422b3 100644 --- a/src/components/SiteFooter.tsx +++ b/src/components/SiteFooter.tsx @@ -1,20 +1,13 @@ -import { createLink } from "@tanstack/react-router"; +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; -import { Footer } from "../design-system/footer"; -import { Link } from "../design-system/link"; +import { animationDuration } from "../design-system/theme/animations.stylex"; +import { uiColor } from "../design-system/theme/color.stylex"; +import { breakpoints } from "../design-system/theme/media-queries.stylex"; +import { fontWeight } from "../design-system/theme/typography.stylex"; import { AtStoreLogo } from "./AtStoreLogo"; -const FooterLink = createLink(Link); - const FOOTER_LINK_GROUPS = [ - { - links: [ - { href: "/about", label: "About" }, - { href: "/", label: "Home" }, - { href: "/developers/atproto", label: "Developer API" }, - { href: "/products/manage", label: "Manage listings" }, - ], - }, { title: "Apps", links: [ @@ -24,36 +17,118 @@ const FOOTER_LINK_GROUPS = [ { href: "/games", label: "Games" }, ], }, + { + title: "Makers", + links: [ + { href: "/products/create", label: "Submit an app" }, + { href: "/product/claim", label: "Claim a listing" }, + { href: "/products/manage", label: "Manage listings" }, + { href: "/developers/atproto", label: "Developer API" }, + ], + }, + { + title: "at-store", + links: [ + { href: "/about", label: "About" }, + { href: "/", label: "Home" }, + ], + }, ] as const; +const styles = stylex.create({ + footer: { + color: uiColor.text1, + fontSize: 14, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + inner: { + marginInline: "auto", + paddingInline: { default: 20, [breakpoints.sm]: 40 }, + boxSizing: "border-box", + maxWidth: "var(--page-content-max-width)", + paddingBottom: 24, + paddingTop: 56, + }, + grid: { + columnGap: 32, + display: "grid", + gridTemplateColumns: { + default: "1fr 1fr", + [breakpoints.md]: "1.6fr repeat(3, 1fr)", + }, + rowGap: 32, + }, + brand: { + gridColumn: { default: "1 / -1", [breakpoints.md]: "auto" }, + }, + blurb: { + lineHeight: 1.5, + marginBottom: 0, + marginTop: 12, + maxWidth: "22em", + }, + heading: { + margin: 0, + color: uiColor.text2, + fontSize: 13, + fontWeight: fontWeight.semibold, + marginBottom: 12, + }, + link: { + paddingBlock: 4, + textDecoration: "none", + color: { default: uiColor.text1, ":hover": uiColor.text2 }, + display: "block", + transitionDuration: animationDuration.default, + transitionProperty: "color", + }, + bottom: { + display: "flex", + fontSize: 13, + justifyContent: "space-between", + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + marginTop: 48, + paddingTop: 20, + }, +}); + export function SiteFooter() { return ( - - - - - - - {FOOTER_LINK_GROUPS.map((group, index) => ( - +
+
+
+
+ +

+ An open directory of Atmosphere apps. Listings are records in + their makers' own repos. +

+
+ {FOOTER_LINK_GROUPS.map((group) => ( + ))} - - - - - - {new Date().getFullYear()} at-store Copyright. All rights reserved. - - - +
+
+ + © {new Date().getFullYear()} at-store · Built on the AT Protocol + +
+
+
); } diff --git a/src/design-system/header-layout/index.tsx b/src/design-system/header-layout/index.tsx index 7d72428..aa43fcb 100644 --- a/src/design-system/header-layout/index.tsx +++ b/src/design-system/header-layout/index.tsx @@ -29,9 +29,15 @@ const styles = stylex.create({ rootMaxWidth: (maxWidth: string | undefined) => ({ "--page-content-max-width": maxWidth || "1280px", }), + // Shelf: a sticky, frosted paper header. header: { - backgroundColor: uiColor.bg, + backdropFilter: "saturate(1.6) blur(16px)", + backgroundColor: + "light-dark(rgba(246, 244, 239, 0.82), rgba(18, 17, 15, 0.8))", flexShrink: 0, + position: "sticky", + zIndex: 30, + top: 0, }, page: { boxSizing: "border-box", @@ -43,22 +49,22 @@ const styles = stylex.create({ minHeight: 0, paddingBottom: { default: verticalSpace["8xl"], - [containerBreakpoints.sm]: verticalSpace["xl"], + [containerBreakpoints.sm]: verticalSpace["12xl"], ":has(> [data-sidebar-layout=true])": "0 !important", }, paddingLeft: { - default: horizontalSpace["3xl"], - [containerBreakpoints.sm]: horizontalSpace["6xl"], + default: "20px", + [containerBreakpoints.sm]: "40px", ":has(> [data-sidebar-layout=true])": "0 !important", }, paddingRight: { - default: horizontalSpace["3xl"], - [containerBreakpoints.sm]: horizontalSpace["6xl"], + default: "20px", + [containerBreakpoints.sm]: "40px", ":has(> [data-sidebar-layout=true])": "0 !important", }, + // Shelf pages open with their own hero/breadcrumb spacing. paddingTop: { - default: verticalSpace["md"], - [containerBreakpoints.sm]: verticalSpace["4xl"], + default: 0, ":has(> [data-sidebar-layout=true])": "0 !important", }, width: "100%", diff --git a/src/design-system/navbar/Navbar.tsx b/src/design-system/navbar/Navbar.tsx index 5d0ba0a..5fc7dfe 100644 --- a/src/design-system/navbar/Navbar.tsx +++ b/src/design-system/navbar/Navbar.tsx @@ -18,7 +18,6 @@ import { containerBreakpoints } from "../theme/media-queries.stylex"; import { ui } from "../theme/semantic-color.stylex"; import { gap, - horizontalSpace, size as sizeSpace, verticalSpace, } from "../theme/semantic-spacing.stylex"; @@ -116,12 +115,12 @@ const styles = stylex.create({ ":is([data-navbar-open]):has([data-navbar-action])": verticalSpace["2xl"], }, paddingLeft: { - default: horizontalSpace["3xl"], - [containerBreakpoints.sm]: horizontalSpace["6xl"], + default: "20px", + [containerBreakpoints.sm]: "40px", }, paddingRight: { - default: horizontalSpace["3xl"], - [containerBreakpoints.sm]: horizontalSpace["6xl"], + default: "20px", + [containerBreakpoints.sm]: "40px", }, paddingTop: verticalSpace["xl"], width: "100%", @@ -245,14 +244,16 @@ const styles = stylex.create({ ":is([aria-expanded=true])": 1, ":is([data-active])": 1, ":is([data-breadcrumb] *)": 0, - ":is([data-hovered])": 1, ":is([data-status=active])": 1, }, gap: gap["md"], textDecoration: "none", alignItems: "center", + // Shelf: quiet links that turn ink on hover / when current. color: { - default: primaryColor.text2, + default: uiColor.text1, + ":is([aria-current=page],[data-status=active],[data-hovered])": + uiColor.text2, ":is([data-breadcrumb] *)": uiColor.text1, ":is([data-breadcrumb][data-current] *)": uiColor.text2, }, @@ -262,8 +263,14 @@ const styles = stylex.create({ [containerBreakpoints.sm]: "inline-flex", }, fontFamily: fontFamily["sans"], - fontWeight: fontWeight["normal"], + fontSize: "0.9375rem", + fontWeight: { + default: fontWeight["normal"], + ":is([aria-current=page],[data-status=active])": 550, + }, position: "relative", + transitionDuration: "150ms", + transitionProperty: "color", width: { default: "100%", [containerBreakpoints.sm]: "auto", @@ -284,7 +291,7 @@ const styles = stylex.create({ opacity: "var(--underline-opacity)", pointerEvents: "none", position: "absolute", - bottom: `calc(${verticalSpace["xxs"]} * -1)`, + bottom: `calc(${verticalSpace["xl"]} * -1 - 1px)`, height: "2px", left: 0, right: 0, From 485ed81601e21203b35e68881b7c89bdd3b9a0e9 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:21:10 -0800 Subject: [PATCH 05/18] Restyle design-system components for Shelf Hairline cards without resting shadows, surface popovers and menus with softer item highlights, warm dialog backdrop, pill search fields and segmented control, dashed empty states, ink current-page pagination, heavier page titles, plain avatar radii and softer empty stars. Co-Authored-By: Claude Opus 5.5 --- src/design-system/avatar/index.tsx | 21 ++++------------- src/design-system/card/index.tsx | 7 +++--- src/design-system/disclosure/index.tsx | 2 +- src/design-system/empty-state/index.tsx | 23 ++++++++++++++++++- src/design-system/page/Page.tsx | 10 ++++---- src/design-system/pagination/index.tsx | 2 +- src/design-system/popover/index.tsx | 2 +- src/design-system/search-field/index.tsx | 3 +++ src/design-system/segmented-control/index.tsx | 12 +++++----- src/design-system/star-rating/index.tsx | 2 +- src/design-system/theme/useDialogStyles.ts | 5 ++-- src/design-system/theme/useInputStyles.ts | 6 ++--- .../theme/useListBoxItemStyles.ts | 4 ++-- src/design-system/theme/usePopoverStyles.ts | 2 +- 14 files changed, 57 insertions(+), 44 deletions(-) diff --git a/src/design-system/avatar/index.tsx b/src/design-system/avatar/index.tsx index e5646da..bb59efc 100644 --- a/src/design-system/avatar/index.tsx +++ b/src/design-system/avatar/index.tsx @@ -12,7 +12,6 @@ import { animationTimingFunction, } from "../theme/animations.stylex"; import { uiColor } from "../theme/color.stylex"; -import { mediaQueries } from "../theme/media-queries.stylex"; import { radius } from "../theme/radius.stylex"; import { gap, size as sizeSpace } from "../theme/semantic-spacing.stylex"; import { @@ -36,34 +35,22 @@ const styles = stylex.create({ position: "relative", }, wrapperSm: { - borderRadius: { - default: radius.sm, - [mediaQueries.supportsSquircle]: radius["3xl"], - }, + borderRadius: radius.sm, height: sizeSpace["xl"], width: sizeSpace["xl"], }, wrapperMd: { - borderRadius: { - default: radius.md, - [mediaQueries.supportsSquircle]: radius["3xl"], - }, + borderRadius: radius.md, height: sizeSpace["3xl"], width: sizeSpace["3xl"], }, wrapperLg: { - borderRadius: { - default: radius.lg, - [mediaQueries.supportsSquircle]: radius["3xl"], - }, + borderRadius: radius.lg, height: sizeSpace["4xl"], width: sizeSpace["4xl"], }, wrapperXl: { - borderRadius: { - default: radius.xl, - [mediaQueries.supportsSquircle]: radius["3xl"], - }, + borderRadius: radius.xl, height: sizeSpace["5xl"], width: sizeSpace["5xl"], }, diff --git a/src/design-system/card/index.tsx b/src/design-system/card/index.tsx index d06c9da..6bb69a0 100644 --- a/src/design-system/card/index.tsx +++ b/src/design-system/card/index.tsx @@ -22,14 +22,15 @@ import { } from "../theme/typography.stylex"; const styles = stylex.create({ + // Shelf: a near-white surface with a hairline border and no resting shadow. card: { - borderColor: uiColor.component2, - borderRadius: radius.lg, + borderColor: uiColor.border1, + borderRadius: radius.xl, borderStyle: "solid", borderWidth: 1, overflow: "hidden", - boxShadow: shadow["sm"], + boxShadow: shadow["none"], display: "flex", flexDirection: "column", fontFamily: fontFamily["sans"], diff --git a/src/design-system/disclosure/index.tsx b/src/design-system/disclosure/index.tsx index 6d9d5b1..8ab3970 100644 --- a/src/design-system/disclosure/index.tsx +++ b/src/design-system/disclosure/index.tsx @@ -56,7 +56,7 @@ const styles = stylex.create({ alignItems: "center", backgroundColor: { default: "transparent", - ":is([data-hovered=true])": uiColor.component2, + ":is([data-hovered=true])": uiColor.component1, ":is([data-pressed=true])": uiColor.component3, }, color: uiColor.text1, diff --git a/src/design-system/empty-state/index.tsx b/src/design-system/empty-state/index.tsx index cfb1322..c091f6c 100644 --- a/src/design-system/empty-state/index.tsx +++ b/src/design-system/empty-state/index.tsx @@ -12,6 +12,8 @@ import { horizontalSpace, size as sizeSpace, } from "../theme/semantic-spacing.stylex"; +import { uiColor } from "../theme/color.stylex"; +import { radius } from "../theme/radius.stylex"; import { fontFamily, fontSize, fontWeight } from "../theme/typography.stylex"; const styles = stylex.create({ @@ -21,6 +23,17 @@ const styles = stylex.create({ ":is([data-empty-state-size=md])": sizeSpace["5xl"], ":is([data-empty-state-size=sm])": sizeSpace["4xl"], }, + // Shelf: md/lg empty states sit in a dashed box. + borderColor: uiColor.border2, + borderRadius: { + ":is([data-empty-state-size=md],[data-empty-state-size=lg])": radius.xl, + }, + borderStyle: { + ":is([data-empty-state-size=md],[data-empty-state-size=lg])": "dashed", + }, + borderWidth: { + ":is([data-empty-state-size=md],[data-empty-state-size=lg])": 1, + }, gridTemplateAreas: { ":is([data-empty-state-size=md],[data-empty-state-size=lg])": { default: ` @@ -47,6 +60,12 @@ const styles = stylex.create({ `, }, }, + paddingBlock: { + ":is([data-empty-state-size=md],[data-empty-state-size=lg])": 56, + }, + paddingInline: { + ":is([data-empty-state-size=md],[data-empty-state-size=lg])": 24, + }, alignItems: "center", columnGap: { ":is([data-empty-state-size=sm])": sizeSpace["md"], @@ -83,16 +102,18 @@ const styles = stylex.create({ width: "var(--empty-state-image-size)", }, title: { + fontFamily: fontFamily["title"], fontSize: { ":is([data-empty-state-size='lg'] *)": fontSize["2xl"], ":is([data-empty-state-size='md'] *)": fontSize["xl"], ":is([data-empty-state-size='sm'] *)": fontSize["lg"], }, - fontWeight: fontWeight["semibold"], + fontWeight: fontWeight["bold"], gridColumnEnd: "title", gridColumnStart: "title", gridRowEnd: "title", gridRowStart: "title", + letterSpacing: "-0.03em", marginBottom: 0, marginLeft: 0, marginRight: 0, diff --git a/src/design-system/page/Page.tsx b/src/design-system/page/Page.tsx index 21ff8a1..904ce98 100644 --- a/src/design-system/page/Page.tsx +++ b/src/design-system/page/Page.tsx @@ -211,7 +211,7 @@ const stickyBaseStyles = stylex.create({ }, stickyWrapperStuck: { backgroundColor: { - default: "light-dark(rgba(252, 252, 253, 0.8), rgba(17, 17, 19, 0.8))", + default: "light-dark(rgba(246, 244, 239, 0.82), rgba(18, 17, 15, 0.8))", }, boxShadow: `${shadow.sm}, 0 0 32px 4px ${uiColor.bgSubtle}`, borderBottomColor: uiColor.border1, @@ -285,7 +285,7 @@ const stickyFooterBaseStyles = stylex.create({ }, stickyWrapperStuck: { backgroundColor: { - default: "light-dark(rgba(252, 252, 253, 0.8), rgba(17, 17, 19, 0.8))", + default: "light-dark(rgba(246, 244, 239, 0.82), rgba(18, 17, 15, 0.8))", }, boxShadow: `${shadow.sm}, 0 0 32px 4px ${uiColor.bgSubtle}`, borderTopColor: uiColor.border1, @@ -448,9 +448,11 @@ export const PageTitle = ({ style, children, ...props }: PageTitleProps) => { return ( diff --git a/src/design-system/pagination/index.tsx b/src/design-system/pagination/index.tsx index 9c6b304..a6d73ba 100644 --- a/src/design-system/pagination/index.tsx +++ b/src/design-system/pagination/index.tsx @@ -142,7 +142,7 @@ export function Pagination({ {visiblePages.map((visiblePage) => (
  • - + setShowAll((value) => !value)}> + {showAll + ? "Show fewer ecosystems" + : `Show all ${ecosystems.length} ecosystems`} + ) : null} ); } -/** Collapsed by default unless it has a selection; pass `defaultExpanded` to override. */ function FacetSection({ title, selectedCount, - defaultExpanded = selectedCount > 0, hint, children, }: { title: string; selectedCount: number; - defaultExpanded?: boolean; hint?: string; - children: React.ReactNode; + children: ReactNode; }) { return ( - - - {selectedCount > 0 ? `${title} (${selectedCount})` : title} - - - - {hint ? {hint} : null} - {children} - - - +
    +

    + {title} + {selectedCount > 0 ? ( + + {`${selectedCount} selected`} + + ) : null} +

    + {hint ?

    {hint}

    : null} + {children} +
    ); } -/** Long facets (tags, data) get an inline filter box and a "show all" toggle. */ +/** + * Long facets (tags, data) show the top few; "Show all" reveals the rest with + * an inline filter box. Selected values always stay visible at the top. + */ function SearchableFacetSection({ title, hint, facet, options, selectedCount, - defaultExpanded, + collapsedCount, + showDetail = false, isSelected, onToggle, - renderIcon, }: { title: string; hint?: string; - defaultExpanded?: boolean; facet: BrowseFacet; options: Array; selectedCount: number; + collapsedCount: number; + /** Show the option id beside its label (data producers: `app.bsky`). */ + showDetail?: boolean; isSelected: (facet: BrowseFacet, value: string) => boolean; onToggle: (facet: BrowseFacet, value: string) => void; - renderIcon?: (option: BrowseFacetOption) => React.ReactNode; }) { const [query, setQuery] = useState(""); const [showAll, setShowAll] = useState(false); - const normalizedQuery = query.trim().toLowerCase(); + const normalizedQuery = showAll ? query.trim().toLowerCase() : ""; const available = options.filter( (option) => option.count > 0 || isSelected(facet, option.id), ); const matching = normalizedQuery - ? available.filter((option) => - option.label.toLowerCase().includes(normalizedQuery), + ? available.filter( + (option) => + option.label.toLowerCase().includes(normalizedQuery) || + option.id.toLowerCase().includes(normalizedQuery), ) : available; const selectedFirst = matching.toSorted( (a, b) => Number(isSelected(facet, b.id)) - Number(isSelected(facet, a.id)), ); - const visible = - showAll || normalizedQuery - ? selectedFirst - : selectedFirst.slice(0, COLLAPSED_OPTION_COUNT); + const visible = showAll + ? selectedFirst + : selectedFirst.slice(0, collapsedCount); if (available.length === 0) { return null; } return ( - - {available.length > COLLAPSED_OPTION_COUNT ? ( + + {showAll && available.length > collapsedCount ? ( ) : null} {visible.map((option) => ( onToggle(facet, option.id)} - icon={renderIcon?.(option)} /> ))} - {!normalizedQuery && available.length > COLLAPSED_OPTION_COUNT ? ( -
    - -
    + {available.length > collapsedCount ? ( + { + setShowAll((value) => !value); + setQuery(""); + }} + > + {showAll ? "Show fewer" : `Show all ${available.length}`} + ) : null}
    ); } +function ShowAllButton({ + onPress, + children, +}: { + onPress: () => void; + children: ReactNode; +}) { + return ( +
    + +
    + ); +} + function FacetOption({ option, + detail, isSelected, onToggle, icon, style, }: { option: BrowseFacetOption; + detail?: string | null; isSelected: boolean; onToggle: () => void; - icon?: React.ReactNode; + icon?: ReactNode; style?: stylex.StyleXStyles; }) { + const isDisabled = option.count === 0 && !isSelected; return ( - - - {icon} - {option.label} - {option.count} + + + {isSelected ? : null} + + {icon} + + {option.label} + {detail ? {detail} : null} - + {option.count} + ); } diff --git a/src/components/shelf/GameCoverCard.tsx b/src/components/shelf/GameCoverCard.tsx index 774bd0f..915d813 100644 --- a/src/components/shelf/GameCoverCard.tsx +++ b/src/components/shelf/GameCoverCard.tsx @@ -4,6 +4,7 @@ import { useState } from "react"; import { animationDuration } from "../../design-system/theme/animations.stylex"; import { uiColor } from "../../design-system/theme/color.stylex"; +import { breakpoints } from "../../design-system/theme/media-queries.stylex"; import { shadow } from "../../design-system/theme/shadow.stylex"; import { fontWeight } from "../../design-system/theme/typography.stylex"; import { getDirectoryListingSlug } from "../../lib/directory-listing-slugs"; @@ -62,6 +63,9 @@ const styles = stylex.create({ text: { minWidth: 0, }, + rowIcon: { + display: { default: "none", [breakpoints.sm]: "inline-grid" }, + }, name: { overflow: "hidden", color: uiColor.text2, @@ -116,7 +120,12 @@ export function GameCoverCard({ )}
    - +
    {listing.name}
    {listing.tagline}
    diff --git a/src/components/shelf/ListingRow.tsx b/src/components/shelf/ListingRow.tsx index 342ef55..5192f6c 100644 --- a/src/components/shelf/ListingRow.tsx +++ b/src/components/shelf/ListingRow.tsx @@ -138,6 +138,10 @@ const styles = stylex.create({ fontSize: 13, rowGap: 4, }, + // Compact rows only show the short rating, so it fits on phones too. + asideCompact: { + display: "flex", + }, muted: { color: uiColor.text1, whiteSpace: "nowrap", @@ -221,7 +225,7 @@ export function ListingRow({ ) : null} - + {children} ({ ) : null} )} - + } + > + Filters + {filterPanel} + +
    + + +
    +
    + +
    + +
    + + + +

    + {total === totalListings + ? `${totalListings} apps` + : `${total} of ${totalListings} apps`} +

    + + {results.length > 0 ? ( +
      + {results.map((listing) => ( +
    • + +
    • + ))} +
    + ) : ( + + + + + No apps match these filters + + Try removing a filter or searching for something broader. + + + - - - - - - - - - + Clear search and filters + + + + )} - - {total === totalListings - ? `${totalListings} apps` - : `${total} of ${totalListings} apps`} - - - {results.length > 0 ? ( -
      - {results.map((listing) => ( -
    • - -
    • - ))} -
    - ) : ( - - - - - No apps match these filters - - Try removing a filter or searching for something broader. - - - - - - )} - - {totalPages > 1 ? ( - { - void navigate({ - search: (prev) => ({ - ...prev, - page: next > 1 ? next : undefined, - }), - }); - }} - /> - ) : null} - + {totalPages > 1 ? ( + { + void navigate({ + search: (prev) => ({ + ...prev, + page: next > 1 ? next : undefined, + }), + }); + }} + /> + ) : null} - - + + ); } -function BrowseHeader() { +function formatApps(count: number) { + return `${count.toLocaleString("en-US")} ${count === 1 ? "app" : "apps"}`; +} + +/** + * The heading follows what you're looking at: search results, a single tag, + * a single category, or everything. + */ +function BrowseHero({ + search, + facets, + total, +}: { + search: BrowseSearch; + facets: BrowseFacets; + total: number; +}) { + const query = search.q?.trim(); + if (query) { + return ( + + ); + } + + const tagPreset = getSingleTagPreset(search, facets); + if (tagPreset) { + return ( + All tags} + eyebrow={`Tag · ${formatApps(total)}`} + title={formatAppTagLabel(tagPreset.tag)} + description={getAppTagDescription(tagPreset.tag)} + /> + ); + } + + const category = getSingleCategoryPreset(search); + if (category) { + // Only app ecosystems with tool categories have an ecosystem page. + const ecosystem = + category.pathIds[0] === "apps" && + facets.categories.some( + (option) => + option.id === `apps/${category.pathIds[1]}` && + (option.children?.length ?? 0) > 0, + ) + ? category.pathIds[1] + : undefined; + const ecosystemLabel = ecosystem + ? getDirectoryCategoryOption(`apps/${ecosystem}`)?.label + : undefined; + return ( + + {`${ecosystemLabel} ecosystem`} + + ) : undefined + } + eyebrow={`Category · ${formatApps(total)}`} + title={getBrowseCategoryLabel(category.id)} + description={category.description} + /> + ); + } + return ( - - Browse apps - - Every app, client and feed on the Atmosphere in one list. Narrow it down - with the filters. - - + ); } @@ -466,25 +604,29 @@ function ActiveFilterChips({ } return ( - +
    {chips.map(({ facet, value }) => { const label = getBrowseFilterValueLabel(facet, value, facets); return ( - + + ); })} - - + +
    ); } diff --git a/src/routes/_header-layout.index.tsx b/src/routes/_header-layout.index.tsx index 3c6c274..899cbbb 100644 --- a/src/routes/_header-layout.index.tsx +++ b/src/routes/_header-layout.index.tsx @@ -1,34 +1,44 @@ import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; import { + Link as RouterLink, createFileRoute, createLink, useNavigate, } from "@tanstack/react-router"; -import { ChevronRight } from "lucide-react"; +import { ArrowRight, ArrowUpRight } from "lucide-react"; -import type { DirectoryListingCard } from "../integrations/tanstack-query/api-directory-listings.functions"; +import type { + DirectoryHomeDataProducer, + DirectoryHomeEcosystemBranch, + DirectoryHomePageData, +} from "../integrations/tanstack-query/api-directory-listings.functions"; -import { AppCard } from "../components/AppCard"; -import { RankedAppRow } from "../components/AppListRow"; -import { AppTagCard } from "../components/AppTagCard"; +import { formatTimeAgo } from "../components/shelf/format"; +import { GameCoverCard } from "../components/shelf/GameCoverCard"; +import { IconStack } from "../components/shelf/IconStack"; +import { ListingCard } from "../components/shelf/ListingCard"; +import { ListingIcon } from "../components/shelf/ListingIcon"; +import { ListingRating } from "../components/shelf/ListingRating"; +import { ListingRow } from "../components/shelf/ListingRow"; +import { + MoreLink, + SectionHeader, + ShelfSection, +} from "../components/shelf/Section"; import { Alert } from "../design-system/alert"; import { Button } from "../design-system/button"; -import { Flex } from "../design-system/flex"; -import { Grid } from "../design-system/grid"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; +import { animationDuration } from "../design-system/theme/animations.stylex"; import { uiColor } from "../design-system/theme/color.stylex"; import { breakpoints } from "../design-system/theme/media-queries.stylex"; -import { radius } from "../design-system/theme/radius.stylex"; +import { shadow } from "../design-system/theme/shadow.stylex"; import { - gap, - horizontalSpace, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Heading1, Heading2, SmallBody } from "../design-system/typography"; -import { Text } from "../design-system/typography/text"; + fontFamily, + fontWeight, +} from "../design-system/theme/typography.stylex"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; +import { formatAppTagLabel, getAppTagSlug } from "../lib/app-tag-metadata"; +import { getDirectoryListingSlug } from "../lib/directory-listing-slugs"; import { buildRouteOgMeta } from "../lib/og-meta"; export const Route = createFileRoute("/_header-layout/")({ @@ -51,126 +61,376 @@ export const Route = createFileRoute("/_header-layout/")({ component: HomePage, }); -const AppLink = createLink(Link); +const ButtonLink = createLink(Button); + +const ACCENT = "light-dark(#1c4ef5, #7b97ff)"; const styles = stylex.create({ - sectionHeaderAction: { - flexShrink: 0, - }, - headerDescription: { - maxWidth: "41rem", + root: { + color: uiColor.text2, + fontFamily: fontFamily.sans, }, claimBanner: { - width: "100%", + paddingTop: { default: 20, [breakpoints.md]: 32 }, + }, + intro: { + alignItems: "end", + columnGap: 48, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.lg]: "1.3fr 1fr", + }, + rowGap: 16, + paddingBottom: { default: 28, [breakpoints.md]: 56 }, + paddingTop: { default: 36, [breakpoints.md]: 80 }, }, - pageHeader: { - paddingBottom: { - default: verticalSpace["8xl"], - [breakpoints.sm]: verticalSpace["10xl"], + introTitle: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: { + default: 48, + [breakpoints.md]: 68, + [breakpoints.xl]: 84, }, - paddingTop: { - default: verticalSpace["4xl"], - [breakpoints.sm]: verticalSpace["8xl"], + fontWeight: 750, + letterSpacing: "-0.052em", + lineHeight: 0.94, + textWrap: "balance", + }, + introAccent: { + color: ACCENT, + }, + introLede: { + color: uiColor.text2, + fontSize: { default: 17, [breakpoints.md]: 19 }, + lineHeight: 1.5, + textWrap: "pretty", + marginBottom: 6, + marginTop: 0, + maxWidth: "28em", + }, + feature: { + alignItems: "center", + columnGap: 48, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.lg]: "1.45fr 1fr", }, + rowGap: 20, + paddingBottom: { default: 48, [breakpoints.md]: 80 }, }, - pageSections: { - gap: { - default: 40, - [breakpoints.sm]: 64, + featureFrame: { + borderRadius: { default: 16, [breakpoints.md]: 22 }, + overflow: "hidden", + aspectRatio: "16 / 9", + backgroundColor: uiColor.component1, + boxShadow: shadow.md, + display: "block", + outlineColor: uiColor.text2, + outlineOffset: 3, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + position: "relative", + "::after": { + inset: 0, + borderRadius: "inherit", + boxShadow: `inset 0 0 0 1px ${uiColor.border1}`, + content: "''", + pointerEvents: "none", + position: "absolute", }, }, - section: { - gap: gap["2xl"], - display: "flex", - flexDirection: "column", + featureImage: { + display: "block", + objectFit: "cover", + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "scale(1.015)", + }, + transitionDuration: "0.5s", + transitionProperty: "transform", + transitionTimingFunction: "cubic-bezier(.2, .7, .2, 1)", + height: "100%", width: "100%", }, eyebrow: { - letterSpacing: "0.16em", + color: uiColor.text1, + fontSize: 12, + fontWeight: fontWeight.semibold, + letterSpacing: "0.12em", textTransform: "uppercase", }, - sectionHeader: { - marginBottom: verticalSpace["3xl"], + featureIdentity: { + alignItems: "center", + columnGap: 14, + display: "flex", + rowGap: 14, + marginTop: { default: 16, [breakpoints.md]: 22 }, }, - sectionHeaderText: { - gap: gap["2xl"], + meta: { + alignItems: "center", + color: uiColor.text1, + columnGap: 10, display: "flex", - flexDirection: "column", + flexWrap: "wrap", + fontSize: 14, + rowGap: 6, minWidth: 0, }, - categoriesGrid: { - gap: gap["2xl"], - display: "grid", - gridTemplateColumns: { - default: "repeat(2, minmax(0, 1fr))", - [breakpoints.lg]: "repeat(4, minmax(0, 1fr))", - }, + metaDot: { + borderRadius: "50%", + backgroundColor: "currentColor", + opacity: 0.5, + height: 3, + width: 3, }, - popularGrid: { - gap: gap["3xl"], - display: "grid", - gridTemplateColumns: { - default: "1fr", - [breakpoints.lg]: "minmax(0, 1.2fr) minmax(18rem, 0.9fr)", - }, + featureName: { + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: { default: 38, [breakpoints.md]: 54 }, + fontWeight: 750, + letterSpacing: "-0.048em", + lineHeight: 1, + textWrap: "balance", + marginBottom: 10, + marginTop: { default: 14, [breakpoints.md]: 20 }, }, - popularGridSingle: { - gridTemplateColumns: { - default: "1fr", - [breakpoints.lg]: "1fr", - }, + featureTagline: { + color: uiColor.text2, + fontSize: { default: 18, [breakpoints.md]: 21 }, + letterSpacing: "-0.01em", + lineHeight: 1.35, + marginBottom: 14, + marginTop: 0, + }, + featureDescription: { + overflow: "hidden", + WebkitBoxOrient: "vertical", + WebkitLineClamp: 3, + color: uiColor.text1, + display: "-webkit-box", + fontSize: 15, + lineHeight: 1.55, + marginBottom: 28, + marginTop: 0, + }, + featureActions: { + alignItems: "center", + columnGap: 10, + display: "flex", + flexWrap: "wrap", + rowGap: 10, }, - // Rows carry their own spacing (see RankedAppRow), so the vertical padding - // here is trimmed by that amount to keep the panel's inset unchanged. - popularList: { + featureAction: { + flexBasis: { default: 0, [breakpoints.sm]: "auto" }, + flexGrow: { default: 1, [breakpoints.sm]: 0 }, + }, + plainList: { margin: 0, - borderColor: uiColor.component2, - borderRadius: radius.xl, - borderStyle: "solid", - borderWidth: 1, + padding: 0, listStyle: "none", - backgroundColor: uiColor.bg, - paddingBottom: verticalSpace.lg, - paddingLeft: horizontalSpace["2xl"], - paddingRight: horizontalSpace["2xl"], - paddingTop: verticalSpace.lg, - }, - // Phone: one column. Tablet: hero full width, spotlights as a row of three. - // Desktop: hero takes two columns, spotlights stack in the third. - heroGrid: { - gap: gap["2xl"], + }, + twoColumns: { + columnGap: 48, display: "grid", gridTemplateColumns: { default: "minmax(0, 1fr)", - [breakpoints.sm]: "repeat(3, minmax(0, 1fr))", + [breakpoints.md]: "repeat(2, minmax(0, 1fr))", }, }, - heroItem: { - gridColumn: { - default: "auto", - [breakpoints.sm]: "1 / -1", - [breakpoints.xl]: "1 / span 2", + tags: { + alignItems: "baseline", + columnGap: { default: 16, [breakpoints.md]: 26 }, + display: "flex", + flexWrap: "wrap", + fontFamily: fontFamily.title, + fontSize: { default: 28, [breakpoints.md]: 42 }, + fontWeight: 650, + letterSpacing: "-0.042em", + lineHeight: 1.2, + rowGap: 2, + }, + tagLink: { + textDecoration: "none", + color: { + default: uiColor.text2, + ":hover": ACCENT, + }, + transitionDuration: animationDuration.default, + transitionProperty: "color", + }, + tagCount: { + color: uiColor.text1, + fontFamily: fontFamily.sans, + fontSize: 13, + fontVariantNumeric: "tabular-nums", + fontWeight: fontWeight.medium, + letterSpacing: 0, + verticalAlign: "super", + marginLeft: 4, + }, + tagMore: { + textDecoration: "none", + alignItems: "center", + color: { + default: uiColor.text1, + ":hover": uiColor.text2, }, - gridRow: { - default: "auto", - [breakpoints.xl]: "1 / span 3", + columnGap: 4, + display: "inline-flex", + fontFamily: fontFamily.sans, + fontSize: 17, + fontWeight: fontWeight.medium, + letterSpacing: "-0.01em", + whiteSpace: "nowrap", + }, + // The strip clips its cells' leading and top borders so only the hairlines + // *between* cells show, whatever the column count. + ecoStrip: { + overflow: "hidden", + borderTopColor: uiColor.text2, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + ecoGrid: { + display: "grid", + gridTemplateColumns: { + default: "repeat(2, minmax(0, 1fr))", + [breakpoints.md]: "repeat(3, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(6, minmax(0, 1fr))", }, + marginLeft: -17, + marginTop: -1, + }, + ecoItem: { + display: "flex", minWidth: 0, }, - spotlightItem: { - gridColumn: { - default: "auto", - [breakpoints.xl]: "3", + ecoCell: { + paddingBlock: 20, + paddingInline: 16, + textDecoration: "none", + color: "inherit", + columnGap: 12, + display: "flex", + flexDirection: "column", + outlineColor: uiColor.text2, + outlineOffset: -4, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + rowGap: 12, + borderLeftColor: uiColor.border1, + borderLeftStyle: "solid", + borderLeftWidth: 1, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + minWidth: 0, + }, + ecoName: { + color: { + default: uiColor.text2, + [stylex.when.ancestor(":hover")]: ACCENT, + }, + fontFamily: fontFamily.title, + fontSize: 20, + fontWeight: fontWeight.bold, + letterSpacing: "-0.03em", + transitionDuration: animationDuration.default, + transitionProperty: "color", + }, + ecoCount: { + color: uiColor.text1, + fontSize: 13, + fontVariantNumeric: "tabular-nums", + marginTop: -8, + }, + cards: { + marginInline: { default: -20, [breakpoints.md]: 0 }, + paddingInline: { default: 20, [breakpoints.md]: 0 }, + scrollPaddingInline: 20, + scrollSnapType: { default: "x mandatory", [breakpoints.md]: "none" }, + columnGap: 16, + display: { default: "flex", [breakpoints.md]: "grid" }, + gridTemplateColumns: { + default: null, + [breakpoints.md]: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(4, minmax(0, 1fr))", }, + rowGap: 16, + scrollbarWidth: "none", + overflowX: { default: "auto", [breakpoints.md]: "visible" }, + paddingBottom: { default: 8, [breakpoints.md]: 0 }, + paddingTop: { default: 2, [breakpoints.md]: 0 }, + }, + cardItem: { + display: "flex", + flexBasis: { default: "72%", [breakpoints.md]: "auto" }, + flexShrink: 0, + scrollSnapAlign: "start", minWidth: 0, }, - newGrid: { - gap: gap["lg"], + cardItemInner: { + flexGrow: 1, + }, + games: { + columnGap: { default: 12, [breakpoints.md]: 16 }, display: "grid", gridTemplateColumns: { - default: "minmax(0, 1fr)", - [breakpoints.sm]: "repeat(3, minmax(0, 1fr))", + default: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(4, minmax(0, 1fr))", + }, + rowGap: { default: 18, [breakpoints.md]: 24 }, + }, + dataRow: { + borderRadius: 10, + marginInline: -12, + paddingBlock: 14, + paddingInline: 12, + textDecoration: "none", + alignItems: "center", + backgroundColor: { + default: "transparent", + ":hover": uiColor.component1, }, + color: "inherit", + columnGap: 16, + display: "grid", + gridTemplateColumns: "minmax(0, 1fr) auto auto", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + position: "relative", + transitionDuration: animationDuration.default, + transitionProperty: "background-color", + "::before": { + insetInline: 12, + backgroundColor: uiColor.border1, + content: "''", + position: "absolute", + height: 1, + top: 0, + }, + }, + dataKey: { + overflow: "hidden", + color: uiColor.text2, + fontFamily: fontFamily.mono, + fontSize: 14, + fontWeight: fontWeight.medium, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + dataCount: { + color: uiColor.text1, + fontSize: 14, + fontVariantNumeric: "tabular-nums", + textAlign: "right", + minWidth: 64, }, }); @@ -182,20 +442,15 @@ function HomePage() { const { data: claimEligibility } = useSuspenseQuery( directoryListingApi.getProductClaimEligibilityQueryOptions(), ); - const promoListing = data.promo; - const [hero, ...spotlights] = putHeroImageFirst([ - data.featured, - ...data.spotlights, - ]); const showClaimBanner = claimEligibility.eligible && claimEligibility.listings.length > 0; const claimCount = claimEligibility.listings.length; return ( - - - {showClaimBanner ? ( +
    + {showClaimBanner ? ( +
    - ) : null} +
    + ) : null} - - - - The AT Protocol app directory - - Apps on the Atmosphere - - - Discover the best apps the Atmosphere has to offer. With every - product you own your data and use the same identity across all apps. - - - +
    +

    + Apps on the{" "} + Atmosphere +

    +

    + {`${formatCount(data.stats.apps)} apps and ${formatCount(data.stats.games)} games`}{" "} + that share one identity and let you take your data with you. +

    +
    + + + + + All apps} + /> +
      + {data.popular.map((listing, index) => ( +
    1. + +
    2. + ))} +
    +
    + + + All tags} + /> + + + + {data.blueskyEcosystem.branches.length > 0 ? ( + + + {`All ${formatCount(data.blueskyEcosystem.total)} tools`} + + } + /> + + + ) : null} - -
    -
    -
    - -
    - {spotlights.map((listing) => ( -
    - + + + Newest + + } + /> +
      + {data.fresh.map((listing) => ( +
    • +
      +
      - ))} -
    -
    +
  • + ))} + + -
    + {data.games.length > 0 ? ( + + {`All ${formatCount(data.stats.games)} games`} + + } /> - - {data.tags.map((tag, index) => ( - +
      + {data.games.map((listing) => ( +
    • + +
    • ))} - -
    + + + ) : null} -
    + {data.dataProducers.length > 0 ? ( + Shared data} /> - -
      - {data.popular.map((listing, index) => ( -
    1. - -
    2. - ))} -
    - {promoListing ? ( - - ) : null} -
    -
    + {data.dataProducers.map((producer) => ( +
  • + +
  • + ))} + + + ) : null} + + ); +} -
    - + {listing.heroImageUrl ? ( + + - - {data.fresh.map((listing) => ( - - ))} - -
    - - + + ) : null} +
    +
    + {tag ? `Featured · ${formatAppTagLabel(tag)}` : "Featured"} +
    +
    + + +
    +

    {listing.name}

    +

    {listing.tagline}

    + {description && description !== listing.tagline ? ( +

    {description}

    + ) : null} +
    + + View app + + {listing.externalUrl && domain ? ( + + ) : null} +
    +
    + ); } -type SectionHeaderProps = - | { - eyebrow: string; - title: string; - to: "/apps/tags"; - search?: never; - } - | { - eyebrow: string; - title: string; - to: "/apps"; - search?: { - sort?: "newest"; - }; - }; +function FeaturedMeta({ + handle, + listing, +}: { + handle: string | undefined; + listing: DirectoryHomePageData["featured"]; +}) { + const rating = + listing.reviewCount > 0 ? ( + + ) : null; + if (!handle && !rating) return null; + return ( +
    + {handle ? @{handle} : null} + {handle && rating ? ( + + ) : null} + {rating} +
    + ); +} -function SectionHeader({ eyebrow, title, to, search }: SectionHeaderProps) { - let action: React.ReactNode; +function TagCloud({ + tags, + total, +}: { + tags: DirectoryHomePageData["tags"]; + total: number; +}) { + const remaining = total - tags.length; + return ( +
    + {tags.map(({ tag, count }) => ( + + {formatAppTagLabel(tag)} + + {count} + + + ))} + {remaining > 0 ? ( + + {`+${String(remaining)} more`} + + + ) : null} +
    + ); +} - switch (to) { - case "/apps": { - action = ( - - See All - - ); - break; - } - case "/apps/tags": { - action = ( - - See All - - ); - break; - } - } +function EcosystemStrip({ + branches, +}: { + branches: Array; +}) { + return ( +
    +
      + {branches.map((branch) => ( +
    • + + + {branch.label} + + {formatApps(branch.count)} + + +
    • + ))} +
    +
    + ); +} +function DataProducerRow({ + producer, +}: { + producer: DirectoryHomeDataProducer; +}) { return ( - -
    - - {eyebrow} - - {title} -
    - {action && ( -
    {action}
    - )} -
    + + {producer.groupKey} + + + {formatApps(producer.count)} + + ); } -/** - * The hero slot is the big image card, so make sure it gets a listing that - * has an image: swap the first spotlight with one if the featured app has - * none. If no listing has an image the hero renders without one. - */ -function putHeroImageFirst(listings: Array) { - if (listings[0]?.heroImageUrl) return listings; +function formatCount(value: number) { + return value.toLocaleString("en-US"); +} - const withImage = listings.findIndex((listing) => listing.heroImageUrl); - if (withImage <= 0) return listings; +function formatApps(value: number) { + return `${formatCount(value)} ${value === 1 ? "app" : "apps"}`; +} - const arranged = [...listings]; - [arranged[0], arranged[withImage]] = [arranged[withImage], arranged[0]]; - return arranged; +function getDomain(url: string | null) { + if (!url) return null; + try { + return new URL(url).hostname.replace(/^www\./, ""); + } catch { + return null; + } +} + +function firstParagraph(text: string) { + return ( + text + .split("\n") + .map((line) => line.trim()) + .find(Boolean) ?? "" + ); } diff --git a/src/styles.css b/src/styles.css index af287d4..3be386c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -11,3 +11,17 @@ body { background-color: light-dark(#1c4ef5, #7b97ff); color: light-dark(#fff, #12110f); } + +/* Base font for anything that doesn't set its own (matches fontFamily.sans). */ +body { + font-family: + "SF Pro Text", + -apple-system, + BlinkMacSystemFont, + "Inter", + "Segoe UI", + Roboto, + system-ui, + sans-serif; + color: light-dark(#191816, #f2efe8); +} From f4262d5d2965287bfb02b08a43516dcc157f1149 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:37:38 -0800 Subject: [PATCH 07/18] Rebuild tags, shared data, games and ecosystem pages in Shelf Tags become a typographic index with counts and app icons; the shared data hub groups data types by producer with plain-language copy and user-facing empty states; lexicon pages get a compact hero, key pills and listing cards; games get a featured cover panel, a segmented sort and cover cards; ecosystems get jump pills and per-branch sections. Co-Authored-By: Claude Opus 5.5 --- .../shelf/discovery/DataTypeHeader.tsx | 128 +++++ src/components/shelf/discovery/DataTypes.tsx | 446 ++++++++++++++++++ src/components/shelf/discovery/Ecosystem.tsx | 301 ++++++++++++ src/components/shelf/discovery/Games.tsx | 228 +++++++++ .../shelf/discovery/ListingCardGrid.tsx | 35 ++ src/components/shelf/discovery/TagIndex.tsx | 138 ++++++ src/components/shelf/discovery/data-hub.ts | 130 +++++ .../shelf/discovery/ecosystem-copy.ts | 34 ++ src/components/shelf/discovery/tag-index.ts | 47 ++ .../_header-layout.apps.lexicon-set.tsx | 224 ++------- src/routes/_header-layout.apps.lexicon.tsx | 171 +++---- src/routes/_header-layout.apps.lexicons.tsx | 396 +++------------- src/routes/_header-layout.apps.tags.tsx | 101 ++-- .../_header-layout.ecosystems.$app.index.tsx | 247 ++++------ src/routes/_header-layout.games.index.tsx | 301 ++++++------ 15 files changed, 1905 insertions(+), 1022 deletions(-) create mode 100644 src/components/shelf/discovery/DataTypeHeader.tsx create mode 100644 src/components/shelf/discovery/DataTypes.tsx create mode 100644 src/components/shelf/discovery/Ecosystem.tsx create mode 100644 src/components/shelf/discovery/Games.tsx create mode 100644 src/components/shelf/discovery/ListingCardGrid.tsx create mode 100644 src/components/shelf/discovery/TagIndex.tsx create mode 100644 src/components/shelf/discovery/data-hub.ts create mode 100644 src/components/shelf/discovery/ecosystem-copy.ts create mode 100644 src/components/shelf/discovery/tag-index.ts diff --git a/src/components/shelf/discovery/DataTypeHeader.tsx b/src/components/shelf/discovery/DataTypeHeader.tsx new file mode 100644 index 0000000..1bd3f16 --- /dev/null +++ b/src/components/shelf/discovery/DataTypeHeader.tsx @@ -0,0 +1,128 @@ +import type { ReactNode } from "react"; + +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; + +import { Select, SelectItem } from "../../../design-system/select"; +import { animationDuration } from "../../../design-system/theme/animations.stylex"; +import { uiColor } from "../../../design-system/theme/color.stylex"; +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { fontFamily } from "../../../design-system/theme/typography.stylex"; +import { BackLink, PageHero } from "../Section"; + +export type DataTypeSort = "popular" | "newest" | "alphabetical"; + +const sortOptions: Array<{ id: DataTypeSort; label: string }> = [ + { id: "popular", label: "Popular" }, + { id: "newest", label: "Newest" }, + { id: "alphabetical", label: "Alphabetical" }, +]; + +const styles = stylex.create({ + sortSelect: { + flexShrink: 0, + minWidth: { default: "100%", [breakpoints.md]: "12rem" }, + }, + keys: { + columnGap: 8, + display: "flex", + flexWrap: "wrap", + rowGap: 8, + marginBottom: { default: 24, [breakpoints.md]: 32 }, + marginTop: { default: -8, [breakpoints.md]: -16 }, + }, + key: { + borderColor: { default: uiColor.border1, ":hover": uiColor.border3 }, + borderRadius: 999, + borderStyle: "solid", + borderWidth: 1, + paddingBlock: 6, + paddingInline: 12, + textDecoration: "none", + backgroundColor: uiColor.bg, + color: uiColor.text2, + fontFamily: fontFamily.mono, + fontSize: 13, + overflowWrap: "anywhere", + transitionDuration: animationDuration.default, + transitionProperty: "border-color", + maxWidth: "100%", + }, + staticKey: { + borderColor: uiColor.border1, + }, +}); + +/** Hero for one data type (or a set of them): kind, name, description and the sort picker. */ +export function DataTypeHeader({ + eyebrow, + title, + description, + sort, + sortLabel, + onSortChange, + keys, +}: { + eyebrow: ReactNode; + title: ReactNode; + description: ReactNode; + sort: DataTypeSort; + sortLabel: string; + onSortChange: (sort: DataTypeSort) => void; + /** Record keys shown as mono NSID pills; `linked` ones go to that key's own page. */ + keys: Array<{ key: string; nsid: string; name: string; linked: boolean }>; +}) { + return ( + <> + All data types} + eyebrow={eyebrow} + title={title} + description={description} + aside={ + + } + /> + {keys.length > 0 ? ( +
    + {keys.map(({ key, nsid, name, linked }) => + linked ? ( + + {nsid} + + ) : ( + + {nsid} + + ), + )} +
    + ) : null} + + ); +} diff --git a/src/components/shelf/discovery/DataTypes.tsx b/src/components/shelf/discovery/DataTypes.tsx new file mode 100644 index 0000000..0400266 --- /dev/null +++ b/src/components/shelf/discovery/DataTypes.tsx @@ -0,0 +1,446 @@ +import * as stylex from "@stylexjs/stylex"; +import { useQuery } from "@tanstack/react-query"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ArrowRight, ChevronDown } from "lucide-react"; +import { Fragment, useState } from "react"; + +import type { DirectoryOAuthLexiconClusterSummary } from "../../../lib/oauth-lexicon-hub.types"; +import type { DataProducer } from "./data-hub"; + +import { animationDuration } from "../../../design-system/theme/animations.stylex"; +import { uiColor } from "../../../design-system/theme/color.stylex"; +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { shadow } from "../../../design-system/theme/shadow.stylex"; +import { + fontFamily, + fontWeight, +} from "../../../design-system/theme/typography.stylex"; +import { directoryListingApi } from "../../../integrations/tanstack-query/api-directory-listings.functions"; +import { stringifyLexiconClusterSearchParam } from "../../../lib/oauth-scope-lexicon-keys"; +import { IconStack } from "../IconStack"; +import { MoreLink } from "../Section"; +import { + DATA_TYPES_PER_SECTION, + formatAppCount, + formatDataTypeCount, + formatDataTypeTitle, + getDataKeyNsid, + getDataTypeDescription, + isOtherDataProducer, +} from "./data-hub"; + +/** Mono keys listed on a card before "+N more". */ +const KEYS_PER_CARD = 4; + +const styles = stylex.create({ + section: { + paddingBlock: { default: 32, [breakpoints.md]: 40 }, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + head: { + alignItems: "flex-end", + columnGap: 20, + display: "flex", + flexWrap: { default: "wrap", [breakpoints.md]: "nowrap" }, + rowGap: 12, + marginBottom: 20, + }, + headText: { + flexGrow: 1, + minWidth: 0, + }, + eyebrow: { + color: uiColor.text1, + fontSize: 12, + fontWeight: fontWeight.semibold, + letterSpacing: "0.12em", + textTransform: "uppercase", + }, + eyebrowLink: { + textDecoration: "none", + color: { default: "inherit", ":hover": uiColor.text2 }, + transitionDuration: animationDuration.default, + transitionProperty: "color", + }, + heading: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.mono, + fontSize: { default: 24, [breakpoints.md]: 30 }, + fontWeight: fontWeight.bold, + letterSpacing: "-0.03em", + lineHeight: 1.15, + overflowWrap: "anywhere", + marginTop: 8, + }, + headingLink: { + textDecoration: "none", + color: "inherit", + textDecorationColor: { default: "transparent", ":hover": uiColor.border3 }, + textDecorationLine: "underline", + textDecorationThickness: 2, + textUnderlineOffset: 5, + }, + stack: { + display: { default: "none", [breakpoints.md]: "inline-flex" }, + }, + grid: { + columnGap: 12, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.md]: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(3, minmax(0, 1fr))", + }, + rowGap: 12, + }, + card: { + padding: 18, + borderColor: { default: uiColor.border1, ":hover": uiColor.border2 }, + borderRadius: 16, + borderStyle: "solid", + borderWidth: 1, + textDecoration: "none", + backgroundColor: uiColor.bg, + boxShadow: { default: shadow.none, ":hover": shadow.sm }, + color: "inherit", + display: "flex", + flexDirection: "column", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + rowGap: 8, + transitionDuration: animationDuration.default, + transitionProperty: "border-color, box-shadow", + minWidth: 0, + }, + cardTop: { + alignItems: "baseline", + columnGap: 12, + display: "flex", + justifyContent: "space-between", + }, + cardTitle: { + color: uiColor.text2, + fontSize: 16, + fontWeight: fontWeight.semibold, + minWidth: 0, + }, + cardCount: { + color: uiColor.text1, + flexShrink: 0, + fontSize: 13, + fontVariantNumeric: "tabular-nums", + whiteSpace: "nowrap", + }, + keys: { + color: uiColor.text1, + fontFamily: fontFamily.mono, + fontSize: 12, + lineHeight: 1.5, + overflowWrap: "anywhere", + }, + cardDescription: { + margin: 0, + overflow: "hidden", + WebkitBoxOrient: "vertical", + WebkitLineClamp: 2, + color: uiColor.text1, + display: "-webkit-box", + fontSize: 13, + lineHeight: 1.5, + }, + expand: { + padding: 0, + borderWidth: 0, + alignItems: "center", + backgroundColor: "transparent", + color: { default: uiColor.text1, ":hover": uiColor.text2 }, + columnGap: 4, + cursor: "pointer", + display: "inline-flex", + fontFamily: "inherit", + fontSize: 15, + transitionDuration: animationDuration.default, + transitionProperty: "color", + marginTop: 16, + }, + listTitle: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: 26, + fontWeight: fontWeight.bold, + letterSpacing: "-0.035em", + marginBottom: 12, + }, + list: { + columnGap: 48, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.md]: "repeat(2, minmax(0, 1fr))", + }, + }, + row: { + paddingBlock: 14, + alignItems: "baseline", + columnGap: 16, + display: "grid", + gridTemplateColumns: "minmax(0, 1fr) auto", + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + rowName: { + textDecoration: "none", + color: { default: uiColor.text2, ":hover": uiColor.text1 }, + fontFamily: fontFamily.mono, + fontSize: 14, + fontWeight: fontWeight.medium, + transitionDuration: animationDuration.default, + transitionProperty: "color", + }, + rowTypes: { + color: uiColor.text1, + fontSize: 13, + lineHeight: 1.6, + marginTop: 2, + }, + rowType: { + textDecoration: "none", + color: "inherit", + textDecorationColor: { default: uiColor.border2, ":hover": uiColor.text1 }, + textDecorationLine: "underline", + textUnderlineOffset: 3, + }, + rowCount: { + textDecoration: "none", + alignItems: "center", + color: { default: uiColor.text1, ":hover": uiColor.text2 }, + columnGap: 4, + display: "inline-flex", + fontSize: 14, + fontVariantNumeric: "tabular-nums", + transitionDuration: animationDuration.default, + transitionProperty: "color", + whiteSpace: "nowrap", + }, +}); + +/** One data type (a cluster of record keys shared by the same apps) as a text card. */ +function DataTypeCard({ + cluster, + descriptionsByRepoNsid, +}: { + cluster: DirectoryOAuthLexiconClusterSummary; + descriptionsByRepoNsid: Record; +}) { + const description = getDataTypeDescription( + cluster.keys, + descriptionsByRepoNsid, + ); + const shownKeys = cluster.keys.slice(0, KEYS_PER_CARD); + const hiddenKeys = cluster.keys.length - shownKeys.length; + + return ( + + + + {formatDataTypeTitle(cluster.keys)} + + + {formatAppCount(cluster.appCount)} + + + + {shownKeys.map((key) => ( + + {getDataKeyNsid(key)} +
    +
    + ))} + {hiddenKeys > 0 ? `+${hiddenKeys} more` : null} +
    + {description ? ( +

    {description}

    + ) : null} +
    + ); +} + +/** Icons of the most popular apps using a producer's data (loaded after first paint). */ +function ProducerIcons({ groupKey }: { groupKey: string }) { + const { data } = useQuery({ + ...directoryListingApi.getBrowsePageQueryOptions({ data: groupKey }), + staleTime: 5 * 60 * 1000, + }); + if (!data) return null; + return ( + + + + ); +} + +/** A producer with enough apps for its own band: header plus a grid of data-type cards. */ +export function DataProducerSection({ + producer, + descriptionsByRepoNsid, +}: { + producer: DataProducer; + descriptionsByRepoNsid: Record; +}) { + const [expanded, setExpanded] = useState(false); + const other = isOtherDataProducer(producer); + const visible = expanded + ? producer.clusters + : producer.clusters.slice(0, DATA_TYPES_PER_SECTION); + const hidden = producer.clusters.length - visible.length; + + return ( +
    +
    +
    +
    + {producer.siteOrigin ? ( + + {producer.siteLabel} + + ) : ( + "Other" + )} +
    +

    + {other ? ( + "Other data" + ) : ( + + {producer.groupKey} + + )} +

    +
    + {other ? null : ( + <> + + + {formatAppCount(producer.appCount)} + + + )} +
    +
    + {visible.map((cluster) => ( + + ))} +
    + {hidden > 0 ? ( + + ) : null} +
    + ); +} + +/** Smaller producers as a two-column list: name, its data types, and how many apps use them. */ +export function DataProducerList({ + producers, +}: { + producers: Array; +}) { + return ( +
    +

    + More shared data +

    +
    + {producers.map((producer) => ( +
    +
    + {isOtherDataProducer(producer) ? ( + Other + ) : ( + + {producer.groupKey} + + )} +
    + {producer.clusters.map((cluster, index) => ( + + {index > 0 ? " · " : null} + + {formatDataTypeTitle(cluster.keys)} + + + ))} +
    +
    + {isOtherDataProducer(producer) ? ( + + {formatAppCount(producer.appCount)} + + ) : ( + + {formatAppCount(producer.appCount)} + + + )} +
    + ))} +
    +
    + ); +} diff --git a/src/components/shelf/discovery/Ecosystem.tsx b/src/components/shelf/discovery/Ecosystem.tsx new file mode 100644 index 0000000..c3216fa --- /dev/null +++ b/src/components/shelf/discovery/Ecosystem.tsx @@ -0,0 +1,301 @@ +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ChevronRight } from "lucide-react"; + +import type { DirectoryListingCard } from "../../../integrations/tanstack-query/api-directory-listings.functions"; +import type { DirectoryCategoryTreeNode } from "../../../lib/directory-categories"; + +import { animationDuration } from "../../../design-system/theme/animations.stylex"; +import { uiColor } from "../../../design-system/theme/color.stylex"; +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { shadow } from "../../../design-system/theme/shadow.stylex"; +import { fontWeight } from "../../../design-system/theme/typography.stylex"; +import { getDirectoryListingSlug } from "../../../lib/directory-listing-slugs"; +import { ListingIcon } from "../ListingIcon"; +import { ListingRow } from "../ListingRow"; +import { MoreLink, SectionHeader, ShelfSection } from "../Section"; +import { + getEcosystemBranchAnchor, + getEcosystemBranchBlurb, +} from "./ecosystem-copy"; + +/** Rows beside the lead image in the first branch. */ +const LEAD_ROWS = 4; +/** Rows (two columns) in every other branch. */ +const BRANCH_ROWS = 6; + +const styles = stylex.create({ + root: { + borderColor: { default: uiColor.border1, ":hover": uiColor.border2 }, + borderRadius: 18, + borderStyle: "solid", + borderWidth: 1, + paddingBlock: 12, + textDecoration: "none", + alignItems: "center", + backgroundColor: uiColor.bg, + boxSizing: "border-box", + color: "inherit", + columnGap: 14, + display: "flex", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + transitionDuration: animationDuration.default, + transitionProperty: "border-color", + maxWidth: { default: "100%", [breakpoints.md]: 360 }, + minWidth: 0, + paddingLeft: 12, + paddingRight: 16, + }, + rootText: { + display: "flex", + flexDirection: "column", + flexGrow: 1, + fontSize: 14, + minWidth: 0, + }, + rootName: { + color: uiColor.text2, + fontWeight: fontWeight.semibold, + }, + rootTagline: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + rootChevron: { + color: uiColor.text2, + flexShrink: 0, + }, + jump: { + marginInline: { default: -20, [breakpoints.md]: 0 }, + paddingInline: { default: 20, [breakpoints.md]: 0 }, + columnGap: 6, + display: "flex", + flexWrap: { default: "nowrap", [breakpoints.md]: "wrap" }, + rowGap: 6, + scrollbarWidth: "none", + borderBottomColor: uiColor.border1, + borderBottomStyle: "solid", + borderBottomWidth: 1, + overflowX: { default: "auto", [breakpoints.md]: "visible" }, + paddingBottom: { default: 16, [breakpoints.md]: 8 }, + }, + pill: { + borderColor: { default: uiColor.border1, ":hover": uiColor.text2 }, + borderRadius: 999, + borderStyle: "solid", + borderWidth: 1, + paddingBlock: 8, + paddingInline: 14, + textDecoration: "none", + backgroundColor: uiColor.bg, + color: uiColor.text2, + flexShrink: 0, + fontSize: 14, + transitionDuration: animationDuration.default, + transitionProperty: "border-color", + whiteSpace: "nowrap", + }, + all: { + paddingInline: 4, + alignItems: "center", + display: "inline-flex", + flexShrink: 0, + marginLeft: { default: 8, [breakpoints.md]: "auto" }, + }, + pillCount: { + color: uiColor.text1, + fontVariantNumeric: "tabular-nums", + marginLeft: 6, + }, + section: { + scrollMarginTop: 72, + }, + lead: { + alignItems: "center", + columnGap: 40, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.lg]: "minmax(0, 1.1fr) minmax(0, 1fr)", + }, + rowGap: 16, + }, + frame: { + borderRadius: { default: 16, [breakpoints.md]: 20 }, + overflow: "hidden", + aspectRatio: "16 / 9", + backgroundColor: uiColor.component1, + boxShadow: { default: shadow.md, ":hover": shadow.lg }, + display: "block", + outlineColor: uiColor.text2, + outlineOffset: 3, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + position: "relative", + transitionDuration: animationDuration.slow, + transitionProperty: "box-shadow", + "::after": { + inset: 0, + borderRadius: "inherit", + boxShadow: `inset 0 0 0 1px ${uiColor.border1}`, + content: "''", + pointerEvents: "none", + position: "absolute", + }, + }, + frameImage: { + display: "block", + objectFit: "cover", + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "scale(1.015)", + }, + transitionDuration: animationDuration.extremelySlow, + transitionProperty: "transform", + height: "100%", + width: "100%", + }, + rows: { + display: "flex", + flexDirection: "column", + minWidth: 0, + }, + twoColumns: { + columnGap: 40, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.lg]: "repeat(2, minmax(0, 1fr))", + }, + }, +}); + +/** The ecosystem's own app as a small linked card beside the hero. */ +export function EcosystemRootCard({ + listing, +}: { + listing: DirectoryListingCard; +}) { + return ( + + + + {listing.name} + {listing.tagline} + + + + ); +} + +/** Pills that jump to each branch section, with its listing count. */ +export function EcosystemJumpLinks({ + branches, + allId, +}: { + branches: Array; + /** Category id for the trailing "All listings" link to Browse. */ + allId: string; +}) { + return ( + + ); +} + +/** + * One branch of the ecosystem. The first leads with a cover image and four + * rows beside it; the rest are two columns of compact rows. + */ +export function EcosystemBranchSection({ + branch, + listings, + lead, +}: { + branch: DirectoryCategoryTreeNode; + listings: Array; + lead: boolean; +}) { + const leadListing = lead + ? listings.find((listing) => listing.heroImageUrl) + : undefined; + const rows = leadListing + ? listings.filter((listing) => listing !== leadListing).slice(0, LEAD_ROWS) + : listings.slice(0, BRANCH_ROWS); + + return ( + + + View all {branch.count} + + } + /> + {leadListing ? ( +
    + + + +
    + {rows.map((listing) => ( + + ))} +
    +
    + ) : ( +
    + {rows.map((listing) => ( + + ))} +
    + )} +
    + ); +} diff --git a/src/components/shelf/discovery/Games.tsx b/src/components/shelf/discovery/Games.tsx new file mode 100644 index 0000000..90f808f --- /dev/null +++ b/src/components/shelf/discovery/Games.tsx @@ -0,0 +1,228 @@ +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ArrowUpRight } from "lucide-react"; + +import type { DirectoryGameCard } from "../../../integrations/tanstack-query/api-directory-listings.functions"; + +import { Badge } from "../../../design-system/badge"; +import { animationDuration } from "../../../design-system/theme/animations.stylex"; +import { uiColor } from "../../../design-system/theme/color.stylex"; +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { shadow } from "../../../design-system/theme/shadow.stylex"; +import { + fontFamily, + fontWeight, +} from "../../../design-system/theme/typography.stylex"; +import { getDirectoryListingSlug } from "../../../lib/directory-listing-slugs"; +import { + GAME_STATUS_LABELS, + getGameStatus, + getGameStatusBadgeVariant, +} from "../../../lib/game-listing"; +import { GameCoverCard } from "../GameCoverCard"; +import { ListingIcon } from "../ListingIcon"; + +const styles = stylex.create({ + feature: { + borderColor: "light-dark(#0d0c0b, #2a2825)", + borderRadius: { default: 18, [breakpoints.md]: 24 }, + borderStyle: "solid", + borderWidth: 1, + overflow: "hidden", + backgroundColor: "#0d0c0b", + boxShadow: shadow.md, + color: "#f5f3ee", + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.md]: "minmax(0, 1.6fr) minmax(0, 1fr)", + }, + position: "relative", + minHeight: { default: null, [breakpoints.md]: 360 }, + }, + frame: { + overflow: "hidden", + aspectRatio: { default: "16 / 9", [breakpoints.md]: "auto" }, + backgroundColor: "#1d1b18", + }, + cover: { + display: "block", + objectFit: "cover", + transform: { + default: null, + [stylex.when.ancestor(":hover")]: "scale(1.015)", + }, + transitionDuration: animationDuration.extremelySlow, + transitionProperty: "transform", + transitionTimingFunction: "cubic-bezier(.2,.7,.2,1)", + height: "100%", + width: "100%", + }, + copy: { + padding: { default: 24, [breakpoints.md]: 40 }, + alignItems: "flex-start", + display: "flex", + flexDirection: "column", + justifyContent: "center", + }, + eyebrow: { + color: "#a8a296", + fontSize: 12, + fontWeight: fontWeight.semibold, + letterSpacing: "0.12em", + textTransform: "uppercase", + marginTop: 20, + }, + name: { + margin: 0, + marginBlock: 8, + fontFamily: fontFamily.title, + fontSize: { default: 32, [breakpoints.md]: 44 }, + fontWeight: 750, + letterSpacing: "-0.045em", + lineHeight: 1, + textWrap: "balance", + }, + // Stretched link: the whole panel opens the listing, the Play button sits above it. + nameLink: { + borderRadius: 4, + textDecoration: "none", + color: "inherit", + outlineColor: "#f5f3ee", + outlineOffset: 4, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + "::after": { + inset: 0, + content: "''", + position: "absolute", + }, + }, + tagline: { + margin: 0, + color: "#cfcabe", + lineHeight: 1.5, + marginBottom: 24, + }, + play: { + borderRadius: 999, + paddingBlock: 10, + paddingInline: 20, + textDecoration: "none", + alignItems: "center", + backgroundColor: { default: "#f5f3ee", ":hover": "#ffffff" }, + color: "#111", + columnGap: 8, + display: "inline-flex", + fontSize: 15, + fontWeight: fontWeight.semibold, + outlineColor: "#f5f3ee", + outlineOffset: 3, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + overflowWrap: "anywhere", + position: "relative", + transitionDuration: animationDuration.default, + transitionProperty: "background-color", + zIndex: 1, + maxWidth: "100%", + minHeight: 44, + }, + playStatic: { + pointerEvents: "none", + }, + tile: { + position: "relative", + minWidth: 0, + }, + badge: { + pointerEvents: "none", + position: "absolute", + left: 10, + top: 10, + }, + byline: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + marginTop: 2, + paddingLeft: 48, + }, +}); + +function getDomain(url: string) { + try { + return new URL(url).hostname.replace(/^www\./, ""); + } catch { + return null; + } +} + +/** The most popular game as a dark cover panel with a "Play on …" button. */ +export function GameFeature({ game }: { game: DirectoryGameCard }) { + const domain = game.externalUrl ? getDomain(game.externalUrl) : null; + + return ( +
    +
    + +
    +
    + +
    Most popular game
    +

    + + {game.name} + +

    +

    {game.tagline}

    + {game.externalUrl && domain ? ( + + Play on {domain} + + + ) : ( + + View game + + )} +
    +
    + ); +} + +/** Cover card plus the status badge (unless live) and the developer byline. */ +export function GameTile({ game }: { game: DirectoryGameCard }) { + const status = getGameStatus(game.gameStatus); + + return ( +
    + + {status === "live" ? null : ( + + + {GAME_STATUS_LABELS[status]} + + + )} + {game.developerName ? ( +
    by {game.developerName}
    + ) : null} +
    + ); +} diff --git a/src/components/shelf/discovery/ListingCardGrid.tsx b/src/components/shelf/discovery/ListingCardGrid.tsx new file mode 100644 index 0000000..1062541 --- /dev/null +++ b/src/components/shelf/discovery/ListingCardGrid.tsx @@ -0,0 +1,35 @@ +import * as stylex from "@stylexjs/stylex"; + +import type { CardListing } from "../ListingCard"; + +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { ListingCard } from "../ListingCard"; + +const styles = stylex.create({ + grid: { + columnGap: 16, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.sm]: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(3, minmax(0, 1fr))", + [breakpoints.xl]: "repeat(4, minmax(0, 1fr))", + }, + rowGap: 16, + }, +}); + +/** A plain responsive grid of text-first listing cards. */ +export function ListingCardGrid({ + listings, +}: { + listings: Array; +}) { + return ( +
    + {listings.map((listing) => ( + + ))} +
    + ); +} diff --git a/src/components/shelf/discovery/TagIndex.tsx b/src/components/shelf/discovery/TagIndex.tsx new file mode 100644 index 0000000..fe60bb5 --- /dev/null +++ b/src/components/shelf/discovery/TagIndex.tsx @@ -0,0 +1,138 @@ +import * as stylex from "@stylexjs/stylex"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { VisuallyHidden } from "react-aria"; + +import type { DirectoryAppTagGroup } from "../../../integrations/tanstack-query/api-directory-listings.functions"; + +import { animationDuration } from "../../../design-system/theme/animations.stylex"; +import { uiColor } from "../../../design-system/theme/color.stylex"; +import { breakpoints } from "../../../design-system/theme/media-queries.stylex"; +import { + fontFamily, + fontWeight, +} from "../../../design-system/theme/typography.stylex"; +import { + formatAppTagCount, + formatAppTagLabel, + getAppTagLinkOptions, +} from "../../../lib/app-tag-metadata"; +import { IconStack } from "../IconStack"; +import { + getWrittenAppTagDescription, + orderTagGroups, + summarizeTagApps, +} from "./tag-index"; + +const styles = stylex.create({ + index: { + columnGap: 40, + display: "grid", + gridTemplateColumns: { + default: "minmax(0, 1fr)", + [breakpoints.md]: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(3, minmax(0, 1fr))", + }, + rowGap: 0, + borderTopColor: uiColor.text2, + borderTopStyle: "solid", + borderTopWidth: 1, + }, + tile: { + textDecoration: "none", + color: "inherit", + columnGap: 10, + display: "flex", + flexDirection: "column", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + rowGap: 10, + borderBottomColor: uiColor.border1, + borderBottomStyle: "solid", + borderBottomWidth: 1, + minWidth: 0, + paddingBottom: 24, + paddingTop: 22, + }, + top: { + alignItems: "baseline", + columnGap: 12, + display: "flex", + justifyContent: "space-between", + rowGap: 12, + }, + name: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: { default: 24, [breakpoints.md]: 28 }, + fontWeight: fontWeight.bold, + letterSpacing: "-0.04em", + lineHeight: 1.1, + textDecorationColor: { + default: "transparent", + [stylex.when.ancestor(":hover")]: uiColor.border3, + }, + textDecorationLine: "underline", + textDecorationThickness: 2, + textUnderlineOffset: 5, + transitionDuration: animationDuration.default, + transitionProperty: "text-decoration-color", + }, + count: { + color: uiColor.text1, + flexShrink: 0, + fontSize: 14, + fontVariantNumeric: "tabular-nums", + }, + text: { + margin: 0, + overflow: "hidden", + WebkitBoxOrient: "vertical", + WebkitLineClamp: 2, + color: uiColor.text1, + display: "-webkit-box", + fontSize: 14, + lineHeight: 1.5, + minHeight: "1.5em", + }, + oneLine: { + WebkitLineClamp: 1, + }, +}); + +/** The tag index on /apps/tags: a ruled three-column list of text-first tiles. */ +export function TagIndex({ groups }: { groups: Array }) { + return ( +
    + {orderTagGroups(groups).map((group) => ( + + ))} +
    + ); +} + +function TagTile({ group }: { group: DirectoryAppTagGroup }) { + const label = formatAppTagLabel(group.tag); + const description = getWrittenAppTagDescription(group.tag); + + return ( + + +

    {label}

    + + {group.count} + {formatAppTagCount(group.count)} + +
    +

    + {description ?? summarizeTagApps(group)} +

    + +
    + ); +} diff --git a/src/components/shelf/discovery/data-hub.ts b/src/components/shelf/discovery/data-hub.ts new file mode 100644 index 0000000..aa3bbcd --- /dev/null +++ b/src/components/shelf/discovery/data-hub.ts @@ -0,0 +1,130 @@ +import type { DirectoryOAuthLexiconClusterSummary } from "../../../lib/oauth-lexicon-hub.types"; + +import { getLexiconProducerSiteFromRepoNsid } from "../../../lib/lexicon-producer-site"; +import { + compareOAuthLexiconKeysForDisplayOrder, + formatOAuthLexiconKeyHeadline, + parseOAuthLexiconKey, +} from "../../../lib/oauth-scope-lexicon-keys"; + +const OTHER_GROUP_KEY = "zz-other"; + +/** Producers used by at least this many apps get a full section; the rest share a compact list. */ +export const DATA_PRODUCER_SECTION_MIN_APPS = 7; + +/** Data-type cards shown per producer before "N more data types". */ +export const DATA_TYPES_PER_SECTION = 6; + +export interface DataProducer { + /** First two NSID segments, e.g. `app.bsky`; also the `/apps?data=` filter value. */ + groupKey: string; + /** Public host for the producer, e.g. `bsky.app`. Empty for the catch-all group. */ + siteLabel: string; + siteOrigin: string; + clusters: Array; + /** Distinct apps across every cluster in the group. */ + appCount: number; +} + +export function isOtherDataProducer(producer: DataProducer) { + return producer.groupKey === OTHER_GROUP_KEY; +} + +function clusterProducer(cluster: DirectoryOAuthLexiconClusterSummary) { + const sites = cluster.keys + .map((key) => { + const parsed = parseOAuthLexiconKey(key); + if (!parsed || parsed.kind !== "repo") return null; + return getLexiconProducerSiteFromRepoNsid(parsed.nsid); + }) + .filter((site) => site != null); + if (sites.length === 0) { + return { groupKey: OTHER_GROUP_KEY, siteLabel: "Other", siteOrigin: "" }; + } + return sites.toSorted((a, b) => a.groupKey.localeCompare(b.groupKey))[0]; +} + +/** + * Buckets hub clusters by the site that defines them (`app.bsky`, `site.standard`, …), + * most-used producers first, and each producer's clusters by app count. + */ +export function groupClustersByProducer( + clusters: Array, +): Array { + const buckets = new Map>(); + for (const cluster of clusters) { + const site = clusterProducer(cluster); + let bucket = buckets.get(site.groupKey); + if (!bucket) { + bucket = { ...site, clusters: [] }; + buckets.set(site.groupKey, bucket); + } + bucket.clusters.push(cluster); + } + + return [...buckets.values()] + .map((bucket) => ({ + ...bucket, + clusters: bucket.clusters.toSorted( + (a, b) => + b.appCount - a.appCount || + compareOAuthLexiconKeysForDisplayOrder( + a.keys[0] ?? "", + b.keys[0] ?? "", + ), + ), + appCount: new Set(bucket.clusters.flatMap((c) => c.listingIds)).size, + })) + .toSorted( + (a, b) => b.appCount - a.appCount || a.groupKey.localeCompare(b.groupKey), + ); +} + +/** Record NSID for a hub key (`repo:app.bsky.feed.post` → `app.bsky.feed.post`). */ +export function getDataKeyNsid(key: string) { + return parseOAuthLexiconKey(key)?.nsid ?? key; +} + +/** Host of the site that defines a key's data (`repo:app.bsky.feed.post` → `bsky.app`). */ +export function getDataKeySiteLabel(key: string) { + const parsed = parseOAuthLexiconKey(key); + if (!parsed || parsed.kind !== "repo") return null; + return getLexiconProducerSiteFromRepoNsid(parsed.nsid)?.siteLabel ?? null; +} + +/** "Data type · bsky.app" when every key comes from the same site. */ +export function formatDataTypeEyebrow( + kind: string, + keys: ReadonlyArray, +) { + const sites = new Set(keys.map((key) => getDataKeySiteLabel(key))); + const [site] = sites; + return sites.size === 1 && site ? `${kind} · ${site}` : kind; +} + +/** "Post", or "Profile, Post, Follow", or "Message, Key, Livestream +4". */ +export function formatDataTypeTitle(keys: ReadonlyArray, max = 3) { + const names = keys.map((key) => formatOAuthLexiconKeyHeadline(key)); + const shown = names.slice(0, max).join(", "); + return names.length > max ? `${shown} +${names.length - max}` : shown; +} + +/** First hand-written lexicon description among a cluster's keys. */ +export function getDataTypeDescription( + keys: ReadonlyArray, + descriptionsByRepoNsid: Record, +) { + for (const key of keys) { + const description = descriptionsByRepoNsid[getDataKeyNsid(key)]?.trim(); + if (description) return description; + } + return null; +} + +export function formatAppCount(count: number) { + return `${count} ${count === 1 ? "app" : "apps"}`; +} + +export function formatDataTypeCount(count: number) { + return `${count} ${count === 1 ? "data type" : "data types"}`; +} diff --git a/src/components/shelf/discovery/ecosystem-copy.ts b/src/components/shelf/discovery/ecosystem-copy.ts new file mode 100644 index 0000000..76d9d8e --- /dev/null +++ b/src/components/shelf/discovery/ecosystem-copy.ts @@ -0,0 +1,34 @@ +import type { DirectoryCategoryTreeNode } from "../../../lib/directory-categories"; + +/** Hand-written intros for ecosystems; others use the category description. */ +const ECOSYSTEM_INTROS: Record = { + "apps/bluesky": + "Bluesky apps and ecosystem tools: clients, analytics, schedulers and feeds made by independent developers on top of Bluesky.", +}; + +/** One-line blurbs for ecosystem branches; others use the category description. */ +const ECOSYSTEM_BRANCH_BLURBS: Record = { + "apps/bluesky/client": "Other apps for reading and posting to Bluesky.", + "apps/bluesky/tool": + "Utilities that add to Bluesky: themes, backups, alerts, extensions.", + "apps/bluesky/analytics": + "Stats and insights about your account and audience.", + "apps/bluesky/scheduling": + "Plan posts ahead of time and publish at the right moment.", + "apps/bluesky/feed-generators": + "Custom feeds you can pin in any Bluesky client.", + "apps/bluesky/moderation": "Labelers and tools for a calmer timeline.", +}; + +export function getEcosystemIntro(category: DirectoryCategoryTreeNode) { + return ECOSYSTEM_INTROS[category.id] ?? category.description; +} + +export function getEcosystemBranchBlurb(category: DirectoryCategoryTreeNode) { + return ECOSYSTEM_BRANCH_BLURBS[category.id] ?? category.description; +} + +/** Fragment id for a branch's section, e.g. `eco-client`. */ +export function getEcosystemBranchAnchor(category: DirectoryCategoryTreeNode) { + return `eco-${category.id.split("/").at(-1) ?? category.id}`; +} diff --git a/src/components/shelf/discovery/tag-index.ts b/src/components/shelf/discovery/tag-index.ts new file mode 100644 index 0000000..d1b8996 --- /dev/null +++ b/src/components/shelf/discovery/tag-index.ts @@ -0,0 +1,47 @@ +import type { DirectoryAppTagGroup } from "../../../integrations/tanstack-query/api-directory-listings.functions"; + +import { + formatAppTagLabel, + getAppTagDescription, + getAppTagSlug, +} from "../../../lib/app-tag-metadata"; +import { GAMES_APP_TAG_SLUG } from "../../../lib/game-listing"; + +/** Games live on their own page, so the tile says so instead of listing names. */ +const GAMES_TILE_DESCRIPTION = + "Games built on the AT Protocol. They live on their own page."; + +/** `getAppTagDescription` for a tag nobody wrote copy for: the generic sentence. */ +function genericAppTagDescription(tag: string) { + const sample = "\u0000"; + return getAppTagDescription(sample).replace( + formatAppTagLabel(sample), + formatAppTagLabel(tag), + ); +} + +/** + * Hand-written description for a tag, or null when the tag only has the + * generic fallback sentence (tiles show a few app names instead). + */ +export function getWrittenAppTagDescription(tag: string): string | null { + if (getAppTagSlug(tag) === GAMES_APP_TAG_SLUG) return GAMES_TILE_DESCRIPTION; + const description = getAppTagDescription(tag); + return description === genericAppTagDescription(tag) ? null : description; +} + +/** "Tangled, npmx, wisp.place and more" from a tag group's most popular apps. */ +export function summarizeTagApps(group: DirectoryAppTagGroup) { + const names = group.listings.slice(0, 3).map((listing) => listing.name); + return `${names.join(", ")}${group.count > names.length ? " and more" : ""}`; +} + +/** Same order as the server (popularity), with the Games tile moved to the end. */ +export function orderTagGroups(groups: Array) { + const isGames = (group: DirectoryAppTagGroup) => + getAppTagSlug(group.tag) === GAMES_APP_TAG_SLUG; + return [ + ...groups.filter((group) => !isGames(group)), + ...groups.filter((group) => isGames(group)), + ]; +} diff --git a/src/routes/_header-layout.apps.lexicon-set.tsx b/src/routes/_header-layout.apps.lexicon-set.tsx index 38045a0..1fd953f 100644 --- a/src/routes/_header-layout.apps.lexicon-set.tsx +++ b/src/routes/_header-layout.apps.lexicon-set.tsx @@ -1,30 +1,25 @@ -import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; import { - Link as RouterLink, createFileRoute, - createLink, notFound, redirect, useRouter, } from "@tanstack/react-router"; -import { ChevronLeft } from "lucide-react"; +import { SearchX } from "lucide-react"; -import { AppCard } from "../components/AppCard"; -import { AppTagHero } from "../components/AppTagHero"; -import { FeaturedListingGrid } from "../components/FeaturedListingGrid"; -import { Badge } from "../design-system/badge"; -import { Flex } from "../design-system/flex"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; -import { Select, SelectItem } from "../design-system/select"; -import { breakpoints } from "../design-system/theme/media-queries.stylex"; import { - gap, - size, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Body } from "../design-system/typography"; + formatDataTypeEyebrow, + formatDataTypeTitle, + getDataKeyNsid, +} from "../components/shelf/discovery/data-hub"; +import { DataTypeHeader } from "../components/shelf/discovery/DataTypeHeader"; +import { ListingCardGrid } from "../components/shelf/discovery/ListingCardGrid"; +import { + EmptyState, + EmptyStateDescription, + EmptyStateImage, + EmptyStateTitle, +} from "../design-system/empty-state"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { formatLexiconClusterPageTitle, @@ -34,72 +29,6 @@ import { } from "../lib/oauth-scope-lexicon-keys"; import { buildRouteOgMeta } from "../lib/og-meta"; -const sortOptions = [ - { id: "popular", label: "Popular" }, - { id: "newest", label: "Newest" }, - { id: "alphabetical", label: "Alphabetical" }, -] as const; - -const LinkLink = createLink(Link); - -const styles = stylex.create({ - pageContent: { - gap: { - default: gap["6xl"], - [breakpoints.xl]: gap["7xl"], - }, - }, - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], - }, - navLinks: { - flexWrap: "wrap", - }, - sortSelect: { - flexGrow: { - default: 1, - [breakpoints.sm]: 0, - }, - minWidth: "12rem", - }, - emptyState: { - gap: gap["lg"], - maxWidth: "40rem", - }, - badgeRow: { - gap: gap.md, - alignItems: "center", - display: "flex", - flexWrap: "wrap", - rowGap: gap.md, - maxWidth: "48rem", - }, - badgeLink: { - textDecoration: "none", - color: "inherit", - display: "block", - maxWidth: "100%", - }, - lexiconBadgeGrow: { - alignItems: "center", - height: "auto", - minHeight: size.lg, - paddingBottom: verticalSpace.xs, - paddingTop: verticalSpace.xs, - }, - badgeLabel: { - display: "block", - whiteSpace: "normal", - wordBreak: "break-word", - maxWidth: { - default: "24rem", - [breakpoints.sm]: "36rem", - }, - minWidth: 0, - }, -}); - export const Route = createFileRoute("/_header-layout/apps/lexicon-set")({ validateSearch: ( search, @@ -189,8 +118,6 @@ function AppsLexiconSetPage() { throw notFound(); } - const gridKey = data.keys.join("\u001F"); - const defaultHeroDescription = "These apps use the same data sources, so they can interoperate with each other."; const heroDescription = @@ -201,94 +128,41 @@ function AppsLexiconSetPage() { : defaultHeroDescription; return ( - - - - - - - All lexicon collections - - - - { - if ( - sortKey !== "popular" && - sortKey !== "newest" && - sortKey !== "alphabetical" - ) { - return; - } - - void router.navigate({ - to: "/apps/lexicon-set", - search: { c: search.c, sort: sortKey }, - }); - }} - > - {(item) => {item.label}} - - } - /> - {data.keys.length > 1 ? ( - - {data.keys.map((k) => { - const label = formatOAuthLexiconKeyClusterStyleHeadline(k); - return ( - - - {label} - - - ); - })} - - ) : null} - - - {data.listings.length > 0 ? ( - `${gridKey}-${listing.id}`} - canFeature={(listing) => Boolean(listing.heroImageUrl)} - renderItem={(listing, { featured }) => ( - - )} - /> - ) : ( - - - No verified app listings reference this exact cluster yet. Try the - hub or a single-key browse page—or wait for the next OAuth probe - sync. - - - )} - - + <> + { + void router.navigate({ + to: "/apps/lexicon-set", + search: { c: search.c, sort: sortKey }, + }); + }} + keys={data.keys.map((key) => ({ + key, + nsid: getDataKeyNsid(key), + name: formatOAuthLexiconKeyClusterStyleHeadline(key), + linked: data.keys.length > 1, + }))} + /> + + {data.listings.length > 0 ? ( + + ) : ( + + + + + No apps share this data yet + + No listed apps use this exact combination of data right now. Try one + of the data types above on its own, or browse all shared data. + + + )} + ); } diff --git a/src/routes/_header-layout.apps.lexicon.tsx b/src/routes/_header-layout.apps.lexicon.tsx index a3eafd4..92cebc3 100644 --- a/src/routes/_header-layout.apps.lexicon.tsx +++ b/src/routes/_header-layout.apps.lexicon.tsx @@ -1,70 +1,33 @@ -import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; import { createFileRoute, - createLink, notFound, redirect, useRouter, } from "@tanstack/react-router"; -import { ChevronLeft } from "lucide-react"; +import { SearchX } from "lucide-react"; -import { AppCard } from "../components/AppCard"; -import { AppTagHero } from "../components/AppTagHero"; -import { FeaturedListingGrid } from "../components/FeaturedListingGrid"; -import { Flex } from "../design-system/flex"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; -import { Select, SelectItem } from "../design-system/select"; -import { breakpoints } from "../design-system/theme/media-queries.stylex"; import { - gap, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Body } from "../design-system/typography"; + formatDataTypeEyebrow, + getDataKeyNsid, +} from "../components/shelf/discovery/data-hub"; +import { DataTypeHeader } from "../components/shelf/discovery/DataTypeHeader"; +import { ListingCardGrid } from "../components/shelf/discovery/ListingCardGrid"; +import { + EmptyState, + EmptyStateDescription, + EmptyStateImage, + EmptyStateTitle, +} from "../design-system/empty-state"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { formatOAuthLexiconKeyClusterStyleHeadline, + formatOAuthLexiconKeyHeadline, oauthLexiconKeyKindLabel, parseOAuthLexiconKey, } from "../lib/oauth-scope-lexicon-keys"; import { buildRouteOgMeta } from "../lib/og-meta"; -const sortOptions = [ - { id: "popular", label: "Popular" }, - { id: "newest", label: "Newest" }, - { id: "alphabetical", label: "Alphabetical" }, -] as const; - -const LinkLink = createLink(Link); - -const styles = stylex.create({ - pageContent: { - gap: { - default: gap["6xl"], - [breakpoints.xl]: gap["7xl"], - }, - }, - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], - }, - navLinks: { - flexWrap: "wrap", - }, - sortSelect: { - flexGrow: { - default: 1, - [breakpoints.sm]: 0, - }, - minWidth: "12rem", - }, - emptyState: { - gap: gap["lg"], - maxWidth: "40rem", - }, -}); - export const Route = createFileRoute("/_header-layout/apps/lexicon")({ validateSearch: ( search, @@ -145,72 +108,52 @@ function AppsLexiconPage() { const heroDescription = lexiconRecordDescription != null && lexiconRecordDescription.trim() !== "" ? lexiconRecordDescription.trim() - : `These verified apps include ${headline} in their published OAuth scope vocabulary, so they may interoperate with the same AT Protocol permissions layer.`; + : parsed?.kind === "repo" + ? `${data.count === 1 ? "1 app reads or writes" : `${String(data.count)} apps read or write`} ${headline} records, so data you create in one of them is available to the others.` + : `These verified apps include ${headline} in their published OAuth scope vocabulary, so they may interoperate with the same AT Protocol permissions layer.`; return ( - - - - - - - All lexicon collections - - - - { - if ( - sortKey !== "popular" && - sortKey !== "newest" && - sortKey !== "alphabetical" - ) { - return; - } - - void router.navigate({ - to: "/apps/lexicon", - search: { key, sort: sortKey }, - }); - }} - > - {(item) => {item.label}} - - } - /> - + <> + { + void router.navigate({ + to: "/apps/lexicon", + search: { key, sort: sortKey }, + }); + }} + keys={[ + { + key, + nsid: getDataKeyNsid(key), + name: headline, + linked: false, + }, + ]} + /> - {data.listings.length > 0 ? ( - `${key}-${listing.id}`} - canFeature={(listing) => Boolean(listing.heroImageUrl)} - renderItem={(listing, { featured }) => ( - - )} - /> - ) : ( - - - No verified app listings reference this lexicon key yet. Lexicon - keys are populated from storefront OAuth probes — try again after - the next sync, or pick another collection from the hub. - - - )} - - + {data.listings.length > 0 ? ( + + ) : ( + + + + + No apps use this data yet + + None of the listed apps read or write this kind of data right now. + Check back later, or browse other shared data types. + + + )} + ); } diff --git a/src/routes/_header-layout.apps.lexicons.tsx b/src/routes/_header-layout.apps.lexicons.tsx index 444ccf9..e1dad2f 100644 --- a/src/routes/_header-layout.apps.lexicons.tsx +++ b/src/routes/_header-layout.apps.lexicons.tsx @@ -1,125 +1,26 @@ -import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; -import { - Link as RouterLink, - createFileRoute, - createLink, -} from "@tanstack/react-router"; -import { ChevronLeft, ChevronRight, ExternalLink } from "lucide-react"; +import { createFileRoute } from "@tanstack/react-router"; +import { Database } from "lucide-react"; import { useMemo } from "react"; -import type { DirectoryOAuthLexiconClusterSummary } from "../integrations/tanstack-query/api-directory-listings.functions"; - -import { AppTagHero } from "../components/AppTagHero"; -import { Card } from "../design-system/card"; import { - Disclosure, - DisclosurePanel, - DisclosureTitle, -} from "../design-system/disclosure"; -import { Flex } from "../design-system/flex"; -import { Grid } from "../design-system/grid"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; -import { breakpoints } from "../design-system/theme/media-queries.stylex"; + DATA_PRODUCER_SECTION_MIN_APPS, + groupClustersByProducer, +} from "../components/shelf/discovery/data-hub"; import { - gap, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Body, SmallBody } from "../design-system/typography"; -import { Text } from "../design-system/typography/text"; -import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; -import { getLexiconProducerSiteFromRepoNsid } from "../lib/lexicon-producer-site"; + DataProducerList, + DataProducerSection, +} from "../components/shelf/discovery/DataTypes"; +import { PageHero } from "../components/shelf/Section"; import { - compareOAuthLexiconKeysForDisplayOrder, - formatOAuthLexiconKeyHeadline, - parseOAuthLexiconKey, - stringifyLexiconClusterSearchParam, -} from "../lib/oauth-scope-lexicon-keys"; + EmptyState, + EmptyStateDescription, + EmptyStateImage, + EmptyStateTitle, +} from "../design-system/empty-state"; +import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { buildRouteOgMeta } from "../lib/og-meta"; -const OTHER_GROUP_KEY = "zz-other"; - -const LinkLink = createLink(Link); - -const styles = stylex.create({ - grow: { - flexGrow: 1, - }, - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], - }, - navLinks: { - flexWrap: "wrap", - }, - grid: { - gap: gap["2xl"], - display: "grid", - gridTemplateColumns: { - default: "repeat(1, minmax(0, 1fr))", - [breakpoints.sm]: "repeat(2, minmax(0, 1fr))", - [breakpoints.lg]: "repeat(3, minmax(0, 1fr))", - }, - }, - cardLink: { - textDecoration: "none", - color: "inherit", - display: "block", - height: "100%", - }, - card: { - height: "100%", - }, - cardInner: { - gap: gap["2xl"], - height: "100%", - paddingBottom: verticalSpace["2xl"], - paddingLeft: verticalSpace["3xl"], - paddingRight: verticalSpace["3xl"], - paddingTop: verticalSpace["2xl"], - }, - emptyState: { - gap: gap["lg"], - maxWidth: "40rem", - }, - cardTitleText: { - wordBreak: "break-word", - }, - keyDescription: { - // oxlint-disable-next-line @stylexjs/valid-styles - lineClamp: 3, - overflow: "hidden", - WebkitBoxOrient: "vertical", - WebkitLineClamp: 3, - display: "-webkit-box", - }, - siteSection: { - width: "100%", - }, - disclosureTitleInner: { - gap: gap.md, - alignItems: "center", - display: "flex", - flexBasis: "0%", - flexGrow: 1, - flexShrink: 1, - textAlign: "start", - minWidth: 0, - }, - siteExternalLink: { - display: "inline-flex", - flexShrink: 0, - }, - siteHeadingLink: { - gap: gap.sm, - textDecoration: "none", - alignItems: "center", - color: "inherit", - display: "inline-flex", - }, -}); - export const Route = createFileRoute("/_header-layout/apps/lexicons")({ loader: ({ context }) => context.queryClient.ensureQueryData( @@ -134,237 +35,54 @@ export const Route = createFileRoute("/_header-layout/apps/lexicons")({ component: AppsLexiconsHubPage, }); -function formatLexiconCount(n: number) { - return `${String(n)} app${n === 1 ? "" : "s"}`; -} - -function clusterProducerSection(cluster: DirectoryOAuthLexiconClusterSummary): { - groupKey: string; - siteLabel: string; - siteOrigin: string; -} { - const sites = cluster.keys - .map((k) => { - const p = parseOAuthLexiconKey(k); - if (!p || p.kind !== "repo") { - return null; - } - return getLexiconProducerSiteFromRepoNsid(p.nsid); - }) - .filter((x): x is NonNullable => x != null); - if (sites.length === 0) { - return { groupKey: OTHER_GROUP_KEY, siteLabel: "Other", siteOrigin: "" }; - } - return sites.toSorted((a, b) => a.groupKey.localeCompare(b.groupKey))[0]; -} - -function LexiconClusterHubCard({ - row, - descriptionsByRepoNsid, -}: { - row: DirectoryOAuthLexiconClusterSummary; - descriptionsByRepoNsid: Record; -}) { - const c = stringifyLexiconClusterSearchParam(row.keys); - - return ( - - - - - - {row.keys.map((key) => { - const parsed = parseOAuthLexiconKey(key); - const nsid = parsed?.nsid; - const desc = - nsid != null && nsid.length > 0 - ? descriptionsByRepoNsid[nsid] - : undefined; - return ( - - - {formatOAuthLexiconKeyHeadline(key)} - - {desc ? ( - - {desc} - - ) : null} - - ); - })} - - - - - {formatLexiconCount(row.appCount)} - - - - - ); -} - -type SiteSection = { - groupKey: string; - siteLabel: string; - siteOrigin: string; - clusters: Array; -}; - function AppsLexiconsHubPage() { const { data: hub } = useSuspenseQuery( directoryListingApi.getAppsOAuthLexiconSummariesQueryOptions, ); - const siteSections = useMemo((): Array => { - const bucket = new Map< - string, - { - siteLabel: string; - siteOrigin: string; - clusters: SiteSection["clusters"]; - } - >(); - for (const row of hub.clusters) { - const meta = clusterProducerSection(row); - let g = bucket.get(meta.groupKey); - if (!g) { - g = { - siteLabel: meta.siteLabel, - siteOrigin: meta.siteOrigin, - clusters: [], - }; - bucket.set(meta.groupKey, g); - } - g.clusters.push(row); - } - - return [...bucket.entries()] - .map(([groupKey, g]) => { - g.clusters.sort((c1, c2) => { - if (c2.appCount !== c1.appCount) return c2.appCount - c1.appCount; - const ak = c1.keys[0] ?? ""; - const bk = c2.keys[0] ?? ""; - return compareOAuthLexiconKeysForDisplayOrder(ak, bk); - }); - const uniqueAppCount = new Set(g.clusters.flatMap((c) => c.listingIds)) - .size; - return { groupKey, g, uniqueAppCount }; - }) - .toSorted((a, b) => { - if (b.uniqueAppCount !== a.uniqueAppCount) { - return b.uniqueAppCount - a.uniqueAppCount; - } - return a.groupKey.localeCompare(b.groupKey); - }) - .map(({ groupKey, g }) => ({ - groupKey, - siteLabel: g.siteLabel, - siteOrigin: g.siteOrigin, - clusters: g.clusters, - })); - }, [hub.clusters]); + const producers = useMemo( + () => groupClustersByProducer(hub.clusters), + [hub.clusters], + ); + const major = producers.filter( + (producer) => producer.appCount >= DATA_PRODUCER_SECTION_MIN_APPS, + ); + const minor = producers.filter( + (producer) => producer.appCount < DATA_PRODUCER_SECTION_MIN_APPS, + ); return ( - - - - - - - All tags - - - All apps - - - - - - {hub.clusters.length > 0 ? ( - - {siteSections.map((section) => ( - - - - - {section.siteLabel} - - {section.siteOrigin ? ( - { - e.stopPropagation(); - }} - onPointerDown={(e) => { - e.stopPropagation(); - }} - {...stylex.props( - styles.siteHeadingLink, - styles.siteExternalLink, - )} - > - - - ) : null} - - - - - {section.clusters.map((row) => ( - - ))} - - - - ))} - - ) : ( - - - No shared repo record lexicon collections yet. Run storefront - OAuth probes (`listing:oauth-probes-sync`) so we can index scope - vocabulary—or every `repo:` key may appear on only one app (we - require two or more listings). This page omits `include:` and - `rpc:` keys. On product pages, compatible-app matching still omits - `app.bsky.*` except for the Bluesky client listing. - - - )} - - + <> + + + {producers.length > 0 ? ( + <> + {major.map((producer) => ( + + ))} + {minor.length > 0 ? : null} + + ) : ( + + + + + No shared data yet + + When two or more apps read or write the same kind of data, like + posts, follows or playlists, it shows up here so you can find apps + that work together. + + + )} + ); } diff --git a/src/routes/_header-layout.apps.tags.tsx b/src/routes/_header-layout.apps.tags.tsx index 59be0e6..f3bbf4c 100644 --- a/src/routes/_header-layout.apps.tags.tsx +++ b/src/routes/_header-layout.apps.tags.tsx @@ -1,25 +1,13 @@ import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; -import { createFileRoute, createLink } from "@tanstack/react-router"; -import { ChevronLeft } from "lucide-react"; +import { createFileRoute } from "@tanstack/react-router"; -import { AppTagCard } from "../components/AppTagCard"; -import { AppTagHero } from "../components/AppTagHero"; -import { Flex } from "../design-system/flex"; -import { Grid } from "../design-system/grid"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; -import { breakpoints } from "../design-system/theme/media-queries.stylex"; -import { - gap, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Body } from "../design-system/typography"; +import { TagIndex } from "../components/shelf/discovery/TagIndex"; +import { MoreLink, PageHero } from "../components/shelf/Section"; +import { uiColor } from "../design-system/theme/color.stylex"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { buildRouteOgMeta } from "../lib/og-meta"; -const LinkLink = createLink(Link); - export const Route = createFileRoute("/_header-layout/apps/tags")({ loader: ({ context }) => context.queryClient.ensureQueryData( @@ -35,30 +23,13 @@ export const Route = createFileRoute("/_header-layout/apps/tags")({ }); const styles = stylex.create({ - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], - }, - navLinks: { - flexWrap: "wrap", - }, - categoriesGrid: { - gap: gap["2xl"], - display: "grid", - gridTemplateColumns: { - default: "repeat(2, minmax(0, 1fr))", - [breakpoints.lg]: "repeat(4, minmax(0, 1fr))", - }, - }, - emptyState: { - gap: gap["lg"], - maxWidth: "40rem", - }, - gap: { - gap: { - default: 40, - [breakpoints.sm]: 64, - }, + empty: { + margin: 0, + color: uiColor.text1, + borderTopColor: uiColor.text2, + borderTopStyle: "solid", + borderTopWidth: 1, + paddingTop: 24, }, }); @@ -68,39 +39,21 @@ function AppsAllPage() { ); return ( - - - - - - - Home - - - All apps - - - - - - {groups.length > 0 ? ( - - {groups.map((group) => ( - - ))} - - ) : ( - - - No tagged app listings are available yet. - - - )} - - + <> + All apps} + /> + + {groups.length > 0 ? ( + + ) : ( +

    + No tagged app listings are available yet. +

    + )} + ); } diff --git a/src/routes/_header-layout.ecosystems.$app.index.tsx b/src/routes/_header-layout.ecosystems.$app.index.tsx index ffb7f73..ac1b28d 100644 --- a/src/routes/_header-layout.ecosystems.$app.index.tsx +++ b/src/routes/_header-layout.ecosystems.$app.index.tsx @@ -1,41 +1,29 @@ import * as stylex from "@stylexjs/stylex"; import { useSuspenseQuery } from "@tanstack/react-query"; -import { createFileRoute, createLink, notFound } from "@tanstack/react-router"; -import { ChevronLeft } from "lucide-react"; +import { createFileRoute, notFound } from "@tanstack/react-router"; -import type { DirectoryCategoryTreeNode } from "../lib/directory-categories"; - -import { AppCard } from "../components/AppCard"; -import { AppTagHero } from "../components/AppTagHero"; -import { FeaturedListingGrid } from "../components/FeaturedListingGrid"; -import { Button } from "../design-system/button"; -import { Flex } from "../design-system/flex"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; -import { breakpoints } from "../design-system/theme/media-queries.stylex"; import { - gap, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { Body, Heading1 } from "../design-system/typography"; -import { Text } from "../design-system/typography/text"; + EcosystemBranchSection, + EcosystemJumpLinks, + EcosystemRootCard, +} from "../components/shelf/discovery/Ecosystem"; +import { getEcosystemIntro } from "../components/shelf/discovery/ecosystem-copy"; +import { BackLink, MoreLink, PageHero } from "../components/shelf/Section"; +import { uiColor } from "../design-system/theme/color.stylex"; +import { fontFamily, fontWeight } from "../design-system/theme/typography.stylex"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { getAppEcosystemCategoryIdFromRouteParam, getAppSegmentFromEcosystemRootCategoryId, } from "../lib/directory-categories"; +import { getDirectoryListingSlug } from "../lib/directory-listing-slugs"; import { formatEcosystemListingCount, getListingsForCategoryBranch, pickListingImageForCategoryBranch, } from "../lib/ecosystem-listings"; -import { FEATURED_LISTING_BLOCK_SIZE } from "../lib/featured-listing-grid"; import { buildRouteOgMeta } from "../lib/og-meta"; -const ButtonLink = createLink(Button); -const AppLink = createLink(Link); -const INITIAL_SECTION_LISTING_COUNT = 6; - export const Route = createFileRoute("/_header-layout/ecosystems/$app/")({ loader: async ({ context, params }) => { const categoryId = getAppEcosystemCategoryIdFromRouteParam(params.app); @@ -76,45 +64,28 @@ export const Route = createFileRoute("/_header-layout/ecosystems/$app/")({ }); const styles = stylex.create({ - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], - }, - navLinks: { - flexWrap: "wrap", - }, - sectionList: { - gap: gap["8xl"], - }, - section: { - gap: gap["3xl"], - }, - sectionHeader: { - flexWrap: "wrap", - justifyContent: "space-between", + empty: { + padding: 32, + borderColor: uiColor.border2, + borderRadius: 20, + borderStyle: "dashed", + borderWidth: 1, + color: uiColor.text1, + display: "flex", + flexDirection: "column", + rowGap: 12, + marginTop: 24, }, - sectionTitle: { - flexGrow: 1, + emptyTitle: { + margin: 0, + color: uiColor.text2, + fontFamily: fontFamily.title, + fontSize: 22, + fontWeight: fontWeight.bold, + letterSpacing: "-0.03em", }, - sectionEyebrow: { - letterSpacing: "0.16em", - textTransform: "uppercase", - }, - sectionDescription: { - maxWidth: "44rem", - }, - sectionGrid: { - gap: gap["lg"], - }, - emptyState: { - gap: gap["lg"], - maxWidth: "40rem", - }, - pageContent: { - gap: { - default: 40, - [breakpoints.sm]: 64, - }, + emptyText: { + margin: 0, }, }); @@ -142,123 +113,69 @@ function EcosystemIndexPage() { } const { category, listings } = data; - const heroImage = pickListingImageForCategoryBranch(category.id, listings); - const categorySections = category.children + const branches = category.children .map((child) => ({ category: child, listings: getListingsForCategoryBranch(child.id, listings), })) - .filter((section) => section.listings.length > 0) - .map((section, index) => ({ - ...section, - // The first section leads with a large card (one large + three beside - // it + a row of three); later sections are two plain rows of three. - listings: section.listings.slice( - 0, - index === 0 - ? FEATURED_LISTING_BLOCK_SIZE - : INITIAL_SECTION_LISTING_COUNT, - ), - })); + .filter((branch) => branch.listings.length > 0); + + // The ecosystem's own app (e.g. Bluesky for apps/bluesky), shown beside the hero. + const rootListing = + listings.find( + (listing) => getDirectoryListingSlug(listing) === appSegment, + ) ?? + listings.find( + (listing) => + listing.categorySlugs.includes(category.id) && + listing.name.toLowerCase() === category.label.toLowerCase(), + ); return ( - - - - - + - {category.label} - - - - All tools - - + + ) + } + eyebrow={formatEcosystemListingCount(category.count)} + title={`${category.label} ecosystem`} + description={getEcosystemIntro(category)} + aside={rootListing ? : null} + /> - 0 ? ( + <> + branch.category)} + allId={category.id} /> - - - {categorySections.length > 0 ? ( - - {categorySections.map((section, index) => ( - - ))} - - ) : ( - - Categories - - This ecosystem does not have nested category sections yet. - - - Search all listings in this ecosystem - - - )} - - - ); -} - -function EcosystemCategorySection({ - category, - listings, - sectionIndex, -}: { - category: DirectoryCategoryTreeNode; - listings: ReturnType; - sectionIndex: number; -}) { - return ( - - - - - - {formatEcosystemListingCount(category.count)} - - - {category.label} - - - {category.description} - - - - View all - - - - - `${category.id}-${listing.id}`} - canFeature={(listing) => Boolean(listing.heroImageUrl)} - style={styles.sectionGrid} - renderItem={(listing, { featured }) => ( - - )} - /> - + {branches.map((branch, index) => ( + + ))} + + ) : ( +
    +

    Categories

    +

    + This ecosystem does not have nested category sections yet. +

    + + Search all listings in this ecosystem + +
    + )} + ); } diff --git a/src/routes/_header-layout.games.index.tsx b/src/routes/_header-layout.games.index.tsx index 59e61a2..4ceb2cd 100644 --- a/src/routes/_header-layout.games.index.tsx +++ b/src/routes/_header-layout.games.index.tsx @@ -8,9 +8,8 @@ import { z } from "zod"; import type { DirectoryGameCard } from "../integrations/tanstack-query/api-directory-listings.functions"; import type { GameStatus } from "../lib/atproto/game-define-record"; -import { DetailedAppRow } from "../components/AppListRow"; -import { AppTagHero } from "../components/AppTagHero"; -import { Badge } from "../design-system/badge"; +import { GameFeature, GameTile } from "../components/shelf/discovery/Games"; +import { PageHero } from "../components/shelf/Section"; import { Button } from "../design-system/button"; import { EmptyState, @@ -19,27 +18,20 @@ import { EmptyStateImage, EmptyStateTitle, } from "../design-system/empty-state"; -import { Flex } from "../design-system/flex"; -import { Link } from "../design-system/link"; -import { Page } from "../design-system/page"; import { SearchField } from "../design-system/search-field"; import { SegmentedControl, SegmentedControlItem, } from "../design-system/segmented-control"; -import { Select, SelectItem } from "../design-system/select"; import { uiColor } from "../design-system/theme/color.stylex"; -import { verticalSpace } from "../design-system/theme/semantic-spacing.stylex"; -import { SmallBody } from "../design-system/typography"; +import { breakpoints } from "../design-system/theme/media-queries.stylex"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; -import { getAppTagAccent, getAppTagEmoji } from "../lib/app-tag-visuals"; import { ATMOSPHERE_GAMES_URL, GAMES_APP_TAG_SLUG, GAME_STATUS_LABELS, GAME_STATUS_ORDER, getGameStatus, - getGameStatusBadgeVariant, } from "../lib/game-listing"; import { buildAppTagOgImageUrl, buildRouteOgMeta } from "../lib/og-meta"; @@ -101,39 +93,53 @@ export const Route = createFileRoute("/_header-layout/games/")({ }); const styles = stylex.create({ - page: { - paddingBottom: verticalSpace["10xl"], - paddingTop: verticalSpace["6xl"], + credit: { + textDecoration: "underline", + color: "inherit", + textDecorationColor: { default: uiColor.border2, ":hover": uiColor.text1 }, + textUnderlineOffset: 3, }, toolbar: { - flexWrap: "wrap", + alignItems: "center", + columnGap: 10, + display: "flex", + flexWrap: { default: "wrap", [breakpoints.md]: "nowrap" }, + rowGap: 10, + marginTop: 40, + }, + toolbarFirst: { + marginTop: 0, }, searchField: { - flexBasis: "16rem", + flexBasis: { default: "100%", [breakpoints.md]: "auto" }, flexGrow: 1, }, - sortSelect: { - minWidth: "12rem", - }, - statusFilter: { + filters: { maxWidth: "100%", overflowX: "auto", }, - resultCount: { + statusRow: { + marginTop: 10, + }, + count: { color: uiColor.text1, + fontSize: 13, + fontVariantNumeric: "tabular-nums", + marginBottom: 12, + marginTop: 20, }, - // Rows carry the spacing between them (see DetailedAppRow); pull the list - // out by that amount so the first and last rows line up with the toolbar. - results: { + grid: { + margin: 0, padding: 0, listStyle: "none", - marginBottom: `calc(${verticalSpace.sm} * -1)`, - marginLeft: 0, - marginRight: 0, - marginTop: `calc(${verticalSpace.sm} * -1)`, - }, - emptyState: { - padding: verticalSpace["10xl"], + columnGap: { default: 12, [breakpoints.md]: 16 }, + display: "grid", + gridTemplateColumns: { + default: "repeat(2, minmax(0, 1fr))", + [breakpoints.lg]: "repeat(3, minmax(0, 1fr))", + [breakpoints.xl]: "repeat(4, minmax(0, 1fr))", + }, + rowGap: { default: 24, [breakpoints.md]: 32 }, }, }); @@ -210,142 +216,127 @@ function GamesPage() { }); }; + // Lead with the most popular game that has cover art, but only on the unfiltered default view. + const featured = + sort === "popular" && !query && !search.status + ? results.find((game) => game.heroImageUrl) + : undefined; + return ( - - - - - - Listed from{" "} - + + Games built on the AT Protocol: play with your Atmosphere account + and keep your progress in your own repo. Listed from{" "} + atmosphere.games - + , the AT Protocol games directory. - - - - - -
    - -
    - -
    + + } + /> - {statusFilters.length > 1 ? ( - { - const [key] = keys; - const next = GAME_STATUS_ORDER.find((id) => id === key); - updateSearch({ status: next }); - }} - > - - {`All (${games.length})`} - - {statusFilters.map((status) => ( - - {`${GAME_STATUS_LABELS[status]} (${statusCounts.get(status) ?? 0})`} - - ))} - - ) : null} + {featured ? : null} - - {results.length === games.length - ? `${games.length} ${games.length === 1 ? "game" : "games"}` - : `${results.length} of ${games.length} games`} - +
    +
    + +
    + { + const [key] = keys; + const next = GAME_SORTS.find((id) => id === key); + if (!next) return; + updateSearch({ sort: next === "popular" ? undefined : next }); + }} + > + {sortOptions.map((option) => ( + + {option.label} + + ))} + +
    - {results.length > 0 ? ( -
      - {results.map((game) => ( -
    • - -
    • - ))} -
    - ) : ( - - - - - - {games.length === 0 - ? "No games listed yet" - : "No games match these filters"} - - - {games.length === 0 - ? "Games published on atmosphere.games will show up here." - : "Try another status or search for something broader."} - - {games.length > 0 ? ( - - - - ) : null} - - )} -
    -
    -
    - ); -} + {statusFilters.length > 1 ? ( +
    + { + const [key] = keys; + const next = GAME_STATUS_ORDER.find((id) => id === key); + updateSearch({ status: next }); + }} + > + + {`All (${games.length})`} + + {statusFilters.map((status) => ( + + {`${GAME_STATUS_LABELS[status]} (${statusCounts.get(status) ?? 0})`} + + ))} + +
    + ) : null} -/** - * The shared browse row. Games are all tagged `games`, so the row shows the developer's own - * genre tags instead, and a status badge for anything that isn't simply live. - */ -function GameRow({ game }: { game: DirectoryGameCard }) { - const status = getGameStatus(game.gameStatus); +
    + {results.length === games.length + ? `${games.length} ${games.length === 1 ? "game" : "games"}` + : `${results.length} of ${games.length} games`} +
    - return ( - - {GAME_STATUS_LABELS[status]} - - ) - } - /> + {results.length > 0 ? ( +
      + {results.map((game) => ( +
    • + +
    • + ))} +
    + ) : ( + + + + + + {games.length === 0 + ? "No games listed yet" + : "No games match these filters"} + + + {games.length === 0 + ? "Games published on atmosphere.games will show up here." + : "Try another status or search for something broader."} + + {games.length > 0 ? ( + + + + ) : null} + + )} + ); } From 5ebd9201961614ca3c3a47ea86893fee20bb4740 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:37:49 -0800 Subject: [PATCH 08/18] Match the games sort control to the search field height Co-Authored-By: Claude Opus 5.5 --- src/routes/_header-layout.games.index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/_header-layout.games.index.tsx b/src/routes/_header-layout.games.index.tsx index 4ceb2cd..55c749c 100644 --- a/src/routes/_header-layout.games.index.tsx +++ b/src/routes/_header-layout.games.index.tsx @@ -252,6 +252,7 @@ function GamesPage() { { From 4061cb6353ce0719e5abfe580a51e36138024c4e Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Wed, 11 Nov 2026 14:41:21 -0800 Subject: [PATCH 09/18] Rebuild the listing page and its sub-pages in Shelf Listing: breadcrumbs, a large icon header with favorite and open actions, a single wide hero frame, About with read-more, a screenshot grid that opens the lightbox (no carousel), the reviews block, updates and mentions, and a sticky sidebar with facts, permissions, funding and a provenance card (published by the developer, or claim this listing). Reviews: a summary card with a rating distribution, a client-side sort and restyled review cards; write and edit share one form card. Mentions and compatible-apps pages use the Shelf page hero and cards. The review preview shows 4 reviews instead of 2. Co-Authored-By: Claude Opus 5.5 --- src/components/BlueskyMentionCard.tsx | 335 ++-- src/components/DirectoryListingReviewCard.tsx | 1180 ++++++------ src/components/EcosystemCategoryCard.tsx | 291 +-- src/components/GameDetailsPanel.tsx | 517 ++--- src/components/GermNetworkBadge.tsx | 53 +- src/components/HeroImage.tsx | 111 +- .../ListingOAuthScopesPopoverChip.tsx | 42 +- src/components/funding-popover-chip.tsx | 34 +- .../restricted-markdown-content.tsx | 36 +- .../shelf/listing/ExpandableDescription.tsx | 72 + .../shelf/listing/ListingHeader.tsx | 376 ++++ src/components/shelf/listing/ListingParts.tsx | 359 ++++ .../shelf/listing/ListingReviewsBlock.tsx | 195 ++ .../shelf/listing/ListingSidebar.tsx | 301 +++ .../shelf/listing/ReviewFormCard.tsx | 275 +++ .../shelf/listing/ScreenshotGallery.tsx | 118 ++ .../shelf/listing/listing-helpers.ts | 177 ++ src/lib/product-reviews-route.tsx | 118 +- src/lib/product-reviews.ts | 2 +- ...eader-layout.products.$productId.index.tsx | 1672 +++++------------ ...products.$productId.lexicon-compatible.tsx | 293 ++- ...er-layout.products.$productId.mentions.tsx | 59 +- ...ucts.$productId.reviews.$reviewId.edit.tsx | 141 +- ...yout.products.$productId.reviews.index.tsx | 314 +++- ...yout.products.$productId.reviews.write.tsx | 135 +- 25 files changed, 4101 insertions(+), 3105 deletions(-) create mode 100644 src/components/shelf/listing/ExpandableDescription.tsx create mode 100644 src/components/shelf/listing/ListingHeader.tsx create mode 100644 src/components/shelf/listing/ListingParts.tsx create mode 100644 src/components/shelf/listing/ListingReviewsBlock.tsx create mode 100644 src/components/shelf/listing/ListingSidebar.tsx create mode 100644 src/components/shelf/listing/ReviewFormCard.tsx create mode 100644 src/components/shelf/listing/ScreenshotGallery.tsx create mode 100644 src/components/shelf/listing/listing-helpers.ts diff --git a/src/components/BlueskyMentionCard.tsx b/src/components/BlueskyMentionCard.tsx index 729a90d..e0b9c50 100644 --- a/src/components/BlueskyMentionCard.tsx +++ b/src/components/BlueskyMentionCard.tsx @@ -2,104 +2,166 @@ import type { ReactNode } from "react"; import { RichText } from "@atproto/api"; import * as stylex from "@stylexjs/stylex"; -import { Link as RouterLink, createLink } from "@tanstack/react-router"; -import { IconButton } from "#/design-system/icon-button"; -import { ExternalLink } from "lucide-react"; +import { Link as RouterLink } from "@tanstack/react-router"; +import { ArrowUpRight } from "lucide-react"; import type { DirectoryListingMention } from "../integrations/tanstack-query/api-directory-listings.functions"; import { Avatar } from "../design-system/avatar"; -import { - Card, - CardBody, - CardHeader, - CardHeaderAction, -} from "../design-system/card"; -import { Flex } from "../design-system/flex"; +import { animationDuration } from "../design-system/theme/animations.stylex"; import { uiColor } from "../design-system/theme/color.stylex"; -import { radius } from "../design-system/theme/radius.stylex"; -import { verticalSpace } from "../design-system/theme/semantic-spacing.stylex"; -import { Body, SmallBody } from "../design-system/typography"; -import { Text } from "../design-system/typography/text"; +import { breakpoints } from "../design-system/theme/media-queries.stylex"; +import { fontWeight } from "../design-system/theme/typography.stylex"; import { getInitials } from "../lib/get-initials"; - -const IconButtonLink = createLink(IconButton); +import { formatReviewDate } from "./shelf/listing/listing-helpers"; const styles = stylex.create({ - mentionCard: { - borderColor: uiColor.component2, - borderBottomLeftRadius: { - default: 0, - ":last-child": radius.lg, - }, - borderBottomRightRadius: { - default: 0, - ":last-child": radius.lg, - }, - borderTopLeftRadius: { - default: 0, - ":first-child": radius.lg, - }, - borderTopRightRadius: { - default: 0, - ":first-child": radius.lg, - }, - borderTopWidth: { - default: 0, - ":first-child": 1, - }, + row: { + paddingBlock: 20, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, }, - mentionProfileLink: { - borderRadius: radius.md, - textDecoration: "none", - color: "inherit", - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", - outlineOffset: 2, + who: { + alignItems: "center", + columnGap: 12, + display: "flex", minWidth: 0, }, - mentionAuthorRow: { - minWidth: 0, + avatarLink: { + borderRadius: "50%", + display: "block", + flexShrink: 0, + }, + avatar: { + borderRadius: "50%", + height: 38, + width: 38, }, - mentionAuthorTextColumn: { + whoText: { + flexBasis: 0, + flexGrow: 1, minWidth: 0, }, - mentionPostText: { - paddingTop: verticalSpace["md"], + name: { + overflow: "hidden", + color: uiColor.text2, + display: "block", + fontSize: 15, + fontWeight: fontWeight.semibold, + textDecorationLine: { default: "none", ":hover": "underline" }, + textOverflow: "ellipsis", + textUnderlineOffset: 3, + whiteSpace: "nowrap", + }, + sub: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + marginTop: 1, + }, + open: { + borderRadius: 999, + alignItems: "center", + backgroundColor: { + default: "transparent", + ":hover": uiColor.component1, + }, + color: { + default: uiColor.text1, + ":hover": uiColor.text2, + }, + display: "inline-flex", + flexShrink: 0, + justifyContent: "center", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + transitionDuration: animationDuration.default, + transitionProperty: "background-color, color", + height: 32, + width: 32, }, postText: { + color: uiColor.text2, + fontSize: { default: 15, [breakpoints.md]: 16 }, + lineHeight: 1.6, + overflowWrap: "anywhere", whiteSpace: "pre-wrap", + marginBottom: 0, + marginTop: 12, }, facetLink: { - textDecoration: "underline", - color: uiColor.solid1, + color: uiColor.text2, + textDecorationColor: uiColor.border3, + textDecorationLine: "underline", + textUnderlineOffset: 3, }, embedCard: { - borderColor: uiColor.component2, - borderRadius: radius.md, + borderColor: { + default: uiColor.border1, + ":hover": uiColor.border2, + }, + borderRadius: 14, borderStyle: "solid", borderWidth: 1, overflow: "hidden", textDecoration: "none", + backgroundColor: uiColor.bg, color: "inherit", - maxWidth: 400, + display: "block", + transitionDuration: animationDuration.default, + transitionProperty: "border-color", + marginTop: 12, + maxWidth: 420, }, embedThumb: { - aspectRatio: 16 / 9, display: "block", objectFit: "cover", - height: 120, + height: 140, width: "100%", }, embedBody: { - padding: verticalSpace["3xl"], + paddingBlock: 12, + paddingInline: 14, + display: "flex", + flexDirection: "column", + rowGap: 4, + }, + embedTitle: { + color: uiColor.text2, + fontSize: 14, + fontWeight: fontWeight.semibold, + }, + embedDescription: { + overflow: "hidden", + WebkitBoxOrient: "vertical", + WebkitLineClamp: 2, + color: uiColor.text1, + display: "-webkit-box", + fontSize: 13, + lineHeight: 1.45, }, embedUrl: { - overflowWrap: "anywhere", + overflow: "hidden", + color: uiColor.text1, + fontSize: 12, + textOverflow: "ellipsis", + whiteSpace: "nowrap", }, }); +function hostOf(uri: string) { + try { + return new URL(uri).hostname.replace(/^www\./, ""); + } catch { + return uri; + } +} + function mentionAuthorLabel(mention: DirectoryListingMention): string { return ( mention.authorDisplayName?.trim() || @@ -115,7 +177,7 @@ function renderPostText(mention: DirectoryListingMention) { if (!text) return null; const facets = mention.postFacets; if (!facets || facets.length === 0) { - return {text}; + return

    {text}

    ; } const richText = new RichText({ @@ -172,9 +234,10 @@ function renderPostText(mention: DirectoryListingMention) { parts.push({segment.text}); } - return {parts}; + return

    {parts}

    ; } +/** A Bluesky post that mentions a listing, as a row between hairlines. */ export function BlueskyMentionCard({ mention, }: { @@ -184,94 +247,84 @@ export function BlueskyMentionCard({ const authorLabel = mentionAuthorLabel(mention); const handlePlain = mention.authorHandle?.replace(/^@/, "").trim() ?? ""; const displayName = mention.authorDisplayName?.trim(); - const showHandleSubline = - Boolean(displayName) && + const showHandle = handlePlain.length > 0 && (displayName ?? "").toLowerCase() !== handlePlain.toLowerCase(); const embed = mention.postEmbed; + return ( - - +
    +
    - - - - - {authorLabel} - - {showHandleSubline ? ( - - @{handlePlain} - - ) : null} - - + - - {href ? ( - - - - ) : null} - - - - - {renderPostText(mention)} - {embed ? ( - - {embed.thumbUrl ? ( - - ) : null} - - {embed.title ? ( - - {embed.title} - - ) : null} - {embed.description ? ( - {embed.description} - ) : null} - - {embed.uri} - - - +
    + + {authorLabel} + +
    + {showHandle ? `@${handlePlain} · ` : ""} + +
    +
    + {href ? ( + + + + ) : null} +
    + {renderPostText(mention)} + {embed ? ( + + {embed.thumbUrl ? ( + ) : null} - - {Intl.DateTimeFormat("en-US", { - dateStyle: "short", - timeStyle: "short", - }).format(new Date(mention.postCreatedAt))} - - - - + + {embed.title ? ( + {embed.title} + ) : null} + {embed.description ? ( + + {embed.description} + + ) : null} + {hostOf(embed.uri)} + + + ) : null} +
    ); } diff --git a/src/components/DirectoryListingReviewCard.tsx b/src/components/DirectoryListingReviewCard.tsx index c2b6b35..49ca6d4 100644 --- a/src/components/DirectoryListingReviewCard.tsx +++ b/src/components/DirectoryListingReviewCard.tsx @@ -3,11 +3,10 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Link as TanstackLink, createLink } from "@tanstack/react-router"; import { ChevronDown, - ChevronUp, MessageCircle, - MoreVertical, + MoreHorizontal, Pencil, - Share2, + Share, Trash2, } from "lucide-react"; import { useState } from "react"; @@ -33,191 +32,276 @@ import { } from "../design-system/alert-dialog"; import { Avatar } from "../design-system/avatar"; import { Button } from "../design-system/button"; -import { - Card, - CardBody, - CardHeader, - CardHeaderAction, -} from "../design-system/card"; -import { Flex } from "../design-system/flex"; import { Form } from "../design-system/form"; import { IconButton } from "../design-system/icon-button"; import { Menu, MenuItem } from "../design-system/menu"; import { StarRating } from "../design-system/star-rating"; import { TextArea } from "../design-system/text-area"; +import { animationDuration } from "../design-system/theme/animations.stylex"; import { uiColor } from "../design-system/theme/color.stylex"; -import { radius } from "../design-system/theme/radius.stylex"; -import { - gap, - horizontalSpace, - size, - verticalSpace, -} from "../design-system/theme/semantic-spacing.stylex"; -import { shadow } from "../design-system/theme/shadow.stylex"; -import { fontSize } from "../design-system/theme/typography.stylex"; -import { Text } from "../design-system/typography/text"; +import { breakpoints } from "../design-system/theme/media-queries.stylex"; +import { fontWeight } from "../design-system/theme/typography.stylex"; import { directoryListingApi } from "../integrations/tanstack-query/api-directory-listings.functions"; import { blueskyReviewShareIntentHref } from "../lib/bluesky-review-share"; import { getDirectoryListingSlug } from "../lib/directory-listing-slugs"; import { getInitials } from "../lib/get-initials"; import { RestrictedMarkdownContent } from "./restricted-markdown-content"; +import { formatReviewDate } from "./shelf/listing/listing-helpers"; +import { ListingIcon } from "./shelf/ListingIcon"; const IconButtonLink = createLink(IconButton); +const fullDate = new Intl.DateTimeFormat("en-US", { + dateStyle: "medium", + timeStyle: "short", +}); + +function formatFullDate(iso: string) { + const time = Date.parse(iso); + return Number.isNaN(time) ? "" : fullDate.format(time); +} + const styles = stylex.create({ - repliesDisclosure: { - paddingTop: gap["xl"], + /** Default: a flat row between hairlines, for review lists. */ + row: { + paddingBlock: 22, + borderTopColor: uiColor.border1, + borderTopStyle: "solid", + borderTopWidth: 1, + scrollMarginTop: 96, }, - reviewedListingCardBody: { - paddingBottom: verticalSpace["xl"], - paddingTop: verticalSpace["xl"], + /** With `reviewedListing`: a standalone card (profile grids). */ + card: { + padding: 20, + borderColor: uiColor.border1, + borderRadius: 18, + borderStyle: "solid", + borderWidth: 1, + backgroundColor: uiColor.bg, + minWidth: 0, + scrollMarginTop: 96, }, - reviewCard: { - boxShadow: shadow.sm, - height: "100%", + forLink: { + textDecoration: "none", + alignItems: "center", + color: "inherit", + columnGap: 12, + display: "flex", + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, + borderBottomColor: uiColor.border1, + borderBottomStyle: "solid", + borderBottomWidth: 1, + marginBottom: 14, + minWidth: 0, + paddingBottom: 14, }, - reviewCardBody: { - gap: gap["5xl"], - height: "100%", + forText: { + display: "flex", + flexDirection: "column", + fontSize: 14, + minWidth: 0, }, - reviewHeader: { + forName: { + color: { + default: uiColor.text2, + ":hover": uiColor.text1, + }, + fontWeight: fontWeight.semibold, + }, + forTagline: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + }, + who: { alignItems: "center", + columnGap: 12, + display: "flex", + minWidth: 0, }, - reviewAuthor: { - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", + whoText: { + flexBasis: 0, + flexGrow: 1, minWidth: 0, }, - reviewMeta: { - color: uiColor.text1, + avatar: { + borderRadius: "50%", + flexShrink: 0, + height: 38, + width: 38, }, - reviewQuoteParagraph: { - fontSize: fontSize["lg"], + avatarSmall: { + borderRadius: "50%", + flexShrink: 0, + height: 28, + width: 28, }, - ratingActions: { - gap: gap.sm, - alignItems: "center", + avatarLink: { + borderRadius: "50%", + display: "block", flexShrink: 0, + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { default: "none", ":focus-visible": "solid" }, + outlineWidth: 2, }, - /** Inert trigger so `AlertDialog` can be opened only via `isOpen` (e.g. from the menu). */ - dialogTriggerPlaceholder: { - margin: -1, - padding: 0, - borderWidth: 0, + name: { overflow: "hidden", - clip: "rect(0, 0, 0, 0)", - position: "absolute", + textDecoration: "none", + color: uiColor.text2, + display: "block", + fontSize: 15, + fontWeight: fontWeight.semibold, + textDecorationLine: { default: "none", ":hover": "underline" }, + textOverflow: "ellipsis", + textUnderlineOffset: 3, whiteSpace: "nowrap", - height: 1, - width: 1, }, - profileLink: { - borderRadius: radius.md, - textDecoration: "none", - color: "inherit", - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", - outlineOffset: 2, - minWidth: 0, + sub: { + overflow: "hidden", + color: uiColor.text1, + fontSize: 13, + textOverflow: "ellipsis", + whiteSpace: "nowrap", + marginTop: 1, }, - authorLinkRow: { - gap: gap["xl"], + right: { alignItems: "center", - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", - minWidth: 0, + columnGap: 2, + display: "flex", + flexShrink: 0, + marginLeft: "auto", }, - reviewSubjectLink: { - textDecoration: "none", - color: "inherit", - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", - minWidth: 0, + stars: { + marginRight: 6, }, - reviewSubjectMedia: { - gap: gap["2xl"], - alignItems: "center", - flexBasis: "0%", - flexGrow: "1", - flexShrink: "1", - minWidth: 0, + ghostIcon: { + color: uiColor.text1, }, - listingTagline: { - overflow: "hidden", - WebkitBoxOrient: "vertical", - WebkitLineClamp: 2, - display: "-webkit-box", + text: { + marginTop: 12, }, - replySection: { - gap: gap.md, - borderTopColor: uiColor.component3, - borderTopStyle: "solid", - borderTopWidth: 1, - paddingTop: verticalSpace.lg, + paragraph: { + color: uiColor.text2, + fontSize: { default: 15, [breakpoints.md]: 16 }, + lineHeight: 1.6, + whiteSpace: "pre-wrap", }, - repliesToggleRow: { - borderRadius: radius.md, + thread: { + display: "flex", + flexDirection: "column", + rowGap: 12, + marginTop: 12, + }, + repliesToggle: { + borderRadius: 999, borderWidth: 0, - gap: gap["2xl"], + paddingBlock: 5, + paddingInline: 12, alignItems: "center", - backgroundColor: "transparent", - color: { - default: uiColor.text1, - ":is([data-hovered])": uiColor.text2, + alignSelf: "flex-start", + backgroundColor: { + default: uiColor.component1, + ":is([data-hovered])": uiColor.component2, }, + color: uiColor.text2, + columnGap: 6, cursor: "pointer", + display: "inline-flex", + fontSize: 13, + outlineColor: uiColor.text2, + outlineOffset: 2, + outlineStyle: { + default: "none", + ":is([data-focus-visible])": "solid", + }, + outlineWidth: 2, + transitionDuration: animationDuration.default, + transitionProperty: "background-color", + }, + chevron: { + transform: { + default: null, + ":is([data-expanded] *)": "rotate(180deg)", + }, + transitionDuration: animationDuration.default, + transitionProperty: "transform", + }, + repliesPanel: { display: "flex", - justifyContent: "space-between", - height: size["3xl"], - paddingBottom: verticalSpace.sm, - paddingTop: verticalSpace.sm, - width: "100%", + flexDirection: "column", + rowGap: 12, + paddingTop: 12, }, - repliesToggleLeading: { - gap: gap["2xl"], + rail: { + display: "flex", + flexDirection: "column", + rowGap: 16, + borderLeftColor: uiColor.border1, + borderLeftStyle: "solid", + borderLeftWidth: 2, + marginLeft: 6, + paddingLeft: 16, + }, + reply: { + display: "flex", + flexDirection: "column", + rowGap: 8, + scrollMarginTop: 96, + }, + replyHeader: { alignItems: "center", - flexShrink: 1, + columnGap: 10, + display: "flex", minWidth: 0, }, - repliesIconWrap: { - flexShrink: 0, + replyText: { + paddingLeft: 38, }, - threadRail: { - borderLeftColor: uiColor.border1, - borderLeftStyle: "solid", - borderLeftWidth: 1, - marginLeft: horizontalSpace.sm, - paddingLeft: horizontalSpace["2xl"], + replyParagraph: { + color: uiColor.text2, + fontSize: 15, + lineHeight: 1.55, + whiteSpace: "pre-wrap", }, - replyBubble: { - borderColor: uiColor.component3, - borderRadius: radius.md, - borderStyle: "solid", - borderWidth: 1, - gap: gap["4xl"], - backgroundColor: uiColor.bgSubtle, + replyEdit: { display: "flex", flexDirection: "column", - paddingBottom: verticalSpace["4xl"], - paddingLeft: horizontalSpace["3xl"], - paddingRight: horizontalSpace["3xl"], - paddingTop: verticalSpace["2xl"], + rowGap: 8, + paddingLeft: 38, + }, + replyEditActions: { + columnGap: 8, + display: "flex", }, - replyBubbleHeaderRow: { - gap: gap["2xl"], - alignItems: "flex-start", - justifyContent: "space-between", - width: "100%", + composer: { + display: "flex", + flexDirection: "column", + rowGap: 6, }, - replyBodyParagraph: { - fontSize: fontSize.sm, + composerButton: { + marginTop: 4, }, - replyComposerButton: { - marginTop: verticalSpace["sm"], + muted: { + color: uiColor.text1, + fontSize: 13, + }, + /** Inert trigger so `AlertDialog` can be opened only via `isOpen` (e.g. from the menu). */ + dialogTriggerPlaceholder: { + margin: -1, + padding: 0, + borderWidth: 0, + overflow: "hidden", + clip: "rect(0, 0, 0, 0)", + position: "absolute", + whiteSpace: "nowrap", + height: 1, + width: 1, }, }); @@ -228,7 +312,7 @@ export type DirectoryListingReviewCardProps = { /** When set and equal to `review.authorDid`, shows the overflow menu for edit/delete. */ viewerDid?: string | null; onEditReview?: () => void; - /** Forwarded to the outer `Card` for layout contexts (e.g. grids). */ + /** Forwarded to the outer element for layout contexts (e.g. grids). */ style?: stylex.StyleXStyles; /** When true (default), avatar and name link to the reviewer profile. */ linkAuthorProfile?: boolean; @@ -391,52 +475,14 @@ function ReviewConversationSection({ }); const replies = repliesQuery.data ?? []; - const showComposerControls = showReplyComposer; - - const authorRowForReply = (reply: DirectoryListingReviewReply) => { - const label = authorLabelForReply(reply); - const handleSubtitle = replyHandleLabel(reply.authorHandle); - - const nameBlock = ( - - - - - {label} - - {handleSubtitle ? ( - - {handleSubtitle} - - ) : null} - - - ); - - return linkAuthorProfile ? ( - - {nameBlock} - - ) : ( - nameBlock - ); - }; const isReplyAuthor = (did: string) => viewerDid != null && viewerDid !== "" && viewerDid.trim() === did.trim(); const replyHeadingLabel = - review.replyCount === 1 ? "1 Reply" : `${review.replyCount} Replies`; + review.replyCount === 1 ? "1 reply" : `${review.replyCount} replies`; - const composer = showComposerControls ? ( + const composer = showReplyComposer ? (
    { e.preventDefault(); @@ -446,7 +492,7 @@ function ReviewConversationSection({ createReply.mutate(); }} > - +