@@ -148,6 +148,7 @@ const Page = () => {
148148 const [ automaticImageSearch , setAutomaticImageSearch ] = useState ( false ) ;
149149 const [ automaticVideoSearch , setAutomaticVideoSearch ] = useState ( false ) ;
150150 const [ systemInstructions , setSystemInstructions ] = useState < string > ( '' ) ;
151+ const [ temperatureUnit , setTemperatureUnit ] = useState < 'C' | 'F' > ( 'C' ) ;
151152 const [ savingStates , setSavingStates ] = useState < Record < string , boolean > > ( { } ) ;
152153
153154 useEffect ( ( ) => {
@@ -210,6 +211,8 @@ const Page = () => {
210211
211212 setSystemInstructions ( localStorage . getItem ( 'systemInstructions' ) ! ) ;
212213
214+ setTemperatureUnit ( localStorage . getItem ( 'temperatureUnit' ) ! as 'C' | 'F' ) ;
215+
213216 setIsLoading ( false ) ;
214217 } ;
215218
@@ -368,6 +371,8 @@ const Page = () => {
368371 localStorage . setItem ( 'embeddingModel' , value ) ;
369372 } else if ( key === 'systemInstructions' ) {
370373 localStorage . setItem ( 'systemInstructions' , value ) ;
374+ } else if ( key === 'temperatureUnit' ) {
375+ localStorage . setItem ( 'temperatureUnit' , value . toString ( ) ) ;
371376 }
372377 } catch ( err ) {
373378 console . error ( 'Failed to save:' , err ) ;
@@ -416,13 +421,35 @@ const Page = () => {
416421 ) : (
417422 config && (
418423 < div className = "flex flex-col space-y-6 pb-28 lg:pb-8" >
419- < SettingsSection title = "Appearance " >
424+ < SettingsSection title = "Preferences " >
420425 < div className = "flex flex-col space-y-1" >
421426 < p className = "text-black/70 dark:text-white/70 text-sm" >
422427 Theme
423428 </ p >
424429 < ThemeSwitcher />
425430 </ div >
431+ < div className = "flex flex-col space-y-1" >
432+ < p className = "text-black/70 dark:text-white/70 text-sm" >
433+ Temperature Unit
434+ </ p >
435+ < Select
436+ value = { temperatureUnit ?? undefined }
437+ onChange = { ( e ) => {
438+ setTemperatureUnit ( e . target . value as 'C' | 'F' ) ;
439+ saveConfig ( 'temperatureUnit' , e . target . value ) ;
440+ } }
441+ options = { [
442+ {
443+ label : 'Celsius' ,
444+ value : 'C' ,
445+ } ,
446+ {
447+ label : 'Fahrenheit' ,
448+ value : 'F' ,
449+ } ,
450+ ] }
451+ />
452+ </ div >
426453 </ SettingsSection >
427454
428455 < SettingsSection title = "Automatic Search" >
@@ -516,7 +543,7 @@ const Page = () => {
516543 < SettingsSection title = "System Instructions" >
517544 < div className = "flex flex-col space-y-4" >
518545 < Textarea
519- value = { systemInstructions }
546+ value = { systemInstructions ?? undefined }
520547 isSaving = { savingStates [ 'systemInstructions' ] }
521548 onChange = { ( e ) => {
522549 setSystemInstructions ( e . target . value ) ;
0 commit comments