@@ -39,6 +39,7 @@ import {
3939 selectSystemShouldEnableInformationalPopovers ,
4040 selectSystemShouldEnableModelDescriptions ,
4141 selectSystemShouldShowInvocationProgressDetail ,
42+ selectSystemShouldUseMiddleClickToOpenInNewTab ,
4243 selectSystemShouldUseNSFWChecker ,
4344 selectSystemShouldUseWatermarker ,
4445 setPrefersNumericAttentionStyle ,
@@ -47,6 +48,7 @@ import {
4748 setShouldEnableModelDescriptions ,
4849 setShouldHighlightFocusedRegions ,
4950 setShouldShowInvocationProgressDetail ,
51+ setShouldUseMiddleClickToOpenInNewTab ,
5052 shouldAntialiasProgressImageChanged ,
5153 shouldConfirmOnNewSessionToggled ,
5254 shouldUseNSFWCheckerChanged ,
@@ -100,6 +102,7 @@ const SettingsModal = (props: { children: ReactElement }) => {
100102 const shouldEnableInformationalPopovers = useAppSelector ( selectSystemShouldEnableInformationalPopovers ) ;
101103 const shouldEnableModelDescriptions = useAppSelector ( selectSystemShouldEnableModelDescriptions ) ;
102104 const shouldHighlightFocusedRegions = useAppSelector ( selectSystemShouldEnableHighlightFocusedRegions ) ;
105+ const shouldUseMiddleClickToOpenInNewTab = useAppSelector ( selectSystemShouldUseMiddleClickToOpenInNewTab ) ;
103106 const shouldConfirmOnNewSession = useAppSelector ( selectSystemShouldConfirmOnNewSession ) ;
104107 const shouldShowInvocationProgressDetail = useAppSelector ( selectSystemShouldShowInvocationProgressDetail ) ;
105108 const maxQueueHistory = runtimeConfig ?. config . max_queue_history ?? null ;
@@ -235,6 +238,13 @@ const SettingsModal = (props: { children: ReactElement }) => {
235238 [ dispatch ]
236239 ) ;
237240
241+ const handleChangeShouldUseMiddleClickToOpenInNewTab = useCallback (
242+ ( e : ChangeEvent < HTMLInputElement > ) => {
243+ dispatch ( setShouldUseMiddleClickToOpenInNewTab ( e . target . checked ) ) ;
244+ } ,
245+ [ dispatch ]
246+ ) ;
247+
238248 const handleChangePreferAttentionStyleNumeric = useCallback (
239249 ( e : ChangeEvent < HTMLInputElement > ) => {
240250 dispatch ( setPrefersNumericAttentionStyle ( e . target . checked ) ) ;
@@ -365,6 +375,13 @@ const SettingsModal = (props: { children: ReactElement }) => {
365375 onChange = { handleChangeShouldHighlightFocusedRegions }
366376 />
367377 </ FormControl >
378+ < FormControl >
379+ < FormLabel > { t ( 'settings.middleClickOpenInNewTab' ) } </ FormLabel >
380+ < Switch
381+ isChecked = { shouldUseMiddleClickToOpenInNewTab }
382+ onChange = { handleChangeShouldUseMiddleClickToOpenInNewTab }
383+ />
384+ </ FormControl >
368385 </ StickyScrollable >
369386
370387 < StickyScrollable title = { t ( 'settings.prompt' ) } >
0 commit comments