ruohki
2c9ad682da
docs(03-02): complete navigation, history, and breadcrumb status bar plan
...
- Create 03-02-SUMMARY.md documenting HistoryEntry, navigate_to/back/forward, Tab-cycling, breadcrumb
- Update STATE.md: Phase 3 complete, plan 2/2 done, decisions added, session updated
- Update ROADMAP.md: Phase 3 marked complete, 2/2 plans checked
- Mark requirements NAV-03, NAV-04, NAV-11 complete in REQUIREMENTS.md
2026-02-28 23:12:39 +01:00
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
8ea4545c9b
docs(03-01): complete link record extraction and wiki-link resolution plan
...
- 03-01-SUMMARY.md: documents LinkRecord struct, render_markdown signature change,
resolve_wiki_link algorithm, is_within_vault guard, and all decisions
- STATE.md: advance to Phase 3 Plan 2, update progress to 75%, add 3 decisions,
mark NAV path traversal blocker resolved
- ROADMAP.md: update phase 3 plan progress (1 of 2 summaries)
- REQUIREMENTS.md: mark NAV-01, NAV-02, NAV-10 complete
2026-02-28 23:06:30 +01:00
ruohki
f2604d6429
feat(03-01): add wiki-link resolution and path traversal guard to vault.rs
...
- Add is_within_vault() with canonicalize + starts_with path traversal guard
- Add resolve_wiki_link() with case-insensitive multi-strategy matching
(hyphens first, then underscores, then literal spaces per locked decision)
- Support subpath wiki-links: [[guides/Getting Started]] -> guides/getting-started.md
- Add resolve_standard_link() for inline [text](path.md) link resolution
relative to the current document's directory within the vault
- All resolution functions guarded by is_within_vault() to prevent traversal
2026-02-28 23:04:27 +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
cf58e31bcb
docs(03): create phase plan
2026-02-28 22:54:12 +01:00
ruohki
b8bce79ef6
docs(03): research phase navigation and links
2026-02-28 22:47:45 +01:00
ruohki
f3f77873d2
docs(state): record phase 3 context session
2026-02-28 22:39:54 +01:00
ruohki
8adc004691
docs(03): capture phase context
2026-02-28 22:39:38 +01:00
ruohki
9115a01b1f
docs(phase-2): complete phase execution
2026-02-28 22:30:50 +01:00
ruohki
539efdc202
docs(02-03): complete app integration plan — Phase 2 all 3 plans done
...
- Create 02-03-SUMMARY.md documenting DocumentState, scrolling, status bar, error screen
- Update STATE.md: Phase 2 complete, 6 total plans, Phase 3 next
- Update ROADMAP.md: Phase 2 all 3 plans SUMMARY present, marked Complete
- Mark NAV-05, NAV-08, NAV-09 requirements complete in REQUIREMENTS.md
2026-02-28 22:26:19 +01:00
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
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
b6069d90e5
docs(02-02): complete markdown renderer plan — REND-01 through REND-10 satisfied
...
- 02-02-SUMMARY.md: documents render_markdown() pipeline, code block borders, GFM table grid, decisions, deviations
- STATE.md: advance to plan 02 done, update decisions log (02-02 entries), resolve REND Widget trait blocker
- ROADMAP.md: mark 02-02 complete (2/3 plans done for Phase 2)
2026-02-28 22:20:35 +01:00
ruohki
8690d2a857
feat(02-02): add code block borders with syntax highlighting and GFM table grid
...
- emit_code_block: ╭─ {lang} ─╮ / │ content │ / ╰──╯ rounded borders; lang label in Yellow; content via highlight_code()
- emit_table: ┌┬┐├┼┤└┴┘ full box-drawing grid; bold LightCyan header row; Left/Right/Center cell alignment
- Rename stub methods to emit_code_block_now / emit_table_now (clean naming; delegates to full emitters)
- Remove unused push_fg / push_fg_mod helper methods
- cargo check passes; 19 expected dead_code warnings (modules wired in Plan 03)
2026-02-28 22:18:31 +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
af0fe03f12
docs(02-01): complete vault core and highlighter foundation plan
...
- Add 02-01-SUMMARY.md with full execution record and deviation documentation
- Update STATE.md: Phase 2 Plan 1 complete, resume at 02-02-PLAN.md
- Update REQUIREMENTS.md: mark REND-03, REND-10, NAV-06, NAV-07 complete
2026-02-28 22:14:20 +01:00
ruohki
8d45a7c263
feat(02-01): add syntax highlighter module with CGA color mapping
...
- Create src/highlighter.rs with OnceLock-based one-time syntect initialization
- Implement init_highlighter(), syntax_set(), theme_set() accessors
- Implement syntect_color_to_cga() with Euclidean RGB-to-CGA 16-color quantization
- Implement highlight_code() returning Vec<Line<'static>> using base16-ocean.dark theme
- LinesWithNewlines iterator preserves newlines for syntect grammar correctness
- Module verified to compile cleanly (tested via temporary mod registration)
2026-02-28 22:12:53 +01:00
ruohki
7622d41496
feat(02-01): add Phase 2 deps and vault file-loading module
...
- Add pulldown-cmark 0.13.1, syntect 5.3 (default-fancy), syntect-tui 3.0 to Cargo.toml
- Create src/vault.rs with VaultDocument enum (Loaded/Missing/ReadError variants)
- Implement load_document() using std::fs::read_to_string with structured error mapping
- cargo check passes with all new dependencies resolved
2026-02-28 22:11:55 +01:00
ruohki
ae379b62f6
docs(02): create phase plans (3 plans, 3 waves)
2026-02-28 22:08:57 +01:00
ruohki
ab71c42c6b
docs(02): create phase plan
2026-02-28 22:02:14 +01:00
ruohki
24f11f39be
docs(02): research vault core and rendering phase
2026-02-28 21:55:13 +01:00
ruohki
7222543d4c
docs(02): capture phase context
2026-02-28 21:44:22 +01:00
ruohki
88f665a095
test(01): complete UAT - 8 passed, 0 issues
2026-02-28 21:35:20 +01:00
ruohki
b81b893661
fix(terminal): switch to alternate screen buffer for clean exit
...
TUI frame was left in terminal after exit. Use EnterAlternateScreen/
LeaveAlternateScreen so exiting restores the original terminal content.
2026-02-28 21:35:01 +01:00
ruohki
240ae4aace
test(01): complete UAT - 7 passed, 1 issue
2026-02-28 21:32:29 +01:00
ruohki
90dc4882ae
docs(phase-1): complete phase execution
2026-02-28 21:24:04 +01:00
ruohki
d9db04fb01
docs(01-03): complete app event loop and Phase 1 wiring plan
...
- 01-03-SUMMARY.md: documents App struct, event loop, double-Ctrl+C state machine, main.rs pipeline
- STATE.md: Phase 1 complete, 3/3 plans done, Phase 2 next, 01-03 decisions recorded
- ROADMAP.md: Phase 1 marked Complete (3 plans / 3 summaries)
- REQUIREMENTS.md: SHEL-01 marked complete
2026-02-28 21:20:02 +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
d6209ba4c5
docs(01-02): complete terminal safety primitives plan
2026-02-28 21:14:44 +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
65313eac31
feat(01-01): add Phase 1 deps and implement config/CLI loading
...
- Add signal-hook 0.4.3, toml 1.0.3, serde 1.0, clap 4.5 to Cargo.toml
- Create src/config.rs with Config struct (deny_unknown_fields, serde defaults)
- Implement load_config() with vault_path resolution relative to config file dir
- Implement resolve_config_path() using binary-adjacent bbs.toml as default
- Implement print_config_error() with BBS-themed error messages
- Implement detect_login_shell() and parse_cli() with argv[0] dash stripping
- Create src/terminal.rs with init_terminal(), restore_terminal(), install_panic_hook()
- Wire early startup path in src/main.rs before terminal initialization
2026-02-28 21:12:29 +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
ruohki
c9a777ddbc
docs(state): record phase 1 planning session
2026-02-28 21:09:14 +01:00
ruohki
c97c149366
docs(01-safety-foundation): create phase plan
2026-02-28 21:05:46 +01:00
ruohki
88a93c16ed
docs(01): research phase 1 safety foundation
2026-02-28 20:58:46 +01:00
ruohki
47815f2abf
docs(state): record phase 1 context session
2026-02-28 20:49:58 +01:00
ruohki
d537f04bf6
docs(01): capture phase context
2026-02-28 20:49:44 +01:00
ruohki
4f6c9bcdc9
docs: create roadmap (4 phases)
2026-02-28 20:35:13 +01:00
ruohki
05a301ae63
docs: define v1 requirements
2026-02-28 20:32:34 +01:00
ruohki
b431e7bb1b
docs: complete project research
2026-02-28 20:27:48 +01:00
ruohki
10028d3a8a
chore: add project config
2026-02-28 20:20:16 +01:00
ruohki
1d5ad47411
docs: initialize project
2026-02-28 20:18:58 +01:00
ruohki
7f1a4ce1f1
docs: map existing codebase
2026-02-28 20:12:08 +01:00