From db38ccc117e59fdc9f70c584aaa569b7f70cbe4a Mon Sep 17 00:00:00 2001
From: Tam Nhu Tran
Date: Wed, 25 Feb 2026 15:53:22 +0700
Subject: [PATCH] feat(ui): support editing profile default target
- add target selector in profile editor header
- call profile update API to persist target changes
- update info panel usage snippets for target-aware commands
---
.../profiles/editor/friendly-ui-section.tsx | 5 +-
.../profiles/editor/header-section.tsx | 27 ++++++++++
ui/src/components/profiles/editor/index.tsx | 49 ++++++++++++++++++-
.../profiles/editor/info-section.tsx | 46 ++++++++++++++++-
ui/src/components/profiles/editor/types.ts | 3 ++
5 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/ui/src/components/profiles/editor/friendly-ui-section.tsx b/ui/src/components/profiles/editor/friendly-ui-section.tsx
index f193290c..7a5bdeed 100644
--- a/ui/src/components/profiles/editor/friendly-ui-section.tsx
+++ b/ui/src/components/profiles/editor/friendly-ui-section.tsx
@@ -20,9 +20,11 @@ import { isOpenRouterProfile, extractTierMapping, applyTierMapping } from './uti
import { toast } from 'sonner';
import { cn } from '@/lib/utils';
import type { Settings, SettingsResponse } from './types';
+import type { CliTarget } from '@/lib/api-client';
interface FriendlyUISectionProps {
profileName: string;
+ target: CliTarget;
data: SettingsResponse | undefined;
currentSettings: Settings | undefined;
newEnvKey: string;
@@ -36,6 +38,7 @@ interface FriendlyUISectionProps {
export function FriendlyUISection({
profileName,
+ target,
data,
currentSettings,
newEnvKey,
@@ -263,7 +266,7 @@ export function FriendlyUISection({
value="info"
className="h-full mt-0 border-0 p-0 data-[state=inactive]:hidden"
>
-
+
diff --git a/ui/src/components/profiles/editor/header-section.tsx b/ui/src/components/profiles/editor/header-section.tsx
index 25b2095d..6692222a 100644
--- a/ui/src/components/profiles/editor/header-section.tsx
+++ b/ui/src/components/profiles/editor/header-section.tsx
@@ -5,19 +5,30 @@
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from '@/components/ui/select';
import { Save, Loader2, Trash2, RefreshCw } from 'lucide-react';
import { OpenRouterBadge } from '@/components/profiles/openrouter-badge';
import { isOpenRouterProfile } from './utils';
import type { Settings } from './types';
+import type { CliTarget } from '@/lib/api-client';
interface HeaderSectionProps {
profileName: string;
+ target: CliTarget;
data: { path?: string; mtime: number } | undefined;
settings?: Settings;
isLoading: boolean;
isSaving: boolean;
+ isTargetSaving: boolean;
hasChanges: boolean;
isRawJsonValid: boolean;
+ onTargetChange: (target: CliTarget) => void;
onRefresh: () => void;
onDelete?: () => void;
onSave: () => void;
@@ -25,12 +36,15 @@ interface HeaderSectionProps {
export function HeaderSection({
profileName,
+ target,
data,
settings,
isLoading,
isSaving,
+ isTargetSaving,
hasChanges,
isRawJsonValid,
+ onTargetChange,
onRefresh,
onDelete,
onSave,
@@ -52,6 +66,19 @@ export function HeaderSection({
Last modified: {new Date(data.mtime).toLocaleString()}
)}
+
+ Default target:
+
+ {isTargetSaving && }
+
+
+
+
+
+ {isDroidTarget
+ ? `ccsd ${profileName} "prompt"`
+ : `ccs ${profileName} --target droid "prompt"`}
+
+
+
+
+
+
+
+
+ ccs {profileName} --target claude "prompt"
+
+
+
+
diff --git a/ui/src/components/profiles/editor/types.ts b/ui/src/components/profiles/editor/types.ts
index 950ae645..76aa9a8d 100644
--- a/ui/src/components/profiles/editor/types.ts
+++ b/ui/src/components/profiles/editor/types.ts
@@ -2,6 +2,8 @@
* Types for Profile Editor
*/
+import type { CliTarget } from '@/lib/api-client';
+
export interface Settings {
env?: Record;
}
@@ -15,6 +17,7 @@ export interface SettingsResponse {
export interface ProfileEditorProps {
profileName: string;
+ profileTarget?: CliTarget;
onDelete?: () => void;
onHasChangesUpdate?: (hasChanges: boolean) => void;
}