Skip to content

feat(render): layout border-sides + renderer option polish for 0.x presets - #86

Merged
unhappychoice merged 10 commits into
mainfrom
feat/render-options-polish
Apr 23, 2026
Merged

unhappychoice merged 10 commits into
mainfrom
feat/render-options-polish

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #79. Tracks #76 (0.x release scope).

Summary

  • Layout: BorderSpec::Top paints only the top edge so rows can express section dividers with border = "top" + title instead of static hack rows. config.rs::BorderSpec / layout.rs::build_block both thread the new variant through.
  • text_ascii: bundles four FIGlet fonts (standard / small / big / banner) via include_str! — render = { type = "text_ascii", style = "figlet", font = "banner" } is now valid. color = "<theme token>" lets blocks / figlet pick any [theme] key.
  • media_image: align, fit (contain / cover / stretch → Resize::Fit/Crop/Scale), max_width, max_height, padding — small hero images stop warping across the slot.
  • gauge_line: rewritten as an inline composition (year: ▓▓▓▓░░░░ 32% (118 of 365)); label + value_format = \"percent\" | \"fraction\" | \"both\". Fraction/both require RatioData.denominator, new optional field — clock_ratio fills it in for every period.
  • grid_table: layout = \"inline\" (key: value · key: value), column_align per-column alignment in the default rows layout.
  • list_plain / list_timeline: bullet glyph (• / ● / ▪ / → / none), max_items cap, and (timeline only) date_format = \"relative\" | \"absolute\".
  • chart_sparkline: inline label prefix + style = \"bars\" | \"line\".
  • status_badge: shape = \"rounded\" | \"square\" | \"none\" + padding for pill framing.
  • Best-effort options on the rest: chart_pie (legend position / donut), chart_line / chart_scatter (axes block + scatter marker), chart_bar (horizontal / stacked / max_bars), gauge_circle (ring_thickness / label_position — accepted for forward compat), grid_heatmap (cell_char), grid_calendar (week_start / marker — accepted for forward compat).
  • Plumbing: theme::token_color() resolves any single-colour key by name. Every renderer declares option_schemas() so cargo xtask regenerates the reference docs cleanly.

Out of scope (future issues): the { sides, style } object form of border spec (no demand yet), presets themselves (#77 rewrites their static ─── title ─── rows to border = \"top\" + title once that issue lands).

Test plan

  • cargo test — 371 passing, no regressions.
  • cargo clippy --all-targets -- -D warnings — clean.
  • cargo fmt --all -- --check — clean.
  • cargo xtask regenerates the docs-site reference pages from the new schemas.
  • Smoke-test in a real terminal: border = \"top\" row paints a single rule with title, font = \"banner\" renders, gauge_line shows year: ▓░ 32% (118 of 365).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Top border style configuration for panels
    • GitHub Languages fetcher to display repository language statistics
    • Project and ProjectName fetchers for dynamic repository information
    • Four new FIGlet font options (banner, big, small, standard) for ASCII text rendering
    • Extended renderer options including font selection, color theming, layout customization, and chart/gauge configuration
  • Improvements

    • Enhanced ratio display with denominator values for fraction-based rendering
    • Dashboard configuration updated with dynamic data fetchers and improved layout

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 17 seconds before requesting another review.

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 11 minutes and 17 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37723c81-6dcc-4e67-9b20-5c749c005cbf

📥 Commits

Reviewing files that changed from the base of the PR and between 5f09bce and 6226552.

📒 Files selected for processing (3)
  • THIRDPARTY-LICENSES.md
  • about.hbs
  • about.toml
📝 Walkthrough

Walkthrough

This PR implements renderer option schemas and option-driven rendering across ~25 renderers, adds RatioData.denominator field support, extends border styling with BorderStyle::Top, bundles FIGlet fonts, introduces two new GitHub fetchers, adds theme token color lookup, and refactors the dashboard configuration to leverage these capabilities.

Changes

Cohort / File(s) Summary
Border styling
src/config.rs, src/layout.rs
Added BorderSpec::Top variant and BorderStyle::Top mapping; updated panel block construction to derive Borders value dynamically via to_borders helper; new unit test verifies top-only border rendering with title.
Ratio payload
src/payload.rs, src/fetcher/clock/ratio.rs, src/fetcher/read_store.rs, src/fetcher/system.rs, src/samples.rs
Extended RatioData with optional denominator: Option<u64> field; updated ClockRatioFetcher::compute to call total_units helper for period-specific totals; updated fetcher payloads and samples to include denominator field.
Fetcher infrastructure & new fetchers
src/fetcher/mod.rs, src/fetcher/github/mod.rs, src/fetcher/github/languages.rs, src/fetcher/project.rs
Made github::{client, common} modules pub(crate) and added languages submodule; registered ProjectName and Project fetchers in the registry; added GithubLanguages fetcher for language distribution; ProjectName derives git repo name, Project fetches GitHub metadata and supports multiple output shapes.
Theme system
src/theme/mod.rs
Added token_color(theme, name) function for name-based theme color lookup with fallback to None for unrecognized tokens.
Renderer options infrastructure
src/render/mod.rs
Extended RenderOptions with ~25 new optional fields (e.g., font, color, fit, sizing/padding/labeling controls, chart/list/grid/badge behavior); added #[allow(clippy::large_enum_variant)] to RenderSpec; updated is_empty_body test to include RatioData.denominator.
Animated renderers with options
src/render/animated_postfx.rs, src/render/animated_typewriter.rs
Added option_schemas() method to both; AnimatedPostfxRenderer refactored inner_options to clone full RenderOptions while clearing postfx-specific fields; AnimatedTypewriterRenderer defines align schema and applies it via existing parse_align.
Chart renderers with options
src/render/chart_bar.rs, src/render/chart_line.rs, src/render/chart_pie.rs, src/render/chart_scatter.rs, src/render/chart_sparkline.rs
Added option_schemas() to all five; chart_bar now caps bars via opts.max_bars and respects opts.horizontal/opts.bar_width; chart_line wraps plot in bordered block when opts.axes enabled; chart_pie supports legend placement and donut mode; chart_scatter selects marker glyph and conditionally draws bordered block; chart_sparkline added label prefix and style option ("bars" vs "line") with glyph-based line rendering.
Gauge renderers with options
src/render/gauge_circle.rs, src/render/gauge_line.rs
GaugeCircleRenderer added option_schemas for ring_thickness and label_position; GaugeLineRenderer refactored from LineGauge to manual Paragraph construction, added label/value_format options, supports percent/fraction/both suffix formatting with denominator fallback.
Grid renderers with options
src/render/grid_calendar.rs, src/render/grid_heatmap.rs, src/render/grid_table.rs
All three added option_schemas(); grid_calendar defines week_start and marker schemas; grid_heatmap extracts cell glyph from opts.cell_char with fallback; grid_table added dual layout modes ("rows" vs "inline"), column alignment, and refactored rendering to support both tabular and inline key: value · key: value formats.
List renderers with options
src/render/list_plain.rs, src/render/list_timeline.rs
Added option_schemas() for bullet, max_items, align (+ date_format for timeline); list_plain prefixes lines with bullet glyph and truncates to max_items; list_timeline caps events and switches between relative/absolute date labels; indentation logic updated to account for bullet width.
Media and status renderers with options
src/render/media_image.rs, src/render/status_badge.rs
media_image now applies padding, max_width/max_height, align, and fit options (mapping to Resize::{Crop, Scale, Fit}); status_badge added shape (rounded/square framing) and padding options, refactored span construction.
Text ASCII renderer with fonts
src/render/text_ascii.rs
Added font and color options with schemas; figletify calls new load_font helper to select bundled .flf files (standard/small/big/banner) with fallback; both render_blocks and render_figlet apply resolve_color helper for theme-based foreground color; added theme::PANEL_TITLE to color keys; new tests validate font loading and color resolution.
FIGlet font assets
src/render/figlet_fonts/banner.flf, src/render/figlet_fonts/big.flf, src/render/figlet_fonts/small.flf, src/render/figlet_fonts/standard.flf, src/render/figlet_fonts/NOTICE.md
Bundled four FIGlet font files with complete glyph definitions and metadata; added NOTICE.md documenting font sources and licenses.
Runtime shape derivation
src/runtime.rs
Updated derive_shape to intersect renderer-accepted shapes with fetcher's shapes() ordering; returns fetcher's first accepted shape if available, otherwise falls back to renderer's first shape; added unit test for multi-accepted-shape scenario.
Dashboard configuration
.splashboard/dashboard.toml
Restructured from static dividers to data-driven header/body using project_name and project fetchers; updated hero (figlet banner font, shorter duration) and subtitle (centered text_plain); added widgets for stars, PRs, issues, commits heatmap, contributors, languages; applied border = "top" and title attributes to row layout; increased row heights; removed static labels/dividers and commit timeline.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 Ears wiggle with joy

Borders now top where they please,
Options dance through renderers with ease!
FIGlet fonts bundled—a typographic dream,
Ratios, themes, and fetchers align,
Dashboard sings with data so fine—
A rabbit's delight! ✨🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding layout border-sides support (BorderSpec::Top) and renderer option enhancements for 0.x presets, matching the core PR objectives.
Linked Issues check ✅ Passed The PR comprehensively implements all coding requirements from #79: BorderSpec::Top layout support, text_ascii figlet fonts and color options, media_image sizing/alignment, gauge_line inline labels, grid_table inline layout, list renderers with bullets/caps/dates, chart_sparkline labels, status_badge styling, option schemas for all renderers, and theme::token_color() plumbing.
Out of Scope Changes check ✅ Passed All changes align with #79 scope: layout border sides, renderer option polish, RatioData.denominator for gauge_line (required for fraction formatting), new fetchers (ProjectName/Project/GithubLanguages) supporting dashboard preset requirements, and FIGlet font bundling are all within stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/render-options-polish

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (4)
src/render/gauge_circle.rs (1)

11-26: Schemas advertise options with no runtime effect.

Both ring_thickness and label_position are accepted but the render() method still uses _opts, so neither has any behavior. The description text honestly calls them "reserved/no visible effect" — that's defensible for forward-compat, but it means generated docs will list two knobs that do nothing today. Consider either (a) wiring label_position = "below" now (it's achievable with a two-row split + a text line) or (b) dropping these schemas until there's an implementation, to avoid expanding the public config surface with dead keys.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/gauge_circle.rs` around lines 11 - 26, OPTION_SCHEMAS currently
advertises ring_thickness and label_position but render() never reads them (it
still uses _opts), so either remove these dead keys from the public schema or
actually implement their behavior; to fix quickly remove the OptionSchema
entries for "ring_thickness" and "label_position" from OPTION_SCHEMAS so the
docs don't expose no-op options, or implement wiring by reading
_opts.label_position and _opts.ring_thickness in render(), branching on
label_position == "below" to split the widget into two rows and draw the label
on the second row and applying ring_thickness when drawing the circular gauge;
reference OPTION_SCHEMAS, render(), ring_thickness, label_position, and _opts to
locate the relevant code.
src/render/grid_calendar.rs (1)

