From a325f73b2f64f38efaf2fd0788c0e19f8616ae41 Mon Sep 17 00:00:00 2001 From: utopiaeh Date: Wed, 19 Aug 2026 18:52:16 +0300 Subject: [PATCH] feat: Add history vor visited sited and ability to clear for them --- components/DangerConfirmButton.tsx | 9 +- components/HistoryList.tsx | 3 + components/StatusButton.tsx | 9 +- components/VisitedSiteList.tsx | 36 +++++ components/options/PerSiteSection.tsx | 54 +++++-- components/options/VisitedSitesSection.tsx | 65 +++++++++ entrypoints/options/App.tsx | 118 ++++++++++++++- utils/clearing.firefox.test.ts | 158 +++++++++++++++++++++ utils/clearing.test.ts | 26 ++++ utils/clearing.ts | 81 ++++++----- utils/concurrency.test.ts | 43 ++++++ utils/concurrency.ts | 18 +++ utils/i18n.ts | 28 ++++ 13 files changed, 596 insertions(+), 52 deletions(-) create mode 100644 components/VisitedSiteList.tsx create mode 100644 components/options/VisitedSitesSection.tsx create mode 100644 utils/clearing.firefox.test.ts create mode 100644 utils/concurrency.test.ts create mode 100644 utils/concurrency.ts diff --git a/components/DangerConfirmButton.tsx b/components/DangerConfirmButton.tsx index 81e2507..fe3a7d0 100644 --- a/components/DangerConfirmButton.tsx +++ b/components/DangerConfirmButton.tsx @@ -9,6 +9,7 @@ interface DangerConfirmButtonProps { onConfirm: () => void; disabled?: boolean; autoCancelMs?: number; + size?: 'normal' | 'compact'; } export function DangerConfirmButton({ @@ -18,6 +19,7 @@ export function DangerConfirmButton({ onConfirm, disabled, autoCancelMs = 4000, + size = 'normal', }: DangerConfirmButtonProps) { const t = useTranslation(); const [armed, setArmed] = useState(false); @@ -45,18 +47,20 @@ export function DangerConfirmButton({ onConfirm(); } + const armedPadding = size === 'compact' ? 'px-3 py-1.5 text-xs' : 'px-3 py-2 text-sm'; + if (armed) { return (
@@ -70,6 +74,7 @@ export function DangerConfirmButton({ onClick={arm} disabled={disabled} variant="secondary" + size={size} idleLabel={idleLabel} /> ); diff --git a/components/HistoryList.tsx b/components/HistoryList.tsx index 70480f1..3f7e652 100644 --- a/components/HistoryList.tsx +++ b/components/HistoryList.tsx @@ -11,6 +11,9 @@ export function HistoryList({ items, onDelete }: HistoryListProps) { return (