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

@@ -48,10 +48,12 @@ import {
} from './web-dashboard-data.js';
import {
addClaudeAccountFromToken,
getFastMode,
getModelConfig,
listClaudeAccounts,
listCodexAccounts,
removeAccountDirectory,
updateFastMode,
updateModelConfig,
} from './settings-store.js';
@@ -1271,6 +1273,31 @@ export function createWebDashboardHandler(
}
}
if (
url.pathname === '/api/settings/fast-mode' &&
(request.method === 'PUT' || request.method === 'PATCH')
) {
let body: unknown = null;
try {
body = await request.json();
} catch {
return jsonResponse({ error: 'Invalid JSON body' }, { status: 400 });
}
if (!body || typeof body !== 'object') {
return jsonResponse(
{ error: 'Body must be a JSON object' },
{ status: 400 },
);
}
try {
const next = updateFastMode(body as Record<string, unknown>);
return jsonResponse(next);
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
return jsonResponse({ error: message }, { status: 500 });
}
}
{
const accountAddMatch = url.pathname.match(
/^\/api\/settings\/accounts\/(claude)$/,
@@ -1518,6 +1545,10 @@ export function createWebDashboardHandler(
return jsonResponse(getModelConfig());
}
if (url.pathname === '/api/settings/fast-mode') {
return jsonResponse(getFastMode());
}
if (url.pathname === '/api/stream') {
const encoder = new TextEncoder();
const stream = new ReadableStream({