@@ -18,7 +18,7 @@ interface SettingsProps {
1818 onClose : ( ) => void ;
1919}
2020
21- type TabType = 'chat-history' | 'providers' | 'features' | 'debug' ;
21+ type TabType = 'chat-history' | 'providers' | 'features' | 'debug' | 'connection' ;
2222
2323// Providers that support base URL configuration
2424const URL_CONFIGURABLE_PROVIDERS = [ 'Ollama' , 'LMStudio' , 'OpenAILike' ] ;
@@ -32,13 +32,12 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
3232 } ) ;
3333 const [ searchTerm , setSearchTerm ] = useState ( '' ) ;
3434 const [ isDeleting , setIsDeleting ] = useState ( false ) ;
35- const [ isJustSayEnabled , setIsJustSayEnabled ] = useState ( false ) ;
35+ const [ githubUsername , setGithubUsername ] = useState ( Cookies . get ( 'githubUsername' ) || '' ) ;
36+ const [ githubToken , setGithubToken ] = useState ( Cookies . get ( 'githubToken' ) || '' ) ;
3637 const [ isLocalModelsEnabled , setIsLocalModelsEnabled ] = useState ( ( ) => {
3738 const savedLocalModelsState = Cookies . get ( 'isLocalModelsEnabled' ) ;
3839 return savedLocalModelsState === 'true' ;
3940 } ) ;
40- const [ isExperimentalFeature1Enabled , setIsExperimentalFeature1Enabled ] = useState ( false ) ;
41- const [ isExperimentalFeature2Enabled , setIsExperimentalFeature2Enabled ] = useState ( false ) ;
4241
4342 // Load base URLs from cookies
4443 const [ baseUrls , setBaseUrls ] = useState ( ( ) => {
@@ -77,6 +76,7 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
7776 { id : 'chat-history' , label : 'Chat History' , icon : 'i-ph:book' } ,
7877 { id : 'providers' , label : 'Providers' , icon : 'i-ph:key' } ,
7978 { id : 'features' , label : 'Features' , icon : 'i-ph:star' } ,
79+ { id : 'connection' , label : 'Connection' , icon : 'i-ph:link' } ,
8080 ...( isDebugEnabled ? [ { id : 'debug' as TabType , label : 'Debug Tab' , icon : 'i-ph:bug' } ] : [ ] ) ,
8181 ] ;
8282
@@ -205,7 +205,12 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
205205
206206 const versionHash = commit . commit ; // Get the version hash from commit.json
207207
208- // Update the toggle handlers to save to cookies
208+ const handleSaveConnection = ( ) => {
209+ Cookies . set ( 'githubUsername' , githubUsername ) ;
210+ Cookies . set ( 'githubToken' , githubToken ) ;
211+ toast . success ( 'GitHub credentials saved successfully!' ) ;
212+ } ;
213+
209214 const handleToggleDebug = ( enabled : boolean ) => {
210215 setIsDebugEnabled ( enabled ) ;
211216 Cookies . set ( 'isDebugEnabled' , String ( enabled ) ) ;
@@ -429,6 +434,39 @@ export const SettingsWindow = ({ open, onClose }: SettingsProps) => {
429434 < p className = "text-bolt-elements-textSecondary" > Version Hash: { versionHash } </ p >
430435 </ div >
431436 ) }
437+ { activeTab === 'connection' && (
438+ < div className = "p-4 mb-4 border border-bolt-elements-borderColor rounded-lg bg-bolt-elements-background-depth-3" >
439+ < h3 className = "text-lg font-medium text-bolt-elements-textPrimary mb-4" > GitHub Connection</ h3 >
440+ < div className = "flex mb-4" >
441+ < div className = "flex-1 mr-2" >
442+ < label className = "block text-sm text-bolt-elements-textSecondary mb-1" > GitHub Username:</ label >
443+ < input
444+ type = "text"
445+ value = { githubUsername }
446+ onChange = { ( e ) => setGithubUsername ( e . target . value ) }
447+ className = "w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px-2 py-1.5 rounded-md focus:outline-none placeholder-bolt-elements-textTertiary text-bolt-elements-textPrimary dark:text-bolt-elements-textPrimary border border-bolt-elements-borderColor"
448+ />
449+ </ div >
450+ < div className = "flex-1" >
451+ < label className = "block text-sm text-bolt-elements-textSecondary mb-1" > Personal Access Token:</ label >
452+ < input
453+ type = "password"
454+ value = { githubToken }
455+ onChange = { ( e ) => setGithubToken ( e . target . value ) }
456+ className = "w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px-2 py-1.5 rounded-md focus:outline-none placeholder-bolt-elements-textTertiary text-bolt-elements-textPrimary dark:text-bolt-elements-textPrimary border border-bolt-elements-borderColor"
457+ />
458+ </ div >
459+ </ div >
460+ < div className = "flex mb-4" >
461+ < button
462+ onClick = { handleSaveConnection }
463+ className = "bg-bolt-elements-button-primary-background rounded-lg px-4 py-2 mr-2 transition-colors duration-200 hover:bg-bolt-elements-button-primary-backgroundHover text-bolt-elements-button-primary-text"
464+ >
465+ Save Connection
466+ </ button >
467+ </ div >
468+ </ div >
469+ ) }
432470 </ div >
433471 </ div >
434472 </ div >
0 commit comments