feat(dashboard): wire reading-pace forecasts into a Time to finish section (EXP-04)#46
Merged
Merged
Conversation
…ction (EXP-04) app.forecast shipped as a pure, tested module but nothing rendered it. Build a per-book BookForecast for every currently-reading title (remaining pages from the reading stat; no stat -> honest Forecast.unknown()), thread a forecasts field through DashboardView, and render an accessible 'Time to finish' table mirroring the existing sections: a range never a single number, the window basis disclosed, and unestimable books shown as such rather than guessed. BookForecast lives in app.view and is imported into app.render under TYPE_CHECKING (annotations are already lazy) so no import cycle is introduced. Tests: an estimable book renders an hours range with its basis and passes the a11y structural check; a book with no page stat renders the honest 'not enough recent reading to estimate' text. Signed-off-by: ChelseaKR <3114598+ChelseaKR@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
app.forecastshipped as a pure, tested module (EXP-04) but nothing rendered it — the feature was invisible to users. This wires it into the dashboard:build_viewcomputes a per-bookBookForecastfor every currently-reading title, and the renderer shows an accessible "Time to finish" section.total_pages − pages_read); a book with no stat yields the module's honestForecast.unknown()rather than a guess.<table>mirroring the existing sections: a range, never a single number, with the window basis disclosed ("from your last N reading days"), and unestimable books shown as such ("not enough recent reading to estimate"). No color-only meaning.BookForecastlives inapp.view;app.renderimports it underTYPE_CHECKING(annotations are already lazy viafrom __future__ import annotations), so no import cycle is introduced.Definition of Done
check_html); a book with no page stat renders the honest "not enough recent reading to estimate" text; the demo render includes the "Time to finish" heading.CHANGELOG.md(Unreleased → Added) and the EXP-04 note indocs/ideation/03-expansions.md(dashboard wiring now done).Verification note (please confirm on CI): this repo targets Python 3.14, which this build sandbox can't provide (interpreter downloads are blocked here), so I could not run the full
make verifyagainst 3.14 locally. What I did verify: the full suite (389 tests, including the two new forecast tests) passes when run on Python 3.12 with a temporary 3.12-compat shim that I did not commit — the shipped diff contains only the EXP-04 changes; andruff check+ruff format --checkare clean under the repo'starget-version = "py314"config on the changed files. The 3.14mypy/pytestgate runs in CI; I'll watch it and fix any fallout.If this touches a workflow or a dependency
N/A — no workflow,
uses:, or dependency change;uv.lockuntouched.Generated by Claude Code