Added 'Works by Decade Published' chart to reading log stats#12822
Merged
cdrini merged 9 commits intoJun 3, 2026
Conversation
for more information, see https://pre-commit.ci
Member
|
Thanks for the contribution! 🤖 Copilot has been assigned for an initial review. @cdrini is assigned to this PR and currently has:
PR triage checklist (maintainers / Pam)
Note This comment was automatically generated by Pam, Open Library's Project AI Manager, on behalf of @mekarpeles. Pam is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Works by Decade Published” chart to reading log stats, using existing work publication-year data and the existing chart rendering flow.
Changes:
- Adds a
decade-chartbranch that derives decade labels fromfirst_publish_year. - Adds the new decade chart to the Work Stats section.
- Extends work typing metadata for publication year/decade data.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
openlibrary/plugins/openlibrary/js/readinglog_stats.js |
Computes decade buckets and renders them through the existing work chart path. |
openlibrary/templates/account/readinglog_stats.html |
Adds the new chart configuration to the Work Stats charts list. |
…library into add-reading-stats-by-decade
cdrini
requested changes
Jun 1, 2026
cdrini
reviewed
Jun 1, 2026
for more information, see https://pre-commit.ci
Contributor
Author
@cdrini Looking good?
|
cdrini
approved these changes
Jun 3, 2026
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.



Closes #12805
Technical
Adds a "Works by Decade Published" chart to the reading log stats page. A new
decade-charttype is introduced inreadinglog_stats.jsthat preprocesses each work'sfirst_publish_yearinto a decade string (e.g. 1987 → 1980s) before passing it to the existingcreateWorkChartfunction. Works with nofirst_publish_yearare handled gracefully via the existing excluded works behaviour. A corresponding chart entry is added to the Work Stats section inreadinglog_stats.html.Testing
https://openlibrary.org/people/{username}/books/already-read/statsScreenshot
Stakeholders
@cdrini