fix(ui): external adapter selection, config field placement, and transcript parser freshness

- Fix external adapters (hermes, droid) not auto-selected when
  navigating with ?adapterType= param — was using a stale
  module-level Set built before async adapter registration
- Move SchemaConfigFields to render after thinking effort (same
  visual area as Claude's chrome toggle) instead of bottom of
  config section
- Extract SelectField into its own component to fix React hooks
  order violation when schema fields change between renders
- Add onAdapterChange() subscription in registry.ts so
  registerUIAdapter() notifies components when dynamic parsers
  load, fixing stale parser for old runs
- Add parserTick to both RunTranscriptView and
  useLiveRunTranscripts to force recomputation on parser change
This commit is contained in:
HenkDz 2026-04-01 21:56:19 +01:00
parent 69a1593ff8
commit 47f3cdc1bb
13 changed files with 473 additions and 55 deletions

View file

@ -68,6 +68,7 @@ export function redactTranscriptEntryPaths(entry: TranscriptEntry, opts?: HomePa
case "stderr":
case "system":
case "stdout":
case "diff":
return { ...entry, text: redactHomePathUserSegments(entry.text, opts) };
case "tool_call":
return {

View file

@ -268,17 +268,21 @@ export interface ProviderQuotaResult {
export interface ConfigFieldOption {
label: string;
value: string;
/** Optional group key for categorizing options (e.g. provider name) */
group?: string;
}
export interface ConfigFieldSchema {
key: string;
label: string;
type: "text" | "select" | "toggle" | "number" | "textarea";
type: "text" | "select" | "toggle" | "number" | "textarea" | "combobox";
options?: ConfigFieldOption[];
default?: unknown;
hint?: string;
required?: boolean;
group?: string;
/** Optional metadata — not rendered, but available to custom UI logic */
meta?: Record<string, unknown>;
}
export interface AdapterConfigSchema {
@ -340,7 +344,8 @@ export type TranscriptEntry =
| { kind: "result"; ts: string; text: string; inputTokens: number; outputTokens: number; cachedTokens: number; costUsd: number; subtype: string; isError: boolean; errors: string[] }
| { kind: "stderr"; ts: string; text: string }
| { kind: "system"; ts: string; text: string }
| { kind: "stdout"; ts: string; text: string };
| { kind: "stdout"; ts: string; text: string }
| { kind: "diff"; ts: string; changeType: "add" | "remove" | "context" | "hunk" | "file_header" | "truncation"; text: string };
export type StdoutLineParser = (line: string, ts: string) => TranscriptEntry[];