Skip to content

Show multi-diff on /import/preview page#11404

Merged
mekarpeles merged 4 commits intointernetarchive:masterfrom
cdrini:fix/import-preview-diff
Dec 4, 2025
Merged

Show multi-diff on /import/preview page#11404
mekarpeles merged 4 commits intointernetarchive:masterfrom
cdrini:fix/import-preview-diff

Conversation

@cdrini
Copy link
Collaborator

@cdrini cdrini commented Nov 2, 2025

Closes #11405 . Feature. Replace the raw JSON the import preview previously displayed with a diff UI.

Technical

Testing

Screenshot

image

New records show as JSON:
image

Stakeholders

@cdrini cdrini marked this pull request as ready for review November 2, 2025 03:21
Copilot AI review requested due to automatic review settings November 2, 2025 03:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-collapse class 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.

@mekarpeles mekarpeles self-assigned this Nov 3, 2025
@mekarpeles mekarpeles merged commit 3d00de5 into internetarchive:master Dec 4, 2025
5 checks passed
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.

Use diff UI for import preview

2 participants