docs(02): create phase plans (3 plans, 3 waves)
This commit is contained in:
@@ -23,7 +23,7 @@ must_haves:
|
|||||||
- "When index.md is missing, user sees a BBS-style error screen with box-drawing border and helpful message"
|
- "When index.md is missing, user sees a BBS-style error screen with box-drawing border and helpful message"
|
||||||
- "User can scroll content with j/k (one line), arrow keys (one line), PgUp/PgDn (full page)"
|
- "User can scroll content with j/k (one line), arrow keys (one line), PgUp/PgDn (full page)"
|
||||||
- "Status bar at the bottom shows filename on the left and keyboard hints on the right in reverse video"
|
- "Status bar at the bottom shows filename on the left and keyboard hints on the right in reverse video"
|
||||||
- "Terminal resize reflows the layout without crashing or corrupting display"
|
- "Terminal resize re-renders content at new width and reflows layout without crashing"
|
||||||
- "Quit behavior from Phase 1 (q key, double Ctrl+C) is preserved"
|
- "Quit behavior from Phase 1 (q key, double Ctrl+C) is preserved"
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: "src/app.rs"
|
- path: "src/app.rs"
|
||||||
@@ -208,8 +208,13 @@ Helper methods:
|
|||||||
**IMPORTANT:** The scroll keys (j/k/arrows/PgUp/PgDn) must NOT trigger the quit prompt dismissal. Currently the `_ =>` branch dismisses the prompt. The scroll keys should be handled before the `_` catch-all, and only dismiss the prompt for truly unrelated keys.
|
**IMPORTANT:** The scroll keys (j/k/arrows/PgUp/PgDn) must NOT trigger the quit prompt dismissal. Currently the `_ =>` branch dismisses the prompt. The scroll keys should be handled before the `_` catch-all, and only dismiss the prompt for truly unrelated keys.
|
||||||
|
|
||||||
**Resize handling (NAV-09):**
|
**Resize handling (NAV-09):**
|
||||||
- In `run_event_loop()`, add `Event::Resize(_, _) => {}` handling — ratatui handles the buffer resize automatically for `Viewport::Fullscreen`; we just need to ensure the event is consumed so it doesn't fall through
|
- App needs to store the raw markdown content so it can re-render on resize. Add a `raw_content: Option<String>` field to App (populated when document is loaded).
|
||||||
- `max_scroll()` recomputes on every draw based on `last_content_height`, so resize is handled naturally
|
- In `run_event_loop()`, handle `Event::Resize(w, _h)`:
|
||||||
|
- If `raw_content` is Some, re-render: `let lines = renderer::render_markdown(&content, w); self.document = DocumentState::Loaded { filename, lines };`
|
||||||
|
- Clamp `scroll_offset` to new `max_scroll()` after re-render
|
||||||
|
- ratatui handles buffer resize automatically for `Viewport::Fullscreen`
|
||||||
|
- This ensures horizontal rules, code block borders, and table widths adapt to the new terminal width
|
||||||
|
- `max_scroll()` recomputes on every draw based on `last_content_height`, so vertical scroll is handled naturally
|
||||||
|
|
||||||
**Preserve ALL Phase 1 behavior:**
|
**Preserve ALL Phase 1 behavior:**
|
||||||
- Double Ctrl+C quit mechanism
|
- Double Ctrl+C quit mechanism
|
||||||
@@ -275,8 +280,8 @@ let initial_doc = match vault::load_document(&app_config.vault_path, "index.md")
|
|||||||
let mut app_state = app::App::new(is_login_shell, app_config, initial_doc);
|
let mut app_state = app::App::new(is_login_shell, app_config, initial_doc);
|
||||||
```
|
```
|
||||||
|
|
||||||
**Event loop resize re-rendering consideration:**
|
**Pass raw content to App for resize re-rendering:**
|
||||||
The initial render uses terminal width at startup. On resize, the content would ideally re-render. For Phase 2, accept the initial render width — re-rendering on resize can be added later if needed. The content still displays correctly; only horizontal rules and code block borders may not be pixel-perfect after resize.
|
When loading a Loaded document, also pass the raw markdown string to App so it can re-render on resize. Update `App::new()` signature to accept an optional raw content string, or store it alongside the DocumentState.
|
||||||
|
|
||||||
**Remove the `#[allow(dead_code)]` on config field** in app.rs if it's now used (vault_path is accessed). Actually, config is passed at construction but vault loading happens in main.rs, so config may still appear unused inside App. Keep the allow if needed, or add a method to access vault_path for future use.
|
**Remove the `#[allow(dead_code)]` on config field** in app.rs if it's now used (vault_path is accessed). Actually, config is passed at construction but vault loading happens in main.rs, so config may still appear unused inside App. Keep the allow if needed, or add a method to access vault_path for future use.
|
||||||
</action>
|
</action>
|
||||||
|
|||||||
Reference in New Issue
Block a user