mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
fix(ui): model selection now updates all tiers correctly
- Add updateEnvBulk function for atomic multi-key updates - Pass onEnvBulkChange prop to FriendlyUISection - Fixes race condition where only last tier (haiku) was updated
This commit is contained in:
@@ -67,6 +67,13 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) {
|
||||
setRawJsonEdits(JSON.stringify({ ...currentSettings, env: newEnv }, null, 2));
|
||||
};
|
||||
|
||||
// Bulk update multiple env vars at once (avoids race conditions)
|
||||
const updateEnvBulk = (env: Record<string, string>) => {
|
||||
const newEnv = { ...(currentSettings?.env || {}), ...env };
|
||||
setLocalEdits((prev) => ({ ...prev, ...env }));
|
||||
setRawJsonEdits(JSON.stringify({ ...currentSettings, env: newEnv }, null, 2));
|
||||
};
|
||||
|
||||
const addNewEnvVar = () => {
|
||||
if (!newEnvKey.trim()) return;
|
||||
const key = newEnvKey.trim();
|
||||
@@ -179,6 +186,7 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) {
|
||||
onNewEnvKeyChange={setNewEnvKey}
|
||||
onNewEnvValueChange={setNewEnvValue}
|
||||
onEnvValueChange={updateEnvValue}
|
||||
onEnvBulkChange={updateEnvBulk}
|
||||
onAddEnvVar={addNewEnvVar}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user