From 1d91a3f21c85ccc0cede0c3c13cb5b0eda67e629 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 30 Jul 2026 22:13:51 +0000 Subject: [PATCH] Replace native 's open options popup is rendered by the browser/OS and can't be styled at all — wrong font size, wrong colors, no brand styling whatsoever, reported as looking completely off-brand. New CustomSelect.tsx renders both the trigger and the options list as plain styled HTML (button + role="listbox" panel, keyboard nav, click-outside-to-close) instead. Co-Authored-By: Claude Sonnet 5 --- .../bestellungen/components/CustomSelect.tsx | 125 ++++++++++++++++++ .../bestellungen/components/OrderFilters.tsx | 55 +++----- 2 files changed, 142 insertions(+), 38 deletions(-) create mode 100644 app/konto/bestellungen/components/CustomSelect.tsx diff --git a/app/konto/bestellungen/components/CustomSelect.tsx b/app/konto/bestellungen/components/CustomSelect.tsx new file mode 100644 index 0000000..db026bc --- /dev/null +++ b/app/konto/bestellungen/components/CustomSelect.tsx @@ -0,0 +1,125 @@ +"use client"; + +import { useEffect, useRef, useState } from "react"; + +type Option = { value: string; label: string }; + +// A fully custom-styled dropdown — a native s in a row instead of a wall of filter chips (tried -// first, reverted 2026-07-30 — with 7 status options + 5 payment-status -// options + N years, a chip per option read as cluttered and ate a lot of -// vertical space). Client Component only for the onChange→navigate wiring; -// the actual filtering still happens server-side in page.tsx via the same -// URL search params, so this stays a plain GET-style filter (shareable/ -// bookmarkable/back-button-safe), not client-side state. +// Three custom-styled dropdowns in a row instead of a wall of filter +// chips (tried first, reverted 2026-07-30 — with 7 status options + 5 +// payment-status options + N years, a chip per option read as cluttered +// and ate a lot of vertical space) or plain native 's open options popup is +// rendered by the browser/OS and can't be styled at all, so it looked +// completely off-brand next to everything else on the page; see +// CustomSelect.tsx for the fully custom-styled replacement). Client +// Component only for the onChange→navigate wiring; the actual filtering +// still happens server-side in page.tsx via the same URL search params, +// so this stays a plain GET-style filter (shareable/bookmarkable/ +// back-button-safe), not client-side state. export function OrderFilters({ statusOptions, paymentStatusOptions, @@ -34,40 +40,13 @@ export function OrderFilters({ router.push(qs ? `/konto/bestellungen?${qs}` : "/konto/bestellungen"); } - const selectClass = - "w-full sm:w-auto min-w-0 border border-border rounded-sm px-3 py-2 text-body-sm text-text-primary bg-bg-base outline-none focus:border-brand transition-colors"; + const yearOptions = years.map((y) => ({ value: y, label: y })); return (
- - - + setParam("status", v)} /> + setParam("paymentStatus", v)} /> + setParam("year", v)} /> {hasAnyFilter && (