/** * CategoryScreen — generic schema-driven view for a single settings category. * * Reads visible fields from a `CategoryDef`, renders one `FieldRenderer` per * field, and owns the navigation state (focused field index + editing flag). * All value state lives in the supplied `SettingsStore`; CategoryScreen only * routes keystrokes and forwards `onChange` into `store.set(settingsPath, ...)`. * * Key routing: * - ↑ / ↓ → move focus through visible fields (no wrap) * - enter → start editing the focused field; on edit-done, blur() * is called which autosaves the field to disk. * - esc → cancel current edit, OR call `onBack()` when idle */ import React from 'react'; import type { CategoryDef, FieldDef } from '../schema/types.js'; import type { SettingsStore } from '../state/settings-store.js'; export interface ExtraRowDef { /** Row label, e.g. "Continue", "Finish", "Quit". */ label: string; /** Called when Enter is pressed while this row is focused. */ onActivate: () => void; /** * When true, renders the row in a muted/dim style (e.g. Quit). * When false/absent, renders with accent highlight (e.g. Continue/Finish). */ dim?: boolean; } export interface CategoryScreenProps { category: CategoryDef; store: SettingsStore; onBack: () => void; onEditBufferChange?: (editing: boolean) => void; /** If set, CategoryScreen initialises focus on the field with this key. */ initialFocusKey?: string; /** * Extra focusable rows appended after all fields (e.g. Continue, Quit in wizard). * Arrow-down past the last field lands on the first extra row. * Absent in regular SettingsHome → CategoryScreen navigation. */ extraRows?: ReadonlyArray; /** * Optional per-render field transform. Lets the parent inject live state the * static schema can't carry — e.g. the agents multiselect's `installed` * option hints derived from runtime detection. Returning the field unchanged * is a no-op. Applied just before rendering each visible field. */ decorateField?: (field: FieldDef) => FieldDef; /** * Bump to force `decorateField` to re-run (e.g. after an install completes so * the freshly-detected install state shows without a restart — #105). The * value itself is opaque; any change re-decorates. */ refreshSignal?: number; } export declare function CategoryScreen(props: CategoryScreenProps): React.ReactElement; //# sourceMappingURL=CategoryScreen.d.ts.map