mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
fix(ui): fix profile switching and improve UX
- Add key prop to ProfileEditor to force remount on profile change - Reset editorHasChanges on discard confirmation - Add text-white to destructive dialog button - Change OpenRouter default model to claude-opus-4.5
This commit is contained in:
@@ -38,7 +38,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
description: '349+ models from OpenAI, Anthropic, Google, Meta',
|
||||
baseUrl: OPENROUTER_BASE_URL,
|
||||
defaultProfileName: 'openrouter',
|
||||
defaultModel: 'anthropic/claude-sonnet-4',
|
||||
defaultModel: 'anthropic/claude-opus-4.5',
|
||||
apiKeyPlaceholder: 'sk-or-...',
|
||||
apiKeyHint: 'Get your API key at openrouter.ai/keys',
|
||||
category: 'recommended',
|
||||
|
||||
@@ -39,7 +39,7 @@ export function ConfirmDialog({
|
||||
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={onConfirm}
|
||||
className={variant === 'destructive' ? 'bg-red-600 hover:bg-red-700' : ''}
|
||||
className={variant === 'destructive' ? 'bg-red-600 hover:bg-red-700 text-white' : ''}
|
||||
>
|
||||
{confirmText}
|
||||
</AlertDialogAction>
|
||||
|
||||
@@ -34,7 +34,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
badge: '349+ models',
|
||||
featured: true,
|
||||
icon: '/icons/openrouter.svg',
|
||||
defaultModel: 'anthropic/claude-sonnet-4',
|
||||
defaultModel: 'anthropic/claude-opus-4.5',
|
||||
requiresApiKey: true,
|
||||
apiKeyPlaceholder: 'sk-or-...',
|
||||
apiKeyHint: 'Get your API key at openrouter.ai/keys',
|
||||
|
||||
@@ -220,6 +220,7 @@ export function ApiPage() {
|
||||
<div className="flex-1 flex flex-col min-w-0">
|
||||
{selectedProfileData ? (
|
||||
<ProfileEditor
|
||||
key={selectedProfileData.name}
|
||||
profileName={selectedProfileData.name}
|
||||
onDelete={() => setDeleteConfirm(selectedProfileData.name)}
|
||||
onHasChangesUpdate={setEditorHasChanges}
|
||||
@@ -266,6 +267,7 @@ export function ApiPage() {
|
||||
confirmText="Discard & Switch"
|
||||
variant="destructive"
|
||||
onConfirm={() => {
|
||||
setEditorHasChanges(false);
|
||||
setSelectedProfile(pendingSwitch);
|
||||
setPendingSwitch(null);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user