Skip to content

[Architecture] oclite: Adopt append-only output with inline status patterns #74

@randomm

Description

@randomm

Context

Research into AIChat and Aider revealed both use an append-only output model with inline status indicators. No fixed panels, no scroll regions — just print to stdout and let the terminal scroll.

This issue tracks adopting those proven patterns after reverting the scroll region approach (#72).

Patterns to Adopt

From AIChat (Rust)

  • Cursor position tracking: Use equivalent of crossterm::cursor::position() to know terminal position
  • Explicit scroll: ScrollUp/ScrollDown commands when needed (not DECSTBM regions)
  • Atomic abort signals: Coordinate Ctrl+C across async operations
  • REPL loop: Simple read → process → output → repeat cycle

From Aider (Python)

  • Streaming markdown: Full re-render at 8fps (alternative to our incremental approach if edge cases pile up)
  • Visual separators: Horizontal rules between messages for readability
  • Inline status: Print "Thinking..." or spinner inline, no fixed status bar
  • Alt+Enter for multi-line: Toggle between single-line submit and multi-line editing

From blessed (reference only)

  • CSR reset recipe (for future use if we ever need fixed panels):
    1. Set CSR: \x1b[{top};{bottom}r
    2. Position cursor inside bounds
    3. Insert/delete lines
    4. ALWAYS reset CSR: \x1b[1;{height}r
    5. Reposition cursor

Implementation

  • Ensure output goes through simple process.stdout.write() — no layout abstraction
  • Spinner renders inline (before streaming starts, cleared when first chunk arrives)
  • Tool calls render inline with compact format (already done: ◇ bash git status✓ bash)
  • Add horizontal rule separators between messages
  • Status info (tokens, elapsed time) renders inline after response completes
  • Input naturally at bottom (cursor ends up there after output)

Depends On

Acceptance Criteria

  • Clean append-only output flow
  • No ANSI scroll region sequences in codebase
  • Spinner, tools, markdown all render inline
  • Horizontal rules between messages
  • oclite feels responsive and clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions