@@ -162,6 +162,7 @@ export function SettingsPopup() {
162
162
/>
163
163
</ div >
164
164
165
+ < CursorLogin />
165
166
< OpenAIPanel />
166
167
< CopilotPanel />
167
168
{ /* REMOVED CODEBASE-WIDE FEATURES!
@@ -172,7 +173,6 @@ export function SettingsPopup() {
172
173
languageName = { name }
173
174
/>
174
175
) ) }
175
- < CursorLogin />
176
176
</ div >
177
177
</ div >
178
178
< div className = "cover-bar" > </ div >
@@ -209,7 +209,6 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) {
209
209
210
210
const handleNewAPIKey = useCallback ( async ( ) => {
211
211
const { models, isValidKey } = await ssel . getModels ( localAPIKey )
212
- console . log ( { models, isValidKey } )
213
212
if ( ! isValidKey ) {
214
213
// Error, and we let them know
215
214
showKeyError ( true )
@@ -219,11 +218,12 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) {
219
218
dispatch (
220
219
changeSettings ( {
221
220
openAIKey : localAPIKey ,
222
- } )
223
- )
221
+ useOpenAIKey : true ,
222
+ openAIModel : models . at ( 0 ) ?? null
223
+ } ) )
224
224
onSubmit ( )
225
225
}
226
- } , [ localAPIKey ] )
226
+ } , [ dispatch , localAPIKey ] )
227
227
228
228
return (
229
229
< div className = "settings__item" >
@@ -267,17 +267,17 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) {
267
267
? 'bg-green-500'
268
268
: 'bg-red-500'
269
269
}
270
- mt-2 relative inline-flex h-[38px ] w-[74px ] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` }
270
+ mt-2 relative inline-flex h-[25px ] w-[52px ] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` }
271
271
>
272
272
< span className = "sr-only" > Use setting</ span >
273
273
< span
274
274
aria-hidden = "true"
275
275
className = { `${
276
276
settings . useOpenAIKey
277
- ? 'translate-x-9 '
277
+ ? 'translate-x-7 '
278
278
: 'translate-x-0'
279
279
}
280
- pointer-events-none inline-block h-[34px ] w-[34px ] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out` }
280
+ pointer-events-none inline-block h-[20px ] w-[20px ] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out` }
281
281
/>
282
282
</ Switch >
283
283
{ settings . useOpenAIKey ? (
@@ -331,28 +331,32 @@ export function OpenAIPanel() {
331
331
} , [ localAPIKey ] )
332
332
333
333
const handleNewAPIKey = useCallback ( async ( ) => {
334
+ console . log ( 'here 2' )
334
335
const { models, isValidKey } = await ssel . getModels ( localAPIKey )
335
336
console . log ( { models, isValidKey } )
336
337
if ( ! isValidKey ) {
337
338
// Error, and we let them know
339
+ console . log ( 'here 3' )
338
340
showKeyError ( true )
339
341
setAvailableModels ( [ ] )
340
342
} else {
341
343
setAvailableModels ( models )
344
+ console . log ( 'here' )
342
345
dispatch (
343
346
changeSettings ( {
344
347
openAIKey : localAPIKey ,
345
- } )
346
- )
348
+ useOpenAIKey : true ,
349
+ openAIModel : models . at ( 0 ) ?? null
350
+ } ) )
347
351
}
348
- } , [ localAPIKey ] )
352
+ } , [ dispatch , localAPIKey ] )
353
+
349
354
350
355
return (
351
356
< div className = "settings__item" >
352
357
< div className = "settings__item_title" > OpenAI API Key</ div >
353
358
< div className = "settings__item_description" >
354
- We'll use your key for any requests to OpenAI. This will help
355
- you avoid "maximum capacity" limits.
359
+ You can enter an OpenAI API key to use Cursor at-cost
356
360
</ div >
357
361
< div className = "flex" >
358
362
< input
@@ -394,17 +398,17 @@ export function OpenAIPanel() {
394
398
? 'bg-green-500'
395
399
: 'bg-red-500'
396
400
}
397
- mt-2 relative inline-flex h-[38px ] w-[74px ] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` }
401
+ mt-2 relative inline-flex h-[24px ] w-[52px ] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75` }
398
402
>
399
403
< span className = "sr-only" > Use setting</ span >
400
404
< span
401
405
aria-hidden = "true"
402
406
className = { `${
403
407
settings . useOpenAIKey
404
- ? 'translate-x-9 '
408
+ ? 'translate-x-7 '
405
409
: 'translate-x-0'
406
410
}
407
- pointer-events-none inline-block h-[34px ] w-[34px ] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out` }
411
+ pointer-events-none inline-block h-[20px ] w-[20px ] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out` }
408
412
/>
409
413
</ Switch >
410
414
{ settings . useOpenAIKey ? (
@@ -467,47 +471,61 @@ export function CursorLogin({
467
471
} else {
468
472
if ( proVersion ) {
469
473
currentPanel = (
470
- < div className = "copilot__signin" >
471
- < button onClick = { signOut } > Log out</ button >
472
- { showSettings && (
473
- < >
474
- < br />
475
- < button onClick = { openAccountSettings } >
476
- Manage settings
477
- </ button >
478
- </ >
479
- ) }
474
+ < div className = "settings__item" >
475
+ < div className = "settings__item_title" > Cursor Account</ div >
476
+ < div className = "settings__item_description" >
477
+ Login to use the AI without an API key
478
+ </ div >
479
+ < div className = "copilot__signin" >
480
+ < button onClick = { signOut } > Log out</ button >
481
+ { showSettings && (
482
+ < >
483
+ < br />
484
+ < button onClick = { openAccountSettings } >
485
+ Manage settings
486
+ </ button >
487
+ </ >
488
+ ) }
489
+ </ div >
480
490
</ div >
481
491
)
482
492
} else {
483
493
currentPanel = (
484
- < div className = "copilot__signin" >
485
- < br />
486
- < button onClick = { signOut } > Log out</ button >
487
- { showSettings && (
488
- < >
494
+ < >
495
+ < div className = "settings__item" >
496
+ < div className = "settings__item_title" > Cursor Account</ div >
497
+ < div className = "settings__item_description" >
498
+ Login to use the AI without an API key
499
+ </ div >
500
+ < div className = "copilot__signin" >
501
+ < button onClick = { signOut } > Log out</ button >
502
+ { showSettings && (
503
+ < >
504
+ < br />
505
+ < button onClick = { openAccountSettings } >
506
+ Manage settings
507
+ </ button >
508
+ </ >
509
+ ) }
489
510
< br />
490
- < button onClick = { openAccountSettings } >
491
- Manage settings
492
- </ button >
493
- </ >
494
- ) }
495
- < br />
496
- Upgrade for unlimited generations
497
- < button onClick = { upgrade } > Upgrade to Pro</ button >
498
- </ div >
511
+ </ div >
512
+ </ div >
513
+ < div className = "settings__item" >
514
+ < div className = "settings__item_title" > Cursor Pro</ div >
515
+ < div className = "settings__item_description" >
516
+ Upgrade for unlimited generations
517
+ </ div >
518
+ < div className = "copilot__signin" >
519
+ < button onClick = { upgrade } > Upgrade to Pro</ button >
520
+ </ div >
521
+ </ div >
522
+ </ >
499
523
)
500
524
}
501
525
}
502
526
503
527
return (
504
- < div className = "settings__item" >
505
- < div className = "settings__item_title" > Cursor Account</ div >
506
- < div className = "settings__item_description" >
507
- Login to use the AI without an API key
508
- </ div >
509
- { currentPanel }
510
- </ div >
528
+ currentPanel
511
529
)
512
530
}
513
531
0 commit comments