Repository navigation
feat(render): implement 8 render types (#19) - #23
Conversation
Adds the render layer — the middle of the 3-axis model. Fetchers produce
Payload, layout engine positions it, this module maps each Payload
variant to its concrete Ratatui widget inside a bordered Block with
optional title.
- text → Paragraph
- list → Table (key / value, status-colored rows)
- gauge → Gauge (clamped ratio 0.0-1.0)
- sparkline → Sparkline
- line_chart → Chart (auto-bounds from series points)
- bar_chart → BarChart
- bignum → tui-big-text BigText
- image → placeholder ("[image: renderer pending]"); deferred
main.rs now dispatches through render_payload with a demo Text payload
instead of rendering Paragraph directly.
Refs #19
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 29 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Completes the 8 render types. Uses ratatui-image 4.x with the half-blocks protocol (`Picker::from_fontsize`) as the v1 default so rendering works in every terminal. Sixel / kitty / iTerm2 opt-in is a later concern (likely driven by config in #2 or env detection). Missing file or decode errors surface as a `[image: ...]` text fallback — one bad path should never take the splash screen down. Minimizes image crate default features (png + jpeg only) to cut binary size, though ratatui-image still pulls in broader format support as a transitive. Closes #19 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
v1 should cover the graphical end-to-end, not punt it to "later". Uses Picker::from_query_stdio on TTY for sixel / kitty / iTerm2 detection, falls back to half-blocks (Picker::from_fontsize) on detection failure. Non-TTY contexts (CI, tests) skip the stdio query entirely via io::IsTerminal gate — avoids hangs waiting for a cursor-position response that won't come. Picker is cached in a OnceLock so the detection query runs at most once per process. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces the single-text demo with a 2-column × 3-row layout showing: - Greeting (text) + Clock (bignum) - CPU (gauge) + Memory (sparkline) - System (list) + PRs (bar_chart) Also makes bignum pick the largest PixelSize that fits the allocated area height (Full ≥ 8 rows, Quadrant ≥ 4, Sextant otherwise) so small cells don't get a cropped render. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous demo showed live CPU% and a memory-history sparkline — both nonsensical for a shell-startup one-shot render. Swapped for data that makes sense at launch time: - Disk / gauge (static snapshot of root partition usage) - Commits (14d) sparkline (retrospective per-day count from git log) - Open PRs retitled with per-repo labels Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Middle axis of the 3-axis model.
render_payloaddispatches each Payload variant to its Ratatui widget inside a bordered Block.textParagraphlistTable(key/value, status-colored rows)gaugeGauge(clamped to 0.0–1.0)sparklineSparklineline_chartChart(auto-bounds)bar_chartBarChartbignumtui-big-textBigTextimageratatui-imagewith sixel / kitty / iTerm2 auto-detection, half-blocks fallbackmain.rsnow renders throughrender_payloadwith a demo Text payload.Design notes
render/mod.rs::build_block), so individual renderers render intoinneronly.Picker::from_query_stdioon TTY for sixel / kitty / iTerm2 detection, falls back to half-blocks (Picker::from_fontsize) on detection failure. Non-TTY contexts (CI, tests) skip the stdio query viaIsTerminalgate to avoid hangs. Picker cached in aOnceLockso the detection query runs at most once per process. Missing file / decode errors render as[image: ...]text fallback.Test plan
cargo buildcargo test(24 passed: 12 payload + 12 render)cargo clippy --all-targets -- -D warningscargo fmt --checkCloses #19.
🤖 Generated with Claude Code