fix: unify theme system - fix theme switching persistence

- Unified localStorage key to 'theme-preference' across all components
- Fixed header.tsx using wrong localStorage key ('theme' instead of 'theme-preference')
- Added localStorage hybrid persistence for instant theme changes
- Removed router.refresh() which was causing stale data revert
- Replaced Blue theme with Sepia
- Consolidated auth() calls to prevent race conditions
- Updated UserSettingsData types to include all themes
This commit is contained in:
2026-01-18 22:33:41 +01:00
parent ef60dafd73
commit ddb67ba9e5
306 changed files with 59580 additions and 6063 deletions

View File

@@ -19,9 +19,10 @@ import { useLanguage } from '@/lib/i18n'
interface LabelFilterProps {
selectedLabels: string[]
onFilterChange: (labels: string[]) => void
className?: string
}
export function LabelFilter({ selectedLabels, onFilterChange }: LabelFilterProps) {
export function LabelFilter({ selectedLabels, onFilterChange, className }: LabelFilterProps) {
const { labels, loading } = useLabels()
const { t } = useLanguage()
const [allLabelNames, setAllLabelNames] = useState<string[]>([])
@@ -46,14 +47,21 @@ export function LabelFilter({ selectedLabels, onFilterChange }: LabelFilterProps
if (loading || allLabelNames.length === 0) return null
return (
<div className="flex items-center gap-2">
<div className={cn("flex items-center gap-2", className ? "" : "")}>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="sm" className="h-9">
<Filter className="h-4 w-4 mr-2" />
{t('labels.filter')}
<Button
variant="outline"
size="sm"
className={cn(
"h-10 gap-2 rounded-full border border-gray-200 bg-white hover:bg-gray-50 text-gray-700 shadow-sm font-medium",
className
)}
>
<Filter className="h-4 w-4" />
{t('labels.filter') || 'Filter'}
{selectedLabels.length > 0 && (
<Badge variant="secondary" className="ml-2 h-5 min-w-5 px-1.5">
<Badge variant="secondary" className="ml-1 h-5 min-w-5 px-1.5 rounded-full bg-gray-100">
{selectedLabels.length}
</Badge>
)}