ruohki
ddf9ebc42f
feat(02-03): wire main.rs with highlighter init, vault loading, and renderer
...
- Add highlighter::init_highlighter() call before render_markdown()
- Load index.md via vault::load_document() with proper VaultDocument matching
- Query terminal size before terminal init for initial render width
- Render markdown via renderer::render_markdown() passing content and width
- Pass raw content string to App::new() for resize re-rendering
- Update App::new() call with all 4 arguments (is_login_shell, config, doc, raw)
- All 7 modules declared: app, config, highlighter, renderer, signals, terminal, vault
2026-02-28 22:24:00 +01:00
ruohki
9e6f79c233
feat(02-02): build core markdown renderer with inline and block elements
...
- Create src/renderer.rs with public render_markdown(input, width) -> Vec<Line<'static>>
- Implement RenderState with style stack, blockquote depth, list counters, table two-pass collection
- Handle all inline elements: headings H1-H6 (CGA colors + H1/H2 decorators), bold, italic, inline code
- Handle block elements: paragraphs, lists (ordered/unordered/nested with •/◦/▪), blockquotes with │ prefix, horizontal rules, images as [IMAGE: alt] placeholders
- Stub emit_code_block and emit_table delegate to full implementations (Task 2)
- Add mod highlighter, renderer, vault declarations to main.rs (wiring for Plan 03)
- cargo check passes clean (19 dead_code warnings expected — modules unwired until Plan 03)
2026-02-28 22:17:28 +01:00
ruohki
771c9a8561
feat(01-03): wire complete startup-to-shutdown pipeline in main.rs
...
- All four modules declared: mod app, config, signals, terminal
- Pre-terminal phase: login shell detection, CLI parse, config load
- Terminal phase: panic hook installed first, then signals, then terminal init
- Event loop: App::new receives is_login_shell and app_config; run_event_loop runs
- Shutdown: restore_terminal() called before show_goodbye() in all exit paths
- BrokenPipe from event loop exits silently (LIFE-04)
- Unexpected I/O errors logged to stderr after terminal restore
2026-02-28 21:17:56 +01:00
ruohki
bad8fba5aa
feat(01-03): implement App struct and event loop with exit behavior
...
- App struct with is_login_shell, double-press Ctrl+C state machine, show_quit_prompt
- run_event_loop() polls SignalFlags first, then draws, then polls key events
- handle_key() suppresses 'q' in login shell mode; double Ctrl+C within 2s quits
- draw() renders Phase 1 placeholder TUI with title, welcome text, quit prompt
- show_goodbye() prints BBS-style goodbye with 500ms delay after terminal restore
- DOUBLE_PRESS_WINDOW const = 2 seconds
- mod app added to main.rs
2026-02-28 21:17:10 +01:00
ruohki
966b47edbc
feat(01-02): implement signal handling and logging stub
...
- SignalFlags struct wraps Arc<AtomicBool> for SIGHUP/SIGTERM
- register_signals() registers SIGHUP and SIGTERM only (not SIGINT)
- SIGINT deliberately excluded — handled via crossterm key events for double-press Ctrl+C
- should_terminate() polls flag with Ordering::Relaxed for event loop use
- init_logging() is a Phase 1 no-op stub with LIFE-03 documentation
2026-02-28 21:12:45 +01:00
ruohki
b258b6d262
feat(01-02): implement terminal init/restore and panic hook
...
- init_terminal() enables raw mode and clears main screen via Viewport::Fullscreen
- No alternate screen buffer used (deliberate BBS immersive approach)
- restore_terminal() disables raw mode and shows cursor using let _ for all calls
- install_panic_hook() restores terminal, prints BBS-themed message, delegates to original hook
- Use ratatui::crossterm re-export (crossterm is transitive dep only)
- All panic hook operations use let _ or eprintln! — no unwrap() or ? inside hook
2026-02-28 21:12:04 +01:00