Simplify history comments#11469
Conversation
closes internetarchive#1381 * No longer re-writes comments based on other fields * No longer makes arbitrary comment differences for logged in vs. guest viewers
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the history comment display logic by removing complex conditional rendering based on machine comments and source records, and consolidating the comment rendering into a consistent template-based approach.
- Removes the special handling for imported/matched MARC records and source information
- Unifies comment display logic to consistently use the
recentchangestemplate system - Makes the comment display consistent for both logged-in users and guests by removing viewer-specific logic
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
openlibrary/templates/recentchanges/default/comment.html |
Adds fallback message "Edited without comment." when no comment exists |
openlibrary/templates/history/comment.html |
Simplifies template by removing machine_comment/source_html logic and delegating all comment rendering to recentchanges templates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
this message adds nothing and only appears for non-logged in users
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
This looks like an improvement to make the display be less misleading.
Ideally, the appropriate source_record for each edit could be listed in the associated comment so that librarians could jump directly to it when attempting to trace provenance, but I'm not sure if the context for the entire edit history is available here.
|
@cdrini "Imported from" is useful if displayed with the correct date. Indicating that a source record from 2025 was imported in 2008 is not useful. |
|
@cdrini @seabelis If having source records emphasised in the initial comment is important, the import bots or import API should add it so it appears as the comment in all contexts (UI, API, datadumps &c). The previous 'imported from' message only seems to be added correctly for a subset of historical imports that made use of an old The feature I added a while back to display all source records on the UI has helped somewhat, which is probably why the misleading auto-generated comments have been tolerated for so many years since this issue was raised. Design principles:
If there is a feature missing that would help users, let's clarify it and add it directly. I suspect having import comments more useful than 'added new book' would be a start? |
|
I've lost track of what is requires for this issue. @hornc can you please let me know where we are and if action is required from me? |
|
@mekarpeles, I am 60% of the way through populating correct source records on the 10M records that are missing any source information. That's the remediation on on records that will be badly affected if this PR is merged. We could still merge this now to simplify the comments, as the remediation is actively in progress. I think merging this will be an improvement. |


closes #1381
kind = "default". Other templates potentially still replace the user supplied comment)kind = "default", other kind templates still rewrite comments. No idea why this this helpful? The different content depending on logged is status has already hindered investigation on the original issue.)Closes #
Technical
Testing
Screenshot
Stakeholders