Settings: add Fast Mode toggle for codex/claude + tidy account row alignment (#46)

Fast mode controls
- Codex: writes [features].fast_mode = true|false in ~/.codex/config.toml.
  This matches the in-TUI /fast toggle ("toggle Fast mode to enable
  fastest inference with increased plan usage").
- Claude: writes fastMode: bool to ~/.claude/settings.json. Mirrors the
  /fast slash command preference (effective on opus-4-6).

UX polish
- Account rows switch from flex-wrap to a fixed grid (tag · email · plan ·
  expiry · action) so emails of varying lengths don't cause ragged
  baselines between rows.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Eyejoker
2026-04-27 22:06:56 +09:00
committed by GitHub
parent 5883e57d73
commit 7047caa608
5 changed files with 290 additions and 5 deletions

View File

@@ -373,6 +373,11 @@ export interface ModelConfigSnapshot {
arbiter: ModelRoleConfig;
}
export interface FastModeSnapshot {
codex: boolean;
claude: boolean;
}
export async function fetchAccounts(): Promise<{
claude: ClaudeAccountSummary[];
codex: CodexAccountSummary[];
@@ -412,6 +417,34 @@ export async function updateModels(
return (await response.json()) as ModelConfigSnapshot;
}
export async function fetchFastMode(): Promise<FastModeSnapshot> {
return fetchJson('/api/settings/fast-mode');
}
export async function updateFastMode(
input: Partial<FastModeSnapshot>,
): Promise<FastModeSnapshot> {
const response = await fetch('/api/settings/fast-mode', {
method: 'PUT',
headers: {
accept: 'application/json',
'content-type': 'application/json',
},
body: JSON.stringify(input),
});
if (!response.ok) {
let msg = `update fast mode failed: ${response.status}`;
try {
const payload = (await response.json()) as { error?: string };
if (payload.error) msg = payload.error;
} catch {
/* ignore */
}
throw new Error(msg);
}
return (await response.json()) as FastModeSnapshot;
}
export async function deleteAccount(
provider: 'claude' | 'codex',
index: number,