From 0fe25f7fb60d4dd660ddd52d6f4ccc91179c5233 Mon Sep 17 00:00:00 2001 From: zasbu <136494048+zasbu@users.noreply.github.com> Date: Mon, 9 Nov 2026 02:47:51 +1100 Subject: [PATCH] Simplify tier controls and map hover states --- web/src/features/maps/MapList.tsx | 9 ++-- web/src/ui/TierSpread.tsx | 84 ++++++++++++------------------- 2 files changed, 39 insertions(+), 54 deletions(-) diff --git a/web/src/features/maps/MapList.tsx b/web/src/features/maps/MapList.tsx index ee9f3fd..8ee848d 100644 --- a/web/src/features/maps/MapList.tsx +++ b/web/src/features/maps/MapList.tsx @@ -457,12 +457,15 @@ function MapStatsList({
  • {map.tier != null && tierCount != null && ( )} - + {map.name} {map.detail} @@ -520,7 +523,7 @@ function MapRow({ return ( diff --git a/web/src/ui/TierSpread.tsx b/web/src/ui/TierSpread.tsx index b6e0716..9e10132 100644 --- a/web/src/ui/TierSpread.tsx +++ b/web/src/ui/TierSpread.tsx @@ -1,8 +1,8 @@ -// Tier distribution and filters, with one responsive layout for every screen size. +// Map difficulty filters with matching controls for all tiers and individual tiers. import type { CSSProperties } from "react"; import { classNames } from "./classNames"; import { Link } from "./Link"; -import { TierBadge, tierColor } from "./TierBadge"; +import { tierColor } from "./TierBadge"; const number = new Intl.NumberFormat("en"); @@ -24,70 +24,52 @@ export function TierSpread({ const total = byTier.reduce((sum, count) => sum + count, untiered); if (total === 0) return null; const tierCount = byTier.length; + const choices = [ + { tier: null, count: total }, + ...byTier.map((count, index) => ({ tier: index + 1, count })), + ]; + return (

    Difficulty

    - - All tiers{" "} - {number.format(total)} - + + {number.format(total)} maps +
    -
    - {byTier.map( - (count, index) => - count > 0 && ( - - ), - )} - {untiered > 0 && } -
    -
      - {byTier.map((count, index) => { - const tier = index + 1; - const active = selected === tier; +
        + {choices.map(({ tier, count }) => { + const active = tier === (selected ?? null); return ( -
      • +
      • - - + + {tier == null ? "All tiers" : `T${tier}`} + + {number.format(count)}