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>
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>
- 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>
Models and engines tables have many duplicate names (e.g. 24 ASTRA rows,
210 F-150 rows, 398 "5.7L 350CID V8" rows). Changed get_models() and
get_engines() to use GROUP BY UPPER(name) instead of DISTINCT on id+name
so each model/engine appears only once in the navigation lists.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Console README with usage instructions, keybindings reference, architecture
overview, and test commands. Updated root README with console section, updated
architecture diagram, and installation instructions. Includes approved design
doc and implementation plan.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add MockRenderer-based integration tests that verify the full screen-to-
renderer pipeline without a real terminal. Update main.py with proper
--db flag handling, database existence check, startup banner, and
graceful error handling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Add the three core modules that all screens depend on:
- keybindings.py: Key constants (curses codes) and KeyBindings registry
- navigation.py: Stack-based screen navigation with breadcrumbs
- screens.py: Screen base class with on_enter/on_key/render lifecycle
Includes 31 tests covering all public APIs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement console/db.py with Database class providing all data access
methods for the console application, plus 36 passing tests in
console/tests/test_db.py covering vehicle navigation, parts catalog,
search, VIN cache, stats, manufacturers, and admin CRUD operations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>