Commit Graph

9 Commits

Author SHA1 Message Date
3ea2de61e2 refactor(console): remove modern renderer, keep VT220 only
Remove the Rich-based textual renderer and all --mode modern references.
The console now runs exclusively in VT220 curses mode (green on black).
No external dependencies required.

Removed: console/renderers/textual_renderer.py, --mode flag, DEFAULT_MODE
Updated: main.py, config.py, README.md, console/README.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:37:35 +00:00
7866194e65 ui(console): center menu in a bordered box with better spacing
Both renderers now draw the menu inside a centered box with:
- Rounded corners (modern) / box-drawing (VT220)
- Title centered inside the box top
- Section separators as horizontal lines within the box
- Selected item highlighted across the full box width
- Vertical and horizontal centering on screen

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:31:54 +00:00
a3aa2a7608 fix(console): arrow keys and layout in modern renderer
Two bugs fixed:

1. Arrow keys detected as ESC: sys.stdin.read(1) uses Python's internal
   buffer, so after reading ESC byte, the remaining escape sequence
   bytes ([A for up-arrow) were in Python's buffer but not visible to
   select.select() on the OS fd. Switched to os.read(fd, 1) which
   reads directly from the file descriptor, bypassing Python's buffer.

2. Footer positioned wrong: draw_footer() counted buffer items to
   calculate padding, but a Rich Table renders as multiple lines.
   Added _line_count tracker with _add_line() and _add_lines(n) so
   footer padding is calculated from actual rendered line count.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:29:32 +00:00
8c7caf3969 fix(console): rewrite modern renderer with buffered output
Major issues fixed:
- Rich printed directly to stdout causing visible flicker on every redraw
- get_key() toggled raw mode per keypress causing glitches and slowness
- No alternate screen buffer — output contaminated terminal scrollback

Rewrite approach:
- Use alternate screen buffer (ESC[?1049h) for clean enter/exit
- Persistent raw mode for entire session instead of per-keypress toggle
- Buffer all Rich renderables during render cycle, flush once in refresh()
- Render to StringIO then write entire frame in single sys.stdout.write()
- Reduced ESC sequence timeout from 50ms to 20ms for snappier response

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:25:35 +00:00
f5e0525dfc perf(console): reduce ESC key delay from 1000ms to 25ms
Curses waits up to 1 second after ESC to distinguish it from escape
sequences (arrow keys, F-keys). Set ESCDELAY=25 before curses.initscr()
so ESC responds near-instantly while still handling escape sequences.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:22:01 +00:00
274cf30e79 perf(console): persistent DB connection, query cache, PRAGMA tuning
- Reuse a single SQLite connection instead of open/close per query
- Add in-memory cache for frequently accessed data (brands, models,
  categories) — 1000x faster on repeated access
- Enable WAL journal mode, 8MB cache, 64MB mmap for faster reads
- Cache terminal size per render cycle to avoid repeated getmaxyx()
- Close DB connection on app exit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 02:19:50 +00:00
7bf50a2c67 feat(console): add Rich-based modern renderer
Implement TextualRenderer in console/renderers/textual_renderer.py using
the Rich library for a modern dark-themed TUI with blue/cyan accents.
All 18 BaseRenderer methods are implemented: lifecycle (init_screen,
cleanup), primitives (clear, refresh, get_key, get_size), widgets
(draw_header, draw_footer, draw_menu, draw_table, draw_detail,
draw_form, draw_filter_list, draw_comparison, draw_text, draw_box),
and dialogs (show_message, show_input). Keyboard input uses raw
terminal mode via tty/termios with full escape sequence decoding
for arrow keys, F-keys, Page Up/Down, Home/End.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:57:25 +00:00
269bb9030b feat(console): add curses VT220 renderer with full widget set
Implements BaseRenderer abstract interface and CursesRenderer with
green-on-black VT220 aesthetic. Includes all 18 widget methods: header,
footer, menu, table, detail, form, filter list, comparison view, box
drawing, message dialogs, and input prompts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:41:51 +00:00
7cf3ddc758 feat(console): scaffold project structure and config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:29:54 +00:00