/** * Sidebar Todo Panel * * Compact todo panel optimized for sidebar display. * Real-data-friendly interface that InteractiveMode can wire later. */ import { type Component } from "@apholdings/jensen-tui"; /** Status of a todo item */ export type TodoStatus = "pending" | "in_progress" | "completed"; /** A single todo item */ export interface TodoItem { /** Unique identifier */ id: string; /** Todo content/description */ content: string; /** Active form description (what's currently being done) */ activeForm?: string; /** Current status */ status: TodoStatus; /** Priority level (optional, higher = more important) */ priority?: number; /** Whether this item is persisted */ isPersisted?: boolean; } /** Todo data for the panel */ export interface SidebarTodoData { /** All todo items */ items: TodoItem[]; /** Current in-progress item (optional, for quick access) */ current?: TodoItem; /** Total count of items */ totalCount: number; /** Count of completed items */ completedCount: number; /** Whether todo list is persisted */ isPersisted?: boolean; } /** Configuration for the panel */ export interface SidebarTodoPanelConfig { /** Header label shown in the panel (default: "Todos") */ title: string; /** Minimum width for showing active form (default: 22) */ activeThreshold: number; /** Minimum width for showing all items (default: 26) */ itemsThreshold: number; /** Maximum items to show (default: 8) */ maxItems: number; /** Show priority indicators (default: false) */ showPriority: boolean; } /** * Build SidebarTodoData from the session's raw todo list shape * (`{ content, activeForm, status }`). Returns `undefined` when the list * is empty so callers can clear the panel instead of rendering it. */ export declare function buildSidebarTodoData(todos: ReadonlyArray<{ content: string; activeForm: string; status: string; }>): SidebarTodoData | undefined; /** * Build SidebarTodoData from the session's structured Task list shape * (`{ id, subject, activeForm?, status }`). Tasks are distinct from todos: * they are persistent, model-visible work items with an explicit id and * subject. This mapper reuses the shared panel rendering so the Task panel * renders with the same visual treatment as the Todo panel. */ export declare function buildSidebarTaskData(tasks: ReadonlyArray<{ id: string; subject: string; activeForm?: string; status: string; }>): SidebarTodoData | undefined; /** * Compact sidebar panel for todo status. * * Features: * - Shows todo progress and current task * - Width-aware rendering (compact at narrow widths) * - Real-data-friendly interface that InteractiveMode can wire later * * Usage: * ```typescript * const panel = new SidebarTodoPanel(); * * // Update with data from InteractiveMode * panel.update({ * items: [ * { id: "1", content: "Implement feature X", status: "completed" }, * { id: "2", content: "Write tests", activeForm: "Writing test cases", status: "in_progress" }, * { id: "3", content: "Review code", status: "pending" }, * ], * current: { id: "2", content: "Write tests", status: "in_progress" }, * totalCount: 3, * completedCount: 1, * }); * * // Render * const lines = panel.render(35); * ``` */ export declare class SidebarTodoPanel implements Component { private data; private config; private cachedLines; constructor(config?: Partial); /** * Update the panel with new data */ update(data: SidebarTodoData): void; /** * Clear the panel data */ clear(): void; /** * Update configuration */ configure(config: Partial): void; invalidate(): void; private invalidateCache; /** * Render a single todo item line */ private renderTodoLine; render(width: number): string[]; /** * Render a simple progress bar */ private renderProgressBar; } export default SidebarTodoPanel; //# sourceMappingURL=sidebar-todo-panel.d.ts.map