Skip to content

feat(reference): add description() to Fetcher and Renderer traits - #161

Merged
unhappychoice merged 1 commit into
mainfrom
feat/fetcher-renderer-descriptions
Apr 26, 2026
Merged

unhappychoice merged 1 commit into
mainfrom
feat/fetcher-renderer-descriptions

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Generated reference pages (/reference/fetchers/*, /reference/renderers/*) previously only restated the metadata that was already visible in the matrix — name, shape, safety. A reader couldn't tell what clock_almanac actually shows, or how gauge_circle and gauge_segment differ, without opening the source.
  • Adds a required description() -> &'static str to Fetcher, RealtimeFetcher, and Renderer. Every registered impl gets a 1–2 sentence summary that explains what it does and, where siblings exist, what makes it distinct. Required (no default) so a future fetcher / renderer landing without a description breaks the build instead of silently shipping a metadata-only page.
  • xtask gen-matrix now opens each per-entry page with the description and adds a Description column to the matrix overview tables.

Test plan

  • cargo test --workspace — 856 pass
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo xtask — regenerates every reference page and matrix.md without errors
  • Skim a sample of generated pages locally to confirm prose reads naturally and matches the actual behavior

🤖 Generated with Claude Code

Summary by CodeRabbit

New Features

  • Added descriptive documentation to all data sources (fetchers) and display formats (renderers) — Each fetcher and renderer now includes a human-readable description explaining its purpose, behavior, output format, and when to use it alongside related alternatives.

  • Updated generated documentation — Documentation tables now display descriptions for quick reference and comparison between options.

Generated reference pages previously only restated metadata (name, shape,
safety) — readers couldn't tell what each fetcher actually showed or how
two siblings (`clock_almanac` vs `clock_derived`, `gauge_circle` vs
`gauge_segment`) differed without opening the source.

Add a required `description() -> &'static str` to `Fetcher`,
`RealtimeFetcher`, and `Renderer`, populate it for every registered
implementation, and surface the prose in `xtask gen-matrix` output:

- per-fetcher / per-renderer page now opens with the description
- matrix.md tables get a Description column

Required (no default) so adding a new fetcher / renderer without a
description breaks the build.

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

coderabbitai Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR systematically adds a description() method to the Fetcher, RealtimeFetcher, and Renderer traits, along with implementations across 70+ fetchers and renderers. Each implementation returns a static string describing the component's purpose and behavior. The trait signatures and documentation generation tool are updated accordingly.

Changes

Cohort / File(s) Summary
Trait Definitions
src/fetcher/mod.rs, src/render/mod.rs
Added description() as required method to Fetcher, RealtimeFetcher, and Renderer traits; RegisteredFetcher::description() helper added.
Calendar Fetcher
src/fetcher/calendar/holidays.rs
Implements description() describing data source (date.nager.at), ISO 3166-1 alpha-2 country code format, and Shape rendering modes.
Clock Fetchers
src/fetcher/clock/mod.rs, src/fetcher/clock/almanac.rs, src/fetcher/clock/countdown.rs, src/fetcher/clock/derived.rs, src/fetcher/clock/ratio.rs, src/fetcher/clock/state.rs, src/fetcher/clock/sunrise.rs, src/fetcher/clock/timezones.rs
Eight clock-related fetchers each add description() implementations covering current time display, countdown semantics, sunrise/sunset calculations, and world-clock strips.
Code Fetcher
src/fetcher/code.rs
Implements description() detailing TODO-parsing behavior, output formats (Text, TextBlock, Entries, Bars), and trailing-colon markers.
Git Fetchers
src/fetcher/git/blame_heatmap.rs, src/fetcher/git/commits_activity.rs, src/fetcher/git/contributors.rs, src/fetcher/git/latest_tag.rs, src/fetcher/git/recent_commits.rs, src/fetcher/git/repo_name.rs, src/fetcher/git/stash_count.rs, src/fetcher/git/status.rs, src/fetcher/git/worktrees.rs
Nine git fetchers add description() covering heatmap visualization, activity tracking, contributor rankings, tag/commit history, and worktree listing.
GitHub Fetchers
src/fetcher/github/action_history.rs, src/fetcher/github/action_status.rs, src/fetcher/github/assigned_issues.rs, src/fetcher/github/avatar.rs, src/fetcher/github/contributions.rs, src/fetcher/github/contributors_monthly.rs, src/fetcher/github/good_first_issues.rs, src/fetcher/github/languages.rs, src/fetcher/github/my_prs.rs, src/fetcher/github/notifications.rs, src/fetcher/github/recent_releases.rs, src/fetcher/github/repo.rs, src/fetcher/github/repo_issues.rs, src/fetcher/github/repo_prs.rs, src/fetcher/github/repo_stars.rs, src/fetcher/github/review_requests.rs, src/fetcher/github/user.rs
Seventeen GitHub fetchers add description() covering CI workflows, issue/PR tracking, user metadata, contribution graphs, and repository metadata.
Hacker News Fetchers
src/fetcher/hackernews/top.rs, src/fetcher/hackernews/user.rs, src/fetcher/hackernews/user_comments.rs, src/fetcher/hackernews/user_submissions.rs
Four HN fetchers add description() covering top stories, user profiles, and submission/comment listings.
Other Fetchers
src/fetcher/random_fortune/mod.rs, src/fetcher/random_quote/mod.rs, src/fetcher/read_store.rs, src/fetcher/reddit/subreddit_posts.rs, src/fetcher/reddit/user_comments.rs, src/fetcher/reddit/user_posts.rs, src/fetcher/rss.rs, src/fetcher/static_text.rs, src/fetcher/system.rs, src/fetcher/todoist.rs, src/fetcher/weather.rs, src/fetcher/wikipedia/featured.rs, src/fetcher/wikipedia/on_this_day.rs, src/fetcher/wikipedia/random.rs
Fourteen remaining fetchers (random fortunes/quotes, RSS, Reddit, static text, system metrics, Todoist, weather, Wikipedia) add description() implementations.
Animated Renderers
src/render/animated_boot.rs, src/render/animated_figlet_morph.rs, src/render/animated_postfx.rs, src/render/animated_scanlines.rs, src/render/animated_splitflap.rs, src/render/animated_typewriter.rs, src/render/animated_wave.rs
Seven animated renderers add description() covering boot animations, font morphing, post-effects, scanlines, split-flap displays, typewriter, and wave effects.
Chart Renderers
src/render/chart_bar.rs, src/render/chart_histogram.rs, src/render/chart_line.rs, src/render/chart_pie.rs, src/render/chart_scatter.rs, src/render/chart_sparkline.rs
Six chart renderers add description() covering bar, histogram, line, pie, scatter, and sparkline visualizations.
Gauge Renderers
src/render/gauge_battery.rs, src/render/gauge_circle.rs, src/render/gauge_line.rs, src/render/gauge_segment.rs, src/render/gauge_thermometer.rs
Five gauge renderers add description() covering battery status, circle/line/segment/thermometer gauges.
Grid/List Renderers
src/render/grid_calendar.rs, src/render/grid_heatmap.rs, src/render/grid_table.rs, src/render/list_links.rs, src/render/list_plain.rs, src/render/list_ranking.rs, src/render/list_timeline.rs
Seven grid and list renderers add description() covering calendar, heatmaps, tables, links, rankings, and timelines.
Media/Text Renderers
src/render/media_image.rs, src/render/status_badge.rs, src/render/text_ascii.rs, src/render/text_markdown.rs, src/render/text_plain.rs
Five renderers add description() for image embedding, status badges, and text rendering (ASCII, Markdown, plain).
Test Fixtures & Documentation
src/runtime.rs, src/trust.rs, xtask/src/gen_matrix.rs
Test mocks implement description() returning "test fixture"; doc generation updated to use fetcher/renderer description() methods and populate Description column in registry tables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Descriptions abound, for each fetch and each render,
A thousand bright strings help the docs not be tender,
From clocks that tick softly to heatmaps that glow,
We've labeled them all—now the user's sure to know! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 change: adding description() methods to both Fetcher and Renderer traits, which is the core objective of this comprehensive PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fetcher-renderer-descriptions

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.

@unhappychoice
unhappychoice merged commit 65163c6 into main Apr 26, 2026
5 checks passed
@unhappychoice
unhappychoice deleted the feat/fetcher-renderer-descriptions branch April 26, 2026 13:00
@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 296 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.76%. Comparing base (673a223) to head (87a7f22).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/system.rs 0.00% 24 Missing ⚠️
src/fetcher/mod.rs 0.00% 11 Missing ⚠️
src/runtime.rs 0.00% 6 Missing ⚠️
src/trust.rs 0.00% 6 Missing ⚠️
src/fetcher/calendar/holidays.rs 0.00% 3 Missing ⚠️
src/fetcher/clock/almanac.rs 0.00% 3 Missing ⚠️
src/fetcher/clock/countdown.rs 0.00% 3 Missing ⚠️
src/fetcher/clock/derived.rs 0.00% 3 Missing ⚠️
src/fetcher/clock/mod.rs 0.00% 3 Missing ⚠️
src/fetcher/clock/ratio.rs 0.00% 3 Missing ⚠️
... and 77 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
- Coverage   78.78%   77.76%   -1.02%     
==========================================
  Files         122      122              
  Lines       22749    23045     +296     
==========================================
  Hits        17922    17922              
- Misses       4827     5123     +296     
Files with missing lines Coverage Δ
src/render/mod.rs 90.59% <ø> (ø)
src/fetcher/calendar/holidays.rs 82.84% <0.00%> (-0.82%) ⬇️
src/fetcher/clock/almanac.rs 86.23% <0.00%> (-2.45%) ⬇️
src/fetcher/clock/countdown.rs 77.23% <0.00%> (-1.94%) ⬇️
src/fetcher/clock/derived.rs 84.50% <0.00%> (-1.21%) ⬇️
src/fetcher/clock/mod.rs 88.88% <0.00%> (-1.78%) ⬇️
src/fetcher/clock/ratio.rs 62.75% <0.00%> (-1.33%) ⬇️
src/fetcher/clock/state.rs 84.93% <0.00%> (-3.64%) ⬇️
src/fetcher/clock/sunrise.rs 88.00% <0.00%> (-1.80%) ⬇️
src/fetcher/clock/timezones.rs 85.43% <0.00%> (-2.57%) ⬇️
... and 78 more
🚀 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.

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.

1 participant