17-32: Both new schemas are no-ops today.

week_start and marker are accepted but neither is read in render_calendar (ratatui's Monthly widget is always Sun-first, and event cells are style-only). The descriptions do call this out, so users can discover it from docs, but generated reference pages will still list two knobs that do nothing. Fine as forward-compat scaffolding; just flagging that this pattern (schema-without-implementation) is now applied to several renderers and may accumulate config-surface debt if the Ratatui upgrades never arrive.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/grid_calendar.rs` around lines 17 - 32, OPTION_SCHEMAS currently
exposes two no-op options (week_start and marker) that aren’t used by
render_calendar (Monthly widget is Sun-first and event cells are style-only);
remove the misleading config surface by deleting the OptionSchema entries for
"week_start" and "marker" from OPTION_SCHEMAS in src/render/grid_calendar.rs so
generated docs no longer advertise unused knobs, and ensure any code that
iterates OPTION_SCHEMAS still behaves correctly after those entries are removed
(refer to OPTION_SCHEMAS, the "week_start" and "marker" OptionSchema items, and
render_calendar/Monthly).
src/render/figlet_fonts/standard.flf (1)

1-2237: Bundled FIGlet font asset — no code review applicable.

Standard is by Glenn Chappell & Ian Chai (1993), with Latin-2/3/4/5 additions by John Cowan and the 0xCA0 addition by patorjk. In-file credits are preserved. If your distribution requires top-level attribution, add these credits to a NOTICE or THIRD_PARTY file. Note: This file lacks a trailing newline, which some tools (including cargo fmt) may attempt to normalize.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/figlet_fonts/standard.flf` around lines 1 - 2237, The file
"src/render/figlet_fonts/standard.flf" ends without a trailing newline (look for
the header "Standard by Glenn Chappell & Ian Chai 3/93" and the final glyph
block "0xCA0  KANNADA LETTER TTHA"); fix by adding a single newline character at
EOF (do not alter any font lines or in-file credits), and if your distribution
needs top-level attribution also add the provided credits to your
NOTICE/THIRD_PARTY file.
src/render/grid_table.rs (1)

92-111: Minor: prefer iterator composition over the index loop.

Per the repo's Rust guideline ("Prefer map / filter / reduce over imperative loops"), render_inline can be expressed as a flat_map with a reduce-style separator without changing behaviour. Not blocking.

Sketch
let spans: Vec<Span> = data.items.iter().enumerate().flat_map(|(i, entry)| {
    let row_style = entry.status
        .map(|s| Style::default().fg(super::status_badge::status_color(s, theme)))
        .unwrap_or(text);
    let sep = (i > 0).then(|| Span::styled(" · ", dim));
    let value = entry.value.as_deref().map(|v| {
        [Span::styled(": ", row_style), Span::styled(v.to_string(), row_style)]
    });
    sep.into_iter()
        .chain(std::iter::once(Span::styled(entry.key.clone(), row_style)))
        .chain(value.into_iter().flatten())
}).collect();

As per coding guidelines: "Prefer map / filter / reduce over imperative loops in Rust code".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/grid_table.rs` around lines 92 - 111, The render_inline function
currently builds spans with an imperative indexed loop; refactor it to use
iterator composition (e.g.,
data.items.iter().enumerate().flat_map(...).collect::<Vec<Span>>()) so the
separator and optional value are produced via .then()/.into_iter()/chain()
instead of manual i checks and pushes, preserving the row_style computation
(using entry.status.map(...).unwrap_or(text)) and the use of
super::status_badge::status_color to pick colors; keep the final call
frame.render_widget(Paragraph::new(Line::from(spans)).style(text), area)
unchanged so behavior remains identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.splashboard/config.toml:
- Around line 29-33: The recent_commits widget (id "recent_commits", fetcher
"git_recent_commits") requests 10 entries via format = "10" but the bordered row
only has 8 usable content rows, so reduce the requested items to fit the
renderer or increase the row height; change format from "10" to "8" (or adjust
the render row height/padding in the render block) and apply the same adjustment
for any other widgets that use format = "10" (e.g., the other timeline widgets
mentioned) so items are not clipped.

In `@src/fetcher/clock/ratio.rs`:
- Around line 98-123: The denominator granularity in total_units is inconsistent
(seconds for Day/Hour produce ugly fractions); change Period::Day from 86_400 to
24 and Period::Hour from 3_600 to 60 so fractions render as "hours of 24" and
"minutes of 60" (keep return type u64), update the doc-comment to state "hours
for day, minutes for hour, days for week/month/quarter/year", and leave the
Month/Quarter/Year/Week logic unchanged (function: total_units).

In `@src/render/animated_postfx.rs`:
- Around line 24-38: The OptionSchema for "effect" is out of sync with
build_effect: update the schema (the OptionSchema with name "effect") so its
type_hint and documented variants match the actual arms in build_effect (include
sweep_in_right/sweep_in_down/sweep_in_up and
slide_in_right/slide_in_down/slide_in_up and omit "glitch" unless you implement
a "glitch" arm in build_effect), and ensure the default remains a valid variant
(e.g., "fade_in"); alternatively, if you prefer to support "glitch", add a
corresponding "glitch" arm in build_effect that behaves consistently with other
effects.

In `@src/render/chart_scatter.rs`:
- Around line 20-34: The docs for the "marker" OptionSchema advertise values
("dot", "cross", "plus", or any single char") that do not match the actual
parser; update either the parser or the schema: either 1) extend
parse_marker(...) to accept and map the advertised names ("cross", "plus", etc.)
to the existing rendering modes ("block", "bar", "braille", "half_block",
"dot"), or 2) change the OptionSchema entry for name = "marker" to list the
exact supported tokens parsed by parse_marker (e.g., "block", "bar", "braille",
"half_block", "dot") and adjust the description text accordingly; locate the
parser by the function parse_marker and the schema by
OPTION_SCHEMAS/OptionSchema in chart_scatter.rs to make the consistent change.

