mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +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',
|
description: '349+ models from OpenAI, Anthropic, Google, Meta',
|
||||||
baseUrl: OPENROUTER_BASE_URL,
|
baseUrl: OPENROUTER_BASE_URL,
|
||||||
defaultProfileName: 'openrouter',
|
defaultProfileName: 'openrouter',
|
||||||
defaultModel: 'anthropic/claude-sonnet-4',
|
defaultModel: 'anthropic/claude-opus-4.5',
|
||||||
apiKeyPlaceholder: 'sk-or-...',
|
apiKeyPlaceholder: 'sk-or-...',
|
||||||
apiKeyHint: 'Get your API key at openrouter.ai/keys',
|
apiKeyHint: 'Get your API key at openrouter.ai/keys',
|
||||||
category: 'recommended',
|
category: 'recommended',
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function ConfirmDialog({
|
|||||||
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
|
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={onConfirm}
|
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}
|
{confirmText}
|
||||||
</AlertDialogAction>
|
</AlertDialogAction>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
|||||||
badge: '349+ models',
|
badge: '349+ models',
|
||||||
featured: true,
|
featured: true,
|
||||||
icon: '/icons/openrouter.svg',
|
icon: '/icons/openrouter.svg',
|
||||||
defaultModel: 'anthropic/claude-sonnet-4',
|
defaultModel: 'anthropic/claude-opus-4.5',
|
||||||
requiresApiKey: true,
|
requiresApiKey: true,
|
||||||
apiKeyPlaceholder: 'sk-or-...',
|
apiKeyPlaceholder: 'sk-or-...',
|
||||||
apiKeyHint: 'Get your API key at openrouter.ai/keys',
|
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">
|
<div className="flex-1 flex flex-col min-w-0">
|
||||||
{selectedProfileData ? (
|
{selectedProfileData ? (
|
||||||
<ProfileEditor
|
<ProfileEditor
|
||||||
|
key={selectedProfileData.name}
|
||||||
profileName={selectedProfileData.name}
|
profileName={selectedProfileData.name}
|
||||||
onDelete={() => setDeleteConfirm(selectedProfileData.name)}
|
onDelete={() => setDeleteConfirm(selectedProfileData.name)}
|
||||||
onHasChangesUpdate={setEditorHasChanges}
|
onHasChangesUpdate={setEditorHasChanges}
|
||||||
@@ -266,6 +267,7 @@ export function ApiPage() {
|
|||||||
confirmText="Discard & Switch"
|
confirmText="Discard & Switch"
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
|
setEditorHasChanges(false);
|
||||||
setSelectedProfile(pendingSwitch);
|
setSelectedProfile(pendingSwitch);
|
||||||
setPendingSwitch(null);
|
setPendingSwitch(null);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user