Commit Graph

4 Commits

Author SHA1 Message Date
ruohki d705313aae feat(03-02): add navigation history, link cycling, and navigate_to to App
- Add HistoryEntry struct with path, scroll_offset, selected_link fields
- Add Phase 3 navigation fields to App: history, history_index, link_records, selected_link, current_path
- Update App::new() to accept link_records and current_path parameters
- Implement navigate_to() with browser-style forward history truncation
- Implement navigate_back() and navigate_forward() with state restoration
- Implement follow_selected_link() for wiki-link and standard link resolution
- Implement select_next_link() and select_prev_link() with wrap-around
- Implement scroll_to_selected_link() for auto-scroll centering
- Add Tab, Shift-Tab, Enter, Backspace, Alt+Left, Alt+Right key bindings
- Update handle_resize() to capture and validate link_records after re-render
- Update main.rs to destructure link_records and pass to App::new()
- Remove #[allow(dead_code)] on config field (now actively used)
2026-02-28 23:10:23 +01:00
ruohki a63f4115f9 feat(03-01): extend renderer with LinkRecord extraction and link styling
- Add LinkRecord struct (line_index, col_offset, span_len, dest, is_wiki)
- Add PendingLink and PendingLinkRecord helpers in RenderState
- Enable ENABLE_WIKILINKS option in pulldown-cmark parser
- Handle Tag::Link Start: compute col_offset, determine broken wiki-link style
- Handle TagEnd::Link: compute span_len, enqueue PendingLinkRecord
- Update flush_line() to finalize pending link records with line_index
- Update render_markdown() signature to return (Vec<Line>, Vec<LinkRecord>)
- Add vault_path: Option<&Path> parameter for render-time broken link detection
- Update app.rs handle_resize and main.rs call sites to destructure tuple
- Wiki-links render as [Text] in LightCyan; broken wiki-links in Red+CROSSED_OUT
2026-02-28 23:04:20 +01:00
ruohki 9cdfc6b2c4 feat(02-03): rework app.rs with document display, scrolling, status bar, error screen
- Add DocumentState enum (Loaded/Missing/Error) for vault document state
- Extend App struct with document, scroll_offset, raw_content, filename, last_content_height
- Update App::new() signature to accept DocumentState and raw_content
- Replace Phase 1 placeholder draw() with content area + status bar layout
- Implement draw_status_bar() with reverse-video, filename left, hints right
- Implement draw_error_screen() BBS box-drawing error widget (red borders)
- Add j/k/Down/Up (1-line) and PgDn/PgUp (page) scroll key bindings
- Add handle_resize() for re-rendering markdown at new terminal width
- Preserve all Phase 1 quit behavior (double Ctrl+C, q key, login shell mode)
2026-02-28 22:23:52 +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