fix(tracker): page update
This commit is contained in:
parent
12bcd1d8f3
commit
3f93a7dca2
|
|
@ -1,6 +1,6 @@
|
||||||
import { useState, useEffect, useMemo, useCallback } from 'react';
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
import { ChevronLeft, ChevronRight, AlertCircle, CheckCircle2, Plus, Search, RefreshCw, Landmark, ArrowUpToLine, ArrowUp, ArrowDown, BellOff, Eye, EyeOff, Settings2 } from 'lucide-react';
|
import { ChevronLeft, ChevronRight, AlertCircle, CheckCircle2, Plus, Search, RefreshCw, Landmark, ArrowUpToLine, ArrowUp, ArrowDown, BellOff, EyeOff, Settings2 } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { api } from '@/api.js';
|
import { api } from '@/api.js';
|
||||||
import { useTracker, useDriftReport } from '@/hooks/useQueries';
|
import { useTracker, useDriftReport } from '@/hooks/useQueries';
|
||||||
|
|
@ -435,15 +435,14 @@ export default function TrackerPage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideSearchSortPanel() {
|
function hideSearchSortPanel() {
|
||||||
saveTrackerSettings({
|
saveTrackerSettings({ tracker_show_search_sort: 'false' });
|
||||||
tracker_show_search_sort: 'false',
|
toast('Search & sort hidden.', {
|
||||||
}, 'Search & sort hidden.');
|
action: { label: 'Undo', onClick: () => saveTrackerSettings({ tracker_show_search_sort: 'true' }) },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSearchSortPanel() {
|
function showSearchSortPanel() {
|
||||||
saveTrackerSettings({
|
saveTrackerSettings({ tracker_show_search_sort: 'true' });
|
||||||
tracker_show_search_sort: 'true',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const toggleFilter = (key) => {
|
const toggleFilter = (key) => {
|
||||||
const paramMap = { autopay: 'ap', firstBucket: 'b1', fifteenthBucket: 'b2', unpaid: 'un', overdue: 'ov', debt: 'de' };
|
const paramMap = { autopay: 'ap', firstBucket: 'b1', fifteenthBucket: 'b2', unpaid: 'un', overdue: 'ov', debt: 'de' };
|
||||||
|
|
@ -770,30 +769,6 @@ export default function TrackerPage() {
|
||||||
</div>
|
</div>
|
||||||
</SearchFilterPanel>
|
</SearchFilterPanel>
|
||||||
)}
|
)}
|
||||||
{!showSearchSort && (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={showSearchSortPanel}
|
|
||||||
disabled={savingTrackerSetting}
|
|
||||||
className="group flex w-full items-center justify-between gap-3 rounded-xl border border-dashed border-border/80 bg-card/55 px-4 py-3 text-left shadow-sm transition-colors hover:border-primary/40 hover:bg-card/85 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
||||||
>
|
|
||||||
<span className="flex min-w-0 items-center gap-3">
|
|
||||||
<span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/15 bg-primary/10 text-primary">
|
|
||||||
<Search className="h-4 w-4" />
|
|
||||||
</span>
|
|
||||||
<span className="min-w-0">
|
|
||||||
<span className="block text-sm font-semibold text-foreground">Show Search & sort</span>
|
|
||||||
<span className="block truncate text-xs text-muted-foreground">
|
|
||||||
{[searchResultLabel, hasFilters ? 'filters active' : 'no filters', searchSortLabel].filter(Boolean).join(' · ')}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors group-hover:bg-accent group-hover:text-foreground">
|
|
||||||
<Eye className="h-3.5 w-3.5" />
|
|
||||||
Restore
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* ── Summary cards (backend already excludes skipped from totals) ── */}
|
{/* ── Summary cards (backend already excludes skipped from totals) ── */}
|
||||||
{showSummaryCards && loading ? (
|
{showSummaryCards && loading ? (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue