From c8302736518155874743f6433ee35c3c3357ee25 Mon Sep 17 00:00:00 2001 From: Willie Zutz Date: Sun, 17 Aug 2025 12:31:30 -0600 Subject: [PATCH] feat(settings): add weather and news widget toggles in settings page --- src/app/settings/page.tsx | 82 +++++++++++++++++++ src/components/EmptyChat.tsx | 27 ++++-- src/components/MessageInput.tsx | 6 +- .../MessageInputActions/ModelSelector.tsx | 12 ++- 4 files changed, 116 insertions(+), 11 deletions(-) diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index e604e44..170a58c 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -15,6 +15,8 @@ import { ChevronRight, Eye, EyeOff, + Cloud, + LucideNewspaper, } from 'lucide-react'; import { useEffect, useState, useRef } from 'react'; import { cn } from '@/lib/utils'; @@ -226,6 +228,8 @@ export default function SettingsPage() { >(null); const [isLoading, setIsLoading] = useState(true); const [automaticSuggestions, setAutomaticSuggestions] = useState(true); + const [showWeatherWidget, setShowWeatherWidget] = useState(true); + const [showNewsWidget, setShowNewsWidget] = useState(true); const [measureUnit, setMeasureUnit] = useState<'Imperial' | 'Metric'>( 'Metric', ); @@ -322,6 +326,10 @@ export default function SettingsPage() { setAutomaticSuggestions( localStorage.getItem('autoSuggestions') !== 'false', // default to true if not set ); + setShowWeatherWidget( + localStorage.getItem('showWeatherWidget') !== 'false', + ); + setShowNewsWidget(localStorage.getItem('showNewsWidget') !== 'false'); const storedContextWindow = parseInt( localStorage.getItem('ollamaContextWindow') ?? '2048', ); @@ -762,6 +770,80 @@ export default function SettingsPage() {

Theme

+
+

Home Page Widgets

+
+
+
+
+ +
+
+

Weather Widget

+

+ Show or hide the weather widget on the home page +

+
+
+ { + setShowWeatherWidget(checked); + localStorage.setItem( + 'showWeatherWidget', + checked.toString(), + ); + }} + className={cn( + showWeatherWidget ? 'bg-accent' : 'bg-surface-2', + 'relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none', + )} + > + + +
+ +
+
+
+ +
+
+

News Widget

+

+ Show or hide the news widget on the home page +

+
+
+ { + setShowNewsWidget(checked); + localStorage.setItem( + 'showNewsWidget', + checked.toString(), + ); + }} + className={cn( + showNewsWidget ? 'bg-accent' : 'bg-surface-2', + 'relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none', + )} + > + + +
+
+

Measurement Units