Skip to content

Commit fba12e7

Browse files
hl9565claude
andcommitted
T-PROV-R step9b: 修复切换中转态 invalid args + ProviderView 颜色守卫
- switch_provider_mode / save_provider_profile 的 invoke 参数包进 request:, 匹配 Rust 单结构体参数签名,修复「missing required key request」报错 - styles.css 改用已定义主题变量(--primary/--danger-border/--danger-text), 移除未定义的 --accent/--danger 及硬编码兜底色,通过 theme color guard Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b2a8d5d commit fba12e7

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

‎apps/codex-pilot-manager/src/styles.css‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,8 +2428,8 @@ dd {
24282428
}
24292429

24302430
.profileRow.active {
2431-
border-color: var(--accent, #3b82f6);
2432-
background: color-mix(in srgb, var(--accent, #3b82f6) 6%, var(--surface));
2431+
border-color: var(--primary);
2432+
background: color-mix(in srgb, var(--primary) 6%, var(--surface));
24332433
}
24342434

24352435
.profileInfo {
@@ -2467,11 +2467,11 @@ dd {
24672467
/* ── Provider: 错误面板 ── */
24682468

24692469
.errorPanel {
2470-
border-color: var(--danger, #ef4444) !important;
2470+
border-color: var(--danger-border) !important;
24712471
}
24722472

24732473
.errorText {
2474-
color: var(--danger, #ef4444);
2474+
color: var(--danger-text);
24752475
font-size: 0.85rem;
24762476
}
24772477

‎apps/codex-pilot-manager/src/views/ProviderView.tsx‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ export function ProviderView({
9393
}
9494
runAction("save", () =>
9595
callBackend("save_provider_profile", {
96-
id: isCreating ? `${Date.now()}-${Math.random().toString(36).slice(2, 8)}` : editingId,
97-
name: profileName.trim(),
98-
baseUrl: baseUrl.trim(),
99-
bearerToken: bearerToken.trim(),
100-
upstreamProtocol,
96+
request: {
97+
id: isCreating ? `${Date.now()}-${Math.random().toString(36).slice(2, 8)}` : editingId,
98+
name: profileName.trim(),
99+
baseUrl: baseUrl.trim(),
100+
bearerToken: bearerToken.trim(),
101+
upstreamProtocol,
102+
},
101103
})
102104
).then(() => {
103105
setIsCreating(false);
@@ -118,11 +120,13 @@ export function ProviderView({
118120
const switchMode = (mode: string, profileId?: string) => {
119121
runAction("switch", () =>
120122
callBackend("switch_provider_mode", {
121-
mode,
122-
profileId: profileId ?? "",
123-
baseUrl: "",
124-
apiKey: "",
125-
upstreamProtocol: "",
123+
request: {
124+
mode,
125+
profileId: profileId ?? "",
126+
baseUrl: "",
127+
apiKey: "",
128+
upstreamProtocol: "",
129+
},
126130
})
127131
).then(() => setSwitchConfirm(null));
128132
};

0 commit comments

Comments
 (0)