Show multi-diff on /import/preview page#11404
Merged
mekarpeles merged 4 commits intointernetarchive:masterfrom Dec 4, 2025
Merged
Show multi-diff on /import/preview page#11404mekarpeles merged 4 commits intointernetarchive:masterfrom
mekarpeles merged 4 commits intointernetarchive:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances the import preview functionality by adding diff visualization capabilities and improves responsive design for diff pages. The changes allow users to preview both new records and changes to existing records during the import process, with better mobile responsiveness.
Key Changes:
- Added diff rendering support in import preview with collapsible raw data view
- Improved responsive table layout with
no-table-collapseclass for diff tables - Made diff template reusable with optional header parameter and path support
- Refactored CSS for diff pages to use flexbox instead of floats
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
openlibrary/templates/import_preview.html |
Added diff visualization for editing existing records and collapsible raw import data view |
openlibrary/templates/diff.html |
Made template reusable with show_header parameter and improved link handling with path parameter |
openlibrary/macros/databarDiff.html |
Added path parameter to support diff rendering outside of current page context |
openlibrary/plugins/upstream/utils.py |
Added create_thing helper function to convert dict data to Thing objects and imported necessary infogami modules |
static/css/components/diff.less |
Removed float-based layout, added overflow handling, and improved responsive design |
static/css/base/common.less |
Made table collapse behavior opt-out with no-table-collapse class for diff tables |
openlibrary/i18n/messages.pot |
Updated translation file with new strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #11405 . Feature. Replace the raw JSON the import preview previously displayed with a diff UI.
Technical
Testing
Screenshot
New records show as JSON:

Stakeholders