In `@src/render/figlet_fonts/big.flf`:
- Around line 1-2204: Add repo-level attribution for the FIGlet fonts by adding
a NOTICE or a "Third-Party Licenses" section in the README (and updating the
LICENSE if required) that names the fonts and authors referenced in this diff:
"Big by Glenn Chappell (4/93)" and "Greek characters by Bruce Jakeway", and also
list the other bundled FIGlet fonts (Big, Small, Banner, Standard) plus the
figlet-rs library; include the font header text (the attribution lines present
in big.flf) or a short citation, state the font redistribution permission, and
link to the original FIGlet/font source or project so reviewers can verify
licensing.

In `@src/render/grid_heatmap.rs`:
- Around line 132-134: cell_glyph currently returns the full &str so
multi-codepoint inputs like "ab" paint multiple columns; change it to return a
single visual glyph (first grapheme) and update callsites (paint_cells and the
set_symbol invocation) to accept &str/owned String accordingly: implement
cell_glyph to pick the first grapheme using UnicodeSegmentation
(graphemes(true).next()) and fall back to CELL_GLYPH when None or empty, return
an owned String (or &'static str when falling back), and adjust paint_cells
signature/callsite to accept &str (or String) so set_symbol always receives
exactly one visible glyph.

In `@src/render/mod.rs`:
- Around line 146-148: Update the gauge_line/value_format docs to reflect that
fraction output now uses RatioData.denominator (and renders as "118 of 365")
instead of parsing a label like "fraction:n/d"; mention the new denominator
field on the RatioData struct and show the updated example format ("both" ->
`32% (118 of 365)` or "fraction" -> `118 of 365`) and that it falls back to
percent if denominator is missing. Reference gauge_line/value_format and
RatioData.denominator in the doc update.

---

Nitpick comments:
In `@src/render/figlet_fonts/standard.flf`:
- Around line 1-2237: The file "src/render/figlet_fonts/standard.flf" ends
without a trailing newline (look for the header "Standard by Glenn Chappell &
Ian Chai 3/93" and the final glyph block "0xCA0  KANNADA LETTER TTHA"); fix by
adding a single newline character at EOF (do not alter any font lines or in-file
credits), and if your distribution needs top-level attribution also add the
provided credits to your NOTICE/THIRD_PARTY file.

In `@src/render/gauge_circle.rs`:
- Around line 11-26: OPTION_SCHEMAS currently advertises ring_thickness and
label_position but render() never reads them (it still uses _opts), so either
remove these dead keys from the public schema or actually implement their
behavior; to fix quickly remove the OptionSchema entries for "ring_thickness"
and "label_position" from OPTION_SCHEMAS so the docs don't expose no-op options,
or implement wiring by reading _opts.label_position and _opts.ring_thickness in
render(), branching on label_position == "below" to split the widget into two
rows and draw the label on the second row and applying ring_thickness when
drawing the circular gauge; reference OPTION_SCHEMAS, render(), ring_thickness,
label_position, and _opts to locate the relevant code.

In `@src/render/grid_calendar.rs`:
- Around line 17-32: OPTION_SCHEMAS currently exposes two no-op options
(week_start and marker) that aren’t used by render_calendar (Monthly widget is
Sun-first and event cells are style-only); remove the misleading config surface
by deleting the OptionSchema entries for "week_start" and "marker" from
OPTION_SCHEMAS in src/render/grid_calendar.rs so generated docs no longer
advertise unused knobs, and ensure any code that iterates OPTION_SCHEMAS still
behaves correctly after those entries are removed (refer to OPTION_SCHEMAS, the
"week_start" and "marker" OptionSchema items, and render_calendar/Monthly).

In `@src/render/grid_table.rs`:
- Around line 92-111: The render_inline function currently builds spans with an
imperative indexed loop; refactor it to use iterator composition (e.g.,
data.items.iter().enumerate().flat_map(...).collect::<Vec<Span>>()) so the
separator and optional value are produced via .then()/.into_iter()/chain()
instead of manual i checks and pushes, preserving the row_style computation
(using entry.status.map(...).unwrap_or(text)) and the use of
super::status_badge::status_color to pick colors; keep the final call
frame.render_widget(Paragraph::new(Line::from(spans)).style(text), area)
unchanged so behavior remains identical.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 002bfd23-d66a-4380-b7b1-356b959d7466

📥 Commits

Reviewing files that changed from the base of the PR and between e4f632c and 276caf3.

📒 Files selected for processing (31)
  • .splashboard/config.toml
  • src/config.rs
  • src/fetcher/clock/ratio.rs
  • src/fetcher/read_store.rs
  • src/fetcher/system.rs
  • src/layout.rs
  • src/payload.rs
  • src/render/animated_postfx.rs
  • src/render/animated_typewriter.rs
  • src/render/chart_bar.rs
  • src/render/chart_line.rs
  • src/render/chart_pie.rs
  • src/render/chart_scatter.rs
  • src/render/chart_sparkline.rs
  • src/render/figlet_fonts/banner.flf
  • src/render/figlet_fonts/big.flf
  • src/render/figlet_fonts/small.flf
  • src/render/figlet_fonts/standard.flf
  • src/render/gauge_circle.rs
  • src/render/gauge_line.rs
  • src/render/grid_calendar.rs
  • src/render/grid_heatmap.rs
  • src/render/grid_table.rs
  • src/render/list_plain.rs
  • src/render/list_timeline.rs
  • src/render/media_image.rs
  • src/render/mod.rs
  • src/render/status_badge.rs
  • src/render/text_ascii.rs
  • src/samples.rs
  • src/theme/mod.rs

Comment thread .splashboard/config.toml Resolved
Comment thread src/fetcher/clock/ratio.rs Resolved
Comment thread src/render/animated_postfx.rs Resolved
Comment thread src/render/chart_scatter.rs Resolved
Comment thread src/render/figlet_fonts/big.flf Resolved
Comment thread src/render/grid_heatmap.rs Resolved
Comment thread src/render/mod.rs Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.splashboard/config.toml (1)

97-103: ⚠️ Potential issue | 🟡 Minor

Subtitle row has zero slack for longer descriptions.

list_plain renders one line per TextBlock entry, so project emits exactly 3 lines (slug / description / license). The row is also length = 3, which fits perfectly today but leaves no room if the description wraps within the 70-cell column, or if a future project payload adds a field. A longer description on a narrow terminal will visually clip the license line.

Consider height = { length = 4 } (or min = 3) for a small safety margin, or documenting the 70-cell width as a hard assumption.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.splashboard/config.toml around lines 97 - 103, The subtitle row currently
fixes its height to exactly 3 lines (height = { length = 3 }) which leaves no
slack if the description wraps in the 70-cell width; update the [[row]] entry
that contains [[row.child]] with widget = "subtitle" to allow extra room by
changing height to a safer default (e.g., height = { length = 4 }) or use a
minimum (e.g., height = { min = 3 }) so wrapped descriptions won’t clip the
license line, and/or add a comment documenting the 70-cell width assumption.
🧹 Nitpick comments (2)
src/render/grid_table.rs (1)

99-129: Extract inline span construction out of render_inline.

render_inline now both assembles every span and renders the widget, making it longer than the local Rust guideline and relying on a mutable push loop. Consider moving span construction into a small iterator-based helper.

♻️ Proposed refactor
 fn render_inline(
     frame: &mut Frame,
     area: Rect,
     data: &EntriesData,
     opts: &RenderOptions,
     theme: &Theme,
 ) {
     let text = Style::default().fg(theme.text);
-    let dim = Style::default().fg(theme.text_dim);
-    let mut spans: Vec<Span> = Vec::new();
-    for (i, entry) in data.items.iter().enumerate() {
-        if i > 0 {
-            spans.push(Span::styled(" · ", dim));
-        }
-        let row_style = entry
-            .status
-            .map(|s| Style::default().fg(super::status_badge::status_color(s, theme)))
-            .unwrap_or(text);
-        spans.push(Span::styled(entry.key.clone(), row_style));
-        if let Some(v) = entry.value.as_deref() {
-            spans.push(Span::styled(": ", row_style));
-            spans.push(Span::styled(v.to_string(), row_style));
-        }
-    }
+    let spans = inline_spans(data, text, theme);
     frame.render_widget(
         Paragraph::new(Line::from(spans))
             .style(text)
             .alignment(parse_align(opts.align.as_deref())),
         area,
     );
 }
+
+fn inline_spans(data: &EntriesData, text: Style, theme: &Theme) -> Vec<Span<'static>> {
+    let dim = Style::default().fg(theme.text_dim);
+
+    data.items
+        .iter()
+        .enumerate()
+        .flat_map(|(i, entry)| {
+            let row_style = entry
+                .status
+                .map(|s| Style::default().fg(super::status_badge::status_color(s, theme)))
+                .unwrap_or(text);
+
+            [
+                (i > 0).then_some(Span::styled(" · ", dim)),
+                Some(Span::styled(entry.key.clone(), row_style)),
+                entry.value.as_ref().map(|_| Span::styled(": ", row_style)),
+                entry
+                    .value
+                    .as_ref()
+                    .map(|value| Span::styled(value.clone(), row_style)),
+            ]
+            .into_iter()
+            .flatten()
+        })
+        .collect()
+}

As per coding guidelines, **/*.rs: “Prefer map / filter / reduce over imperative loops in Rust code” and “Keep functions small (~10–15 lines) and maintain single responsibility in Rust code.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/grid_table.rs` around lines 99 - 129, The render_inline function
mixes span construction and rendering and uses an imperative push loop; extract
the span-building logic into a small helper (e.g., fn build_inline_spans(data:
&EntriesData, theme: &Theme) -> Vec<Span>) that uses iterator combinators
(map/flat_map/enumerate) instead of mutable pushes to produce the Vec<Span> (or
impl Iterator<Item=Span>), then have render_inline call that helper and keep
only the Paragraph creation/rendering there (preserve
parse_align(opts.align.as_deref()) and the status color lookup via
super::status_badge::status_color).
src/fetcher/project.rs (1)

100-124: Consider treating auth / API failures as placeholders too.

Repo-resolution errors are caught and rendered as a friendly ⚠ … placeholder (Line 103), but any failure from rest_get — missing token, rate limiting, 404 Not Found, network blip — propagates via ? and becomes a generic fetch error. The two failure modes are equally user-correctable (missing auth, private repo) and would benefit from the same actionable placeholder treatment for a polished preset.

Optional: unify error handling
-        let info: RepoInfo = rest_get(&format!("/repos/{}/{}", slug.owner, slug.name)).await?;
+        let info: RepoInfo = match rest_get::<RepoInfo>(&format!(
+            "/repos/{}/{}",
+            slug.owner, slug.name
+        ))
+        .await
+        {
+            Ok(i) => i,
+            Err(e) => return Ok(placeholder(&e.to_string())),
+        };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/fetcher/project.rs` around lines 100 - 124, In fetch (async fn fetch)
unify error handling so failures from rest_get are returned as the same
user-facing placeholder as resolve_repo does: instead of propagating the
rest_get ? error, catch the Result/any error from
rest_get(&format!("/repos/{}/{}", slug.owner, slug.name)).await and on Err(e)
return Ok(placeholder(&e.to_string())), then continue building Metadata and Body
as before; keep resolve_repo handling unchanged and ensure the placeholder
contains the error string for actionable feedback.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.splashboard/config.toml:
- Around line 97-103: The subtitle row currently fixes its height to exactly 3
lines (height = { length = 3 }) which leaves no slack if the description wraps
in the 70-cell width; update the [[row]] entry that contains [[row.child]] with
widget = "subtitle" to allow extra room by changing height to a safer default
(e.g., height = { length = 4 }) or use a minimum (e.g., height = { min = 3 }) so
wrapped descriptions won’t clip the license line, and/or add a comment
documenting the 70-cell width assumption.

---

Nitpick comments:
In `@src/fetcher/project.rs`:
- Around line 100-124: In fetch (async fn fetch) unify error handling so
failures from rest_get are returned as the same user-facing placeholder as
resolve_repo does: instead of propagating the rest_get ? error, catch the
Result/any error from rest_get(&format!("/repos/{}/{}", slug.owner,
slug.name)).await and on Err(e) return Ok(placeholder(&e.to_string())), then
continue building Metadata and Body as before; keep resolve_repo handling
unchanged and ensure the placeholder contains the error string for actionable
feedback.

In `@src/render/grid_table.rs`:
- Around line 99-129: The render_inline function mixes span construction and
rendering and uses an imperative push loop; extract the span-building logic into
a small helper (e.g., fn build_inline_spans(data: &EntriesData, theme: &Theme)
-> Vec<Span>) that uses iterator combinators (map/flat_map/enumerate) instead of
mutable pushes to produce the Vec<Span> (or impl Iterator<Item=Span>), then have
render_inline call that helper and keep only the Paragraph creation/rendering
there (preserve parse_align(opts.align.as_deref()) and the status color lookup
via super::status_badge::status_color).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab0cd55d-87cc-417d-84fd-dcf8cd9aced1

📥 Commits

Reviewing files that changed from the base of the PR and between 276caf3 and b9bd6d0.

📒 Files selected for processing (5)
  • .splashboard/config.toml
  • src/fetcher/github/mod.rs
  • src/fetcher/mod.rs
  • src/fetcher/project.rs
  • src/render/grid_table.rs

unhappychoice and others added 6 commits April 23, 2026 09:05
…esets

Closes #79. Closes out the 0.x renderer / option polish pass so the
preset work (#77) can lean on real primitives instead of static-
divider hacks.

## Layout
- `BorderSpec::Top` (config + layout): paints only the top edge, with
  `title = "..."` hanging off the rule. Enables section dividers as
  `border = "top"` + `title` on any row or child, instead of a dummy
  static widget per divider.

## text_ascii
- Bundles four FIGlet fonts (standard / small / big / banner) as
  `include_str!` assets; `font = "banner"` switches between them.
- `color = "<theme token>"` lets blocks + figlet styles pick any
  `[theme]` key (e.g. `"panel_title"`); unknown names fall back to
  `text`.
- Plumbing: new `theme::token_color()` resolves any single-colour
  token by its TOML name.

## media_image
- `align` + `fit` ("contain" / "cover" / "stretch" → `Resize::Fit` /
  `Crop` / `Scale`) + `max_width` / `max_height` + `padding`.

## gauge_line
- Rewritten as an inline composition
  (`year: ▓▓▓▓░░░░ 32% (118 of 365)`). `label` option (falls back to
  `RatioData.label`) + `value_format = "percent" | "fraction" |
  "both"`.

## grid_table
- `layout = "inline"` (`key: value · key: value`) in addition to
  the default rows form; `column_align` per-column alignment;
  `align` honoured on inline layout (matches text_plain / list_*).

## list_plain / list_timeline
- `bullet` glyph (`•` / `●` / `▪` / `→` / `none`), `max_items` cap,
  and (timeline only) `date_format = "relative" | "absolute"`.

## chart_sparkline
- Inline `label` prefix + `style = "bars" | "line"`.

## chart_bar
- `horizontal` orientation, `max_bars` top-N cap (sorted descending),
  `stacked` placeholder for future multi-series, `bar_width` with
  direction-aware default (3 for vertical, 1 for horizontal).

## status_badge
- `shape = "rounded" | "square" | "none"` + `padding`.

## Best-effort on the rest
- `chart_pie` (legend position, donut mode).
- `chart_line` / `chart_scatter` (axes block, scatter `marker`).
- `gauge_circle` (ring_thickness / label_position — accepted for
  forward compat).
- `grid_heatmap` (`cell_char` glyph override).
- `grid_calendar` (`week_start` / `marker` — accepted for forward
  compat).

Every renderer (including `animated_postfx` /
`animated_typewriter`) now declares `option_schemas()` so
`cargo xtask` regenerates the reference pages from a single source
of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`gauge_line`'s new `value_format = "fraction" | "both"` needs the
underlying count, not just the 0..=1 ratio, to render `118 of 365`.
Add an optional `denominator: Option<u64>` on `RatioData` and wire
it up in fetchers that know the total:

- `clock_ratio` populates `total_units(period)` (day/hour in
  seconds, week/month/quarter/year in days) so gauge_line can render
  the real fraction against the period's natural granularity.
- Stub `None` on the other ratio-emitting fetchers (system,
  read_store); they can light it up later when useful.

`gauge_line` falls back to percent when `denominator` is None, so
this stays a pure addition.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two new fetchers for the repo header band:

- `project_name` — local Safe. Parses `owner/name` out of the git
  `origin` remote (via the shared `slug_from_url` helper) and emits
  the name portion as Text, so `text_ascii` figlet can render the
  repo name as a hero. Falls back to the cwd directory name when no
  remote exists.

- `project` — Safe (fixed-host GitHub API). Hits `/repos/{o}/{n}`
  and emits `{ slug, description, license.spdx_id }` as `Entries`,
  `TextBlock` (one line per field), or `Text` (`·`-joined).
  Missing fields are filtered out so the output stays tight.

Plumbing: exposes `fetcher::github::{client, common}` as pub(crate)
so non-github fetchers can reuse `rest_get` / `resolve_repo` /
`slug_from_url` without re-implementing the remote parse.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
New `GithubLanguages` fetcher hits `/repos/{o}/{n}/languages` and
emits the byte-count breakdown as `Bars` (for chart_pie /
chart_bar) or `Entries` with percent values (for grid_table).
Sorted descending, capped to `limit` (default 6), overflow folded
into an `"other"` bucket so totals still add up. Safe — fixed
api.github.com host, same trust profile as the other `github_*`
fetchers.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`derive_shape` used to pick the renderer's first accepted shape
regardless of what the fetcher could emit. For a multi-shape fetcher
(e.g. `project` lists `[Entries, TextBlock, Text]`) paired with a
multi-shape renderer (`text_plain` accepts `[Text, TextBlock]`),
this forced the subtitle back to the one-liner `Text` form instead
of the multi-line `TextBlock` the fetcher naturally prefers.

New rule: intersect the renderer's accepts with the fetcher's
shapes in **fetcher order**, picking the first match. Fetchers
already list their most-natural shape first, so this respects
their stated preference. Falls back to renderer-first when the
fetcher is unknown or the intersection is empty, so the old
placeholder / mismatch paths behave identically.

Regression-guarded by a new test; the existing "renderer wins over
fetcher default" test still passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Rewrites `.splashboard/dashboard.toml` to lean on the #79 / new
fetchers instead of static-divider hacks:

- Header band (full-width `bg = "subtle"`):
  • hero via `project_name` → text_ascii figlet banner, coral via
    `color = "panel_title"`, animated_postfx coalesce.
  • subtitle via `project` TextBlock → text_plain centered;
    slug / description / license each on their own line.
  • `github_repo_stars` inline stats row.

- Body, three 2-column rows with `border = "top"` + `title` per
  child so the divider rule spans exactly the widget's own width:
  • languages (horizontal chart_bar) | releases (list_timeline).
  • PRs (list_plain) | issues (list_plain).
  • commits heatmap (git_commits_activity) | top contributors
    (chart_bar capped at 5).

A 2-cell `gap` static widget between 34-wide siblings stops the
sibling rules from touching in the middle. No `[general]` section —
padding / viewport / theme preferences now live in
`$HOME/.splashboard/settings.toml` per the #85 split.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice force-pushed the feat/render-options-polish branch from 3d3f7be to f2560d5 Compare April 23, 2026 00:06
@codecov

codecov Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.59664% with 219 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.88%. Comparing base (e4d21a2) to head (6226552).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/project.rs 57.67% 80 Missing ⚠️
src/fetcher/github/languages.rs 74.80% 32 Missing ⚠️
src/render/chart_sparkline.rs 84.53% 15 Missing ⚠️
src/render/chart_scatter.rs 58.62% 12 Missing ⚠️
src/fetcher/clock/ratio.rs 47.05% 9 Missing ⚠️
src/render/grid_table.rs 89.77% 9 Missing ⚠️
src/render/chart_line.rs 60.00% 8 Missing ⚠️
src/render/list_plain.rs 85.36% 6 Missing ⚠️
src/render/media_image.rs 95.90% 5 Missing ⚠️
src/render/status_badge.rs 90.74% 5 Missing ⚠️
... and 13 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   76.53%   76.88%   +0.34%     
==========================================
  Files          72       74       +2     
  Lines       10254    11354    +1100     
==========================================
+ Hits         7848     8729     +881     
- Misses       2406     2625     +219     
Files with missing lines Coverage Δ
src/fetcher/github/mod.rs 100.00% <100.00%> (ø)
src/fetcher/mod.rs 75.90% <100.00%> (+0.19%) ⬆️
src/fetcher/system.rs 78.64% <100.00%> (+0.13%) ⬆️
src/layout.rs 84.69% <100.00%> (+0.79%) ⬆️
src/payload.rs 100.00% <100.00%> (ø)
src/render/mod.rs 90.70% <100.00%> (+0.02%) ⬆️
src/render/text_ascii.rs 88.43% <100.00%> (+3.65%) ⬆️
src/theme/mod.rs 93.42% <100.00%> (+0.53%) ⬆️
src/config.rs 81.28% <50.00%> (-0.21%) ⬇️
src/fetcher/read_store.rs 71.48% <0.00%> (-0.30%) ⬇️
... and 21 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

unhappychoice and others added 2 commits April 23, 2026 10:02
- `fetcher::github::languages` — swap `sort_by(|a,b| b.1.cmp(&a.1))`
  for `sort_by_key(|e| Reverse(e.1))` so clippy 1.95's
  `unnecessary_sort_by` stops failing CI.
- `fetcher::clock::ratio::total_units` — year/month/quarter/week
  stay in days, day now reports hours (24), hour reports minutes
  (60). Seconds-level denominators rendered unreadable fractions
  (`43200 of 86400`); whole-unit counts give `12 of 24` / `30 of 60`.
- `render::animated_postfx` effect schema lists every name
  `build_effect` actually handles (sweep_in / slide_in directional
  variants, hsl_shift) and drops the advertised-but-unimplemented
  `glitch`.
- `render::chart_scatter` marker schema matches `parse_marker`:
  dot / block / bar / braille / half_block. Drops `cross` / `plus`
  and the "any single char" claim that the code never honoured.
- `render::grid_heatmap::cell_glyph` truncates the user-supplied
  string to its first `char`. A multi-char input would bleed into
  the 2-col-per-cell geometry's spacer column; the schema already
  promised single-glyph handling, now the code matches.
- `render::mod::RenderOptions::value_format` doc drops the obsolete
  `"fraction:n/d"` label hint and points at `RatioData.denominator`
  instead.
- `src/render/figlet_fonts/NOTICE.md` — attribution table for the
  bundled FIGlet fonts (Standard / Small / Big by Chappell et al.,
  Banner by Youck). License text lives in each `.flf` header per
  FIGlet convention; the NOTICE lists authors + permissions so the
  third-party content is traceable.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`NOTICE` has specific Apache-2.0 semantics (must-redistribute
attribution file) that don't apply here — splashboard ships under
ISC, and the per-font permissions live in the `.flf` headers
already. Renaming to `README.md` keeps the directory-description
content but drops the misleading filename.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/render/mod.rs (1)

114-116: ⚠️ Potential issue | 🟡 Minor

Update the align docs for grid_table inline layout.

This still says grid_table ignores align, but grid_table now honors it for layout = "inline".

Proposed doc fix
-    /// "center", or "right". Not every renderer honours this — text_plain and text_ascii do;
-    /// structural renderers (grid_table, gauge_*, chart_*) ignore it.
+    /// "center", or "right". Not every renderer honours this — text_plain, text_ascii, and
+    /// grid_table's inline layout do; structural renderers generally ignore it.

As per coding guidelines, renderers must honor RenderOptions.align (left / center / right) where it makes sense.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/mod.rs` around lines 114 - 116, Update the documentation comment
for the `align` option to reflect that `grid_table` now respects
`RenderOptions.align` when `layout = "inline"`; locate the doc string around the
`align` description in src/render/mod.rs and change the sentence that says
"structural renderers (grid_table, gauge_*, chart_*) ignore it" to note that
`grid_table` honours `align` for `layout = "inline"` while other structural
renderers still ignore it, and ensure you mention the accepted values ("left",
"center", "right") and that this applies to `RenderOptions.align`.
🧹 Nitpick comments (3)
src/render/list_timeline.rs (1)

25-32: Quote the bullet default for doc-gen consistency.

Every other string-valued default in this file uses inner quotes (e.g. Some("\"relative\""), Some("\"left\"")) — these render as "relative" in the generated reference. bullet's default is a literal token "none" listed in the type_hint, so it should match the same form.

Proposed diff
     OptionSchema {
         name: "bullet",
         type_hint: "\"●\" | \"•\" | \"▪\" | \"→\" | \"none\"",
         required: false,
-        default: Some("none"),
+        default: Some("\"none\""),
         description: "Glyph prefixed to each event after the time column. `none` (default) shows only the time column and title.",
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/list_timeline.rs` around lines 25 - 32, The default for the
"bullet" OptionSchema is currently set as a raw token and should be quoted to
match the other string defaults and doc-gen expectations; locate OPTION_SCHEMAS
and the OptionSchema entry with name "bullet" and change its default from
Some("none") to include inner quotes like Some("\"none\"") so the generated docs
render the default as "none".
src/render/gauge_line.rs (1)

76-84: Minor: reserved over-reserves the bar area by one cell.

compose_spans emits prefix ("{prefix}: ", already prefix_width cells) + bar + suffix (" {suffix}", suffix.chars().count() + 1 cells). So the non-bar footprint is prefix_width + suffix_chars + 1, but reserved adds + 1 + ... + 1, leaving the last cell of every gauge empty. Not a correctness issue; just an unintentional right-margin.

Proposed diff
-    let reserved = prefix_width(&prefix) + 1 + suffix.chars().count() as u16 + 1;
+    // prefix ("{label}: ", already counted) + bar + " {suffix}" (leading space).
+    let reserved = prefix_width(&prefix) + suffix.chars().count() as u16 + 1;
     let bar_width = area.width.saturating_sub(reserved);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/gauge_line.rs` around lines 76 - 84, The gauge over-reserves one
cell because reserved is computed as prefix_width(&prefix) + 1 +
suffix.chars().count() as u16 + 1 while compose_spans already accounts for the
prefix separator; change the reserved calculation in src/render/gauge_line.rs
(the reserved binding used to compute bar_width and filled) to reserved =
prefix_width(&prefix) + suffix.chars().count() as u16 + 1 so the non-bar
footprint equals prefix_width + suffix_chars + 1 and update bar_width/fill
computation to use that value.
src/render/text_ascii.rs (1)

195-203: Optional: fall back to bundled FONT_STANDARD to avoid .expect().

If FIGfont::from_content(source) fails for one of the bundled .flfs, the fallback reparses figlet_rs' built-in standard with .expect(). Since all four bundled fonts (standard.flf, small.flf, big.flf, banner.flf) are already loaded via include_str!() and tested to parse successfully, you can tighten the fallback by retrying FONT_STANDARD directly before panicking, or returning a Result higher up. Very unlikely to matter in practice—tests confirm all bundled fonts load without error.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/render/text_ascii.rs` around lines 195 - 203, In load_font, avoid calling
FIGfont::standard().expect(...) on parse failure; instead, if
FIGfont::from_content(source) fails, retry parsing the bundled FONT_STANDARD via
FIGfont::from_content(FONT_STANDARD) and only panic (or propagate a Result) if
that second parse also fails; update the error path in load_font to attempt
FONT_STANDARD before calling expect, referencing load_font,
FIGfont::from_content, and FONT_STANDARD.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/fetcher/github/languages.rs`:
- Around line 69-96: The cache_key() implementation currently only uses
repo_for_key(ctx) and omits the parsed limit, causing different limit values to
share cached payloads; update cache_key() to parse the same Options from
ctx.options (using parse_options or default behavior), derive the effective
limit (same logic as in fetch: opts.limit -> DEFAULT_LIMIT -> .max(1)), and
include that limit value in the extra key passed to cache_key(self.name(), ctx,
&extra) (e.g., append or include "limit={}" in the extra string) so cache
entries differ for different limits; reference functions: cache_key,
repo_for_key, parse_options, and the limit computation used in fetch.

In `@src/fetcher/project.rs`:
- Around line 75-77: The cache key for Project currently only uses
cwd_scoped(self.name()), which causes collisions when Project::fetch produces
different Body variants based on FetchContext.shape; update the cache_key(&self,
_ctx: &FetchContext) -> String implementation to include the ctx.shape (e.g.,
append or incorporate ctx.shape.as_str() or its Debug/string form) so keys are
unique per shape, and make the same change for the other cache_key
implementation mentioned (the second Project cache_key around the 111-120
region) so both Project::cache_key methods include FetchContext.shape when
deriving the key.

In `@src/runtime.rs`:
- Around line 64-78: The cache key generation for multi-shape fetchers needs to
include ctx.shape so different shapes don't collide; update the fetcher
implementations that declare multiple shapes (e.g., static_text,
project/Metadata) to append the current ctx.shape to their cache_key() output
(follow the existing pattern used in read_store, GitHub, and Git fetchers), or
conditionally include ctx.shape inside cache_key() whenever
fetcher.shapes().len() > 1; make sure the cache_key() override reads ctx.shape
and incorporates it deterministically alongside the existing fetcher/options
components.

---

Outside diff comments:
In `@src/render/mod.rs`:
- Around line 114-116: Update the documentation comment for the `align` option
to reflect that `grid_table` now respects `RenderOptions.align` when `layout =
"inline"`; locate the doc string around the `align` description in
src/render/mod.rs and change the sentence that says "structural renderers
(grid_table, gauge_*, chart_*) ignore it" to note that `grid_table` honours
`align` for `layout = "inline"` while other structural renderers still ignore
it, and ensure you mention the accepted values ("left", "center", "right") and
that this applies to `RenderOptions.align`.

---

Nitpick comments:
In `@src/render/gauge_line.rs`:
- Around line 76-84: The gauge over-reserves one cell because reserved is
computed as prefix_width(&prefix) + 1 + suffix.chars().count() as u16 + 1 while
compose_spans already accounts for the prefix separator; change the reserved
calculation in src/render/gauge_line.rs (the reserved binding used to compute
bar_width and filled) to reserved = prefix_width(&prefix) +
suffix.chars().count() as u16 + 1 so the non-bar footprint equals prefix_width +
suffix_chars + 1 and update bar_width/fill computation to use that value.

In `@src/render/list_timeline.rs`:
- Around line 25-32: The default for the "bullet" OptionSchema is currently set
as a raw token and should be quoted to match the other string defaults and
doc-gen expectations; locate OPTION_SCHEMAS and the OptionSchema entry with name
"bullet" and change its default from Some("none") to include inner quotes like
Some("\"none\"") so the generated docs render the default as "none".

In `@src/render/text_ascii.rs`:
- Around line 195-203: In load_font, avoid calling
FIGfont::standard().expect(...) on parse failure; instead, if
FIGfont::from_content(source) fails, retry parsing the bundled FONT_STANDARD via
FIGfont::from_content(FONT_STANDARD) and only panic (or propagate a Result) if
that second parse also fails; update the error path in load_font to attempt
FONT_STANDARD before calling expect, referencing load_font,
FIGfont::from_content, and FONT_STANDARD.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a5f6a34-3379-4971-8dc2-7bf4e79beb73

📥 Commits

Reviewing files that changed from the base of the PR and between b9bd6d0 and 5f09bce.

📒 Files selected for processing (37)
  • .splashboard/dashboard.toml
  • src/config.rs
  • src/fetcher/clock/ratio.rs
  • src/fetcher/github/languages.rs
  • src/fetcher/github/mod.rs
  • src/fetcher/mod.rs
  • src/fetcher/project.rs
  • src/fetcher/read_store.rs
  • src/fetcher/system.rs
  • src/layout.rs
  • src/payload.rs
  • src/render/animated_postfx.rs
  • src/render/animated_typewriter.rs
  • src/render/chart_bar.rs
  • src/render/chart_line.rs
  • src/render/chart_pie.rs
  • src/render/chart_scatter.rs
  • src/render/chart_sparkline.rs
  • src/render/figlet_fonts/NOTICE.md
  • src/render/figlet_fonts/banner.flf
  • src/render/figlet_fonts/big.flf
  • src/render/figlet_fonts/small.flf
  • src/render/figlet_fonts/standard.flf
  • src/render/gauge_circle.rs
  • src/render/gauge_line.rs
  • src/render/grid_calendar.rs
  • src/render/grid_heatmap.rs
  • src/render/grid_table.rs
  • src/render/list_plain.rs
  • src/render/list_timeline.rs
  • src/render/media_image.rs
  • src/render/mod.rs
  • src/render/status_badge.rs
  • src/render/text_ascii.rs
  • src/runtime.rs
  • src/samples.rs
  • src/theme/mod.rs
✅ Files skipped from review due to trivial changes (7)
  • src/fetcher/read_store.rs
  • src/render/figlet_fonts/NOTICE.md
  • src/fetcher/system.rs
  • src/render/figlet_fonts/banner.flf
  • src/render/figlet_fonts/standard.flf
  • src/render/figlet_fonts/big.flf
  • src/render/figlet_fonts/small.flf
🚧 Files skipped from review as they are similar to previous changes (10)
  • src/samples.rs
  • src/theme/mod.rs
  • src/fetcher/github/mod.rs
  • src/render/animated_postfx.rs
  • src/render/list_plain.rs
  • src/config.rs
  • src/render/chart_line.rs
  • src/layout.rs
  • src/render/status_badge.rs
  • src/render/chart_sparkline.rs

Comment thread src/fetcher/github/languages.rs Resolved
Comment thread src/fetcher/project.rs Resolved
Comment thread src/runtime.rs Resolved
unhappychoice and others added 2 commits April 23, 2026 10:12
Binary distribution (cargo install / brew / GH Release tarballs) needs
third-party attribution in the distributable, not just in the source
tree. A README.md under `src/render/figlet_fonts/` is invisible to
anyone downloading a binary. Move the per-font notice block to the
project root where cargo-publish / release archives carry it alongside
the existing LICENSE.

Expanded while I'm at it so each font's exact permission string
(preserved from the `.flf` header) is reproduced — FIGlet convention
keeps the license text inside the font, but those comments never reach
the user of the compiled binary, so the root file becomes the
canonical copy.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…cargo-about

Binary distribution needs attribution for every linked crate, not just
the bundled FIGlet fonts. Set up `cargo about` so the full dependency
license listing regenerates from `Cargo.lock`:

- `about.toml` — allow-list of SPDX licenses we accept for binary
  redistribution. Covers the dependencies currently pulled in
  (`Apache-2.0`, `MIT`, `ISC`, `BSD-*`, `MPL-2.0`, `CDLA-Permissive-
  2.0` for webpki-roots, `NCSA` for libfuzzer-sys, etc.). Any future
  crate outside the list fails the generate step so we notice before
  shipping.
- `about.hbs` — handlebars template rendering markdown with a
  hand-written preamble (splashboard's own license + the FIGlet font
  block) followed by the per-crate license text.
- `THIRDPARTY-LICENSES.md` — regenerated output. Covers both the
  FIGlet fonts and every crate in the current dep graph.

Regenerate with `cargo about generate about.hbs -o THIRDPARTY-LICENSES.md`;
can be wired into the release job later so the shipped artefact is
always current.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(render): layout border-sides + renderer option polish for 0.x presets

1 participant