feat: compare library component versions#2986
feat: compare library component versions#2986navinkarkera wants to merge 13 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @navinkarkera! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
8c565ac to
08c958f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2986 +/- ##
========================================
Coverage 95.52% 95.52%
========================================
Files 1392 1393 +1
Lines 32911 32967 +56
Branches 7340 7592 +252
========================================
+ Hits 31437 31491 +54
+ Misses 1419 1408 -11
- Partials 55 68 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @navinkarkera! |
| oldVersion={changeModalData.oldVersion} | ||
| newVersion={changeModalData.newVersion || 'published'} |
There was a problem hiding this comment.
I don't have these fields in my objects.
{
"contributor": {
"username": "edx",
"profileImageUrls": {
"full": "http://studio.local.openedx.io:8001/static/studio/images/profiles/default_500.png",
"large": "http://studio.local.openedx.io:8001/static/studio/images/profiles/default_120.png",
"medium": "http://studio.local.openedx.io:8001/static/studio/images/profiles/default_50.png",
"small": "http://studio.local.openedx.io:8001/static/studio/images/profiles/default_30.png"
}
},
"changedAt": "2026-04-29T20:57:07Z",
"title": "Text",
"itemType": "html",
"action": "edited"
}I'm using master from edx-platform since openedx/openedx-platform#38178 was merged.
Include the option to view a previous change state from history entries.
2b98b15 to
b9e08f8
Compare
rpenido
left a comment
There was a problem hiding this comment.
LGTM 👍
Thank you for your work, @navinkarkera!
- I tested this using the instructions from the PR
- I read through the code
- I checked for accessibility issues
- Includes documentation
ChrisChV
left a comment
There was a problem hiding this comment.
@navinkarkera Looks good. 👍 I commented on a nit.
| } | ||
|
|
||
| export interface HistoryDraftLogGroupProps { | ||
| itemId: string; |
There was a problem hiding this comment.
Per OEP-68, it is necessary to rename this to itemKey

Description
Add entry-level version preview from history log for library components.
Users can now open Show this version from history entries and view old/new versions in side-by-side comparison modal.
Container entries (section/subsection/unit, including legacy chapter/sequential/vertical) are explicitly excluded from component diff modal actions.
Screenshots:
Useful information to include:
Change summary generated by AI
1) History log actions + compare modal
More actions) inHistoryLogGroupfor non-container items.Show this versionaction per history entry.HistoryCompareChangesModalcomponent:Preview changes: {title}CompareChangesWidgetin side-by-side modeDonebutton closes modalitemIdthrough draft/publish groups and log pages so each entry knows entity key.2) Container detection utilities
isContainerType(containerType)insrc/generic/key-utils.ts.isContainerUsageKey(usageKey)insrc/generic/key-utils.ts.3) Compare widget enhancements
CompareChangesWidgetnow supports:sideBySidemodeshowTitleCard+Stackand renders two previews at once.4) LibraryBlock preview behavior
addHeight?: numberprop toLibraryBlock.iframeHeight + addHeight.version === 0, component returnsnull(prevents invalid preview render).5) Data model updates
LibraryHistoryEntrywith:oldVersion?: numbernewVersion?: number6) i18n messages
Added new history-log messages:
previewChangesTitlemoreActionsshowThisVersiondoneButtonPrivate-ref: https://tasks.opencraft.com/browse/FAL-4332Testing instructions
Preview changes: <component title>and correct icon.Other information
Include anything else that will help reviewers and consumers understand the change.
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use.../in import paths. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'