You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[[widget]]
id = "commits"fetcher = "git_commits_activity"render = "chart_sparkline"
renders nothing (blank). The ci_history sparkline rendered fine.
Root cause
ratatui::widgets::Sparkline::render_sparkline (0.29.0, sparkline.rs:350) takes the first min(area.width, data.len()) points from the head:
let max_index = min(spark_area.widthasusize,self.data.len());for(i, item)inself.data.iter().take(max_index).enumerate(){
Meanwhile git_commits_activity returns a NumberSeries of 364 points (52 weeks × 7 days) ordered oldest → newest.
→ In a 58-col widget, "the oldest 58 days from the head" get drawn. In this repo, commits are clustered in the last 3 days, leaving the other 361 at zero, so the first 58 days are all zero → blank.
Confirmed via isolation tests (debug_boundary / debug_dogfood_sparse; results shown are pre-fix):
Tail-slice in src/render/chart_sparkline.rs::render_sparkline before handing data to ratatui:
let start = data.values.len().saturating_sub(area.widthasusize);let visible = &data.values[start..];
frame.render_widget(Sparkline::default().data(visible), area);
The sparkline's semantics are "trend of the most recent N points", so tail-priority is the right answer. When data.len() <= area.width, behavior is unchanged (all data drawn).
Added the regression test tail_window_is_rendered_when_data_exceeds_width.
Activity