Skip to content

Comments

feat(changelog): add changelog widget version comparison#614

Open
vivekv1504 wants to merge 9 commits intowebex:nextfrom
vivekv1504:changelog-widget
Open

feat(changelog): add changelog widget version comparison#614
vivekv1504 wants to merge 9 commits intowebex:nextfrom
vivekv1504:changelog-widget

Conversation

@vivekv1504
Copy link

@vivekv1504 vivekv1504 commented Feb 6, 2026

COMPLETES #https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-770576

This pull request addresses

ADD VERSION COMAPRISON MODE FUNCTIONALITY IN WIDGETS

by making the following changes

Version Comparison Mode
Compare all packages between two stable versions
Package-level comparison with pre-release version support
Visual status indicators (Unchanged, Changed, Added, Removed)
Statistics dashboard (total packages, changed count, etc.)
Copy comparison link for sharing

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
    < ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - cursor
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • [] I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-614.d1b38q61t1z947.amplifyapp.com

@rarajes2 rarajes2 added the validated Indicates that the PR is ready for actions label Feb 17, 2026
@vivekv1504 vivekv1504 changed the title feat(changelog):add changelog widget version comaprison feat(changelog): add changelog widget version comparison Feb 17, 2026
Copy link
Contributor

@rarajes2 rarajes2 left a comment

Choose a reason for hiding this comment

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

Let's move all the business logic to a separate file comparison-view.js and import the methods in this file and use it. We can keep all the UI related methods in this file.

</li>
<li>
<a href="?compareStableA=1.28.0&compareStableB=1.28.2&comparePackage=@webex/widgets&compareVersionA=1.28.2-next.2&compareVersionB=1.28.2-next.3"
>Package-level comparison - @webex/widgets specific versions</a
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: please align the angular brackets

Copy link
Author

Choose a reason for hiding this comment

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

Done


/* Comparison Results Table */
#comparison-results .table-wrapper {
max-height: 500px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use rem where recommended

Copy link
Author

Choose a reason for hiding this comment

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

pixel units changed to rem units where it placed in px units

Comment on lines 25 to 56
Handlebars.registerHelper('forIn', function (object) {
let returnArray = [];
for (let prop in object) {
returnArray.push({key: prop, value: object[prop]});
}
return returnArray;
Handlebars.registerHelper("forIn", function(object) {
let returnArray = [];
for(let prop in object){
returnArray.push({key: prop, value: object[prop]});
}
return returnArray;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's revert all these formatting changes, it will reduce the diff. Applicable everywhere

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Still see some formatting changes, please do revert them and run the eslint.

Comment on lines 107 to 108
if (searchParams.package) {
if (!packageNameInputDropdown.disabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These can be clubbed

Copy link
Author

Choose a reason for hiding this comment

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

these two conditiones set into one line

versionPaths[version] = path;
optionsHtml += `<option value="${version}">${version}</option>`;
const populatePackageNames = (changelog) => {
let specialPackages = ['@webex/widgets', '@webex/cc-widgets'];
Copy link
Contributor

Choose a reason for hiding this comment

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

What are special packages ? Why they need to be treated differently from other packages ?

Copy link
Author

Choose a reason for hiding this comment

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

this is in single search comparison that is written by old as format in sdk comparison and that special pacakges are shows separately while populated the pacages names ,that pacakages are popular or everywhere presented in stable. versions

Comment on lines 1417 to 1418
console.log('effectiveVersionA:', effectiveVersionA, '(requested:', versionASpecific, ')');
console.log('effectiveVersionB:', effectiveVersionB, '(requested:', versionBSpecific, ')');
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove all console logs

Copy link
Author

Choose a reason for hiding this comment

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

done

Comment on lines +1609 to +1613
if (comparisonPackageSelect) comparisonPackageSelect.value = '';
if (versionAPrereleaseSelect) versionAPrereleaseSelect.value = '';
if (versionBPrereleaseSelect) versionBPrereleaseSelect.value = '';
if (comparisonPackageRow) comparisonPackageRow.style.display = 'none';
if (prereleaseRow) prereleaseRow.style.display = 'none';
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to have the conditions ? We can reset the values irrespective of the conditions, right ?

Copy link
Author

Choose a reason for hiding this comment

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

conditions is better because it prevents from error where value doesn't exits .
can you sugget which one is better
another way is comparisonPackageSelect.value = '';

Comment on lines +1754 to +1759
if (searchForm) searchForm.classList.remove('hide');
if (comparisonForm) comparisonForm.classList.add('hide');
if (comparisonResults) comparisonResults.classList.add('hide');
if (searchResults) searchResults.classList.remove('hide');
if (helperSection) helperSection.classList.remove('hide');
if (comparisonHelper) comparisonHelper.classList.add('hide');
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, see if we actually need the if conditions ?

Check this logic everywhere in this file


const stableA = versionASelect.value;
const stableB = versionBSelect.value;
const selectedPackage = comparisonPackageSelect ? comparisonPackageSelect.value : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

const selectedPackage = comparisonPackageSelect?.value;

We can keep the logic like this and utilize the undefined value

Copy link
Author

Choose a reason for hiding this comment

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

Done Rajesh both are same (undefined and null 's are falsy statements ) ,changes to this
const selectedPackage = comparisonPackageSelect?.value;

Comment on lines 1872 to 1873
if (versionAPrereleaseSelect) versionAPrereleaseSelect.addEventListener('change', updateCompareButtonState);
if (versionBPrereleaseSelect) versionBPrereleaseSelect.addEventListener('change', updateCompareButtonState);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any logic to remove the event listeners when we switch to another mode? We should not be adding multiple listeners as we toggle through the single and comparison views.

Applicable everywhere

Copy link
Author

Choose a reason for hiding this comment

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

there is no remove event listeners .there is only hide elements are there in single and version comparison
And there is no duplicate listeners

@rarajes2
Copy link
Contributor

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

Copy link
Author

@vivekv1504 vivekv1504 left a comment

Choose a reason for hiding this comment

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

Rajesh almost done ,but most the comments realated to single version search ,that code previously implemented by kesava and shreyas

</li>
<li>
<a href="?compareStableA=1.28.0&compareStableB=1.28.2&comparePackage=@webex/widgets&compareVersionA=1.28.2-next.2&compareVersionB=1.28.2-next.3"
>Package-level comparison - @webex/widgets specific versions</a
Copy link
Author

Choose a reason for hiding this comment

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

Done


/* Comparison Results Table */
#comparison-results .table-wrapper {
max-height: 500px;
Copy link
Author

Choose a reason for hiding this comment

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

pixel units changed to rem units where it placed in px units

// If the package name is not empty, show all options
// If one of the commit search options is not empty, hide version input and show commit search options
// If the version field is not empty, hide the commit search options
if(formParams === undefined){
Copy link
Author

Choose a reason for hiding this comment

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

changes and add space after the keyword where is placed keywords after not space

Comment on lines 25 to 56
Handlebars.registerHelper('forIn', function (object) {
let returnArray = [];
for (let prop in object) {
returnArray.push({key: prop, value: object[prop]});
}
return returnArray;
Handlebars.registerHelper("forIn", function(object) {
let returnArray = [];
for(let prop in object){
returnArray.push({key: prop, value: object[prop]});
}
return returnArray;
Copy link
Author

Choose a reason for hiding this comment

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

done

disable.commitHash = true;
disable.searchButton = false;
}
else if((formParams.commitMessage && formParams.commitMessage.trim() !== '') || (formParams.commitHash && formParams.commitHash.trim() !== '')){
Copy link
Author

Choose a reason for hiding this comment

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

this is old code ,i am not changed logic just i changed the format

Image

Comment on lines +1609 to +1613
if (comparisonPackageSelect) comparisonPackageSelect.value = '';
if (versionAPrereleaseSelect) versionAPrereleaseSelect.value = '';
if (versionBPrereleaseSelect) versionBPrereleaseSelect.value = '';
if (comparisonPackageRow) comparisonPackageRow.style.display = 'none';
if (prereleaseRow) prereleaseRow.style.display = 'none';
Copy link
Author

Choose a reason for hiding this comment

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

conditions is better because it prevents from error where value doesn't exits .
can you sugget which one is better
another way is comparisonPackageSelect.value = '';

Comment on lines 1872 to 1873
if (versionAPrereleaseSelect) versionAPrereleaseSelect.addEventListener('change', updateCompareButtonState);
if (versionBPrereleaseSelect) versionBPrereleaseSelect.addEventListener('change', updateCompareButtonState);
Copy link
Author

Choose a reason for hiding this comment

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

there is no remove event listeners .there is only hide elements are there in single and version comparison
And there is no duplicate listeners


const stableA = versionASelect.value;
const stableB = versionBSelect.value;
const selectedPackage = comparisonPackageSelect ? comparisonPackageSelect.value : null;
Copy link
Author

Choose a reason for hiding this comment

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

Done Rajesh both are same (undefined and null 's are falsy statements ) ,changes to this
const selectedPackage = comparisonPackageSelect?.value;

}
const doSearch = (searchParams) => {
const { package, version } = searchParams;
let drill_down = {...currentChangelog}, shouldTransform = true, search_results = [];
Copy link
Author

Choose a reason for hiding this comment

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

the drill_down is stored chnagelog data ,stores the pacakages data

@rarajes2
Copy link
Contributor

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@bhabalan
Copy link
Contributor

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 742a432432

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

allHashes = new Set();
discontinueSearch = true;
searchResults.push({
pacakage,

Choose a reason for hiding this comment

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

P1 Badge Return package key in commit search results

The objects emitted by doSearch_commit use pacakage instead of package, but the changelog template and generated links read this.package. In commit-message/hash searches (shouldTransform = false), this causes package names to render empty and breaks package-specific links/actions in results, so a primary search mode returns malformed output.

Useful? React with 👍 / 👎.

Comment on lines +351 to +352
const pkgDataA = changelogA[packageName]?.[versionASpecific];
const pkgDataB = changelogB[packageName]?.[versionBSpecific];

Choose a reason for hiding this comment

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

P1 Badge Recompute package data after fallback version resolution

generatePackageComparisonData reads pkgDataA/pkgDataB from the requested versions before resolving fallback versions with getEffectiveVersion. If one requested version is missing (for example, package has only prerelease tags and one prerelease selector is left empty), the effective version exists but pkgData* stays null, so downstream status/alongWith logic marks the package as Added/Removed incorrectly and loses related-package context.

Useful? React with 👍 / 👎.

Copy link
Author

Choose a reason for hiding this comment

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

implemented the changes and just replace the lines

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b84364bc9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

</div>
</script>

<script type="module" src="assets/js/app.js"></script>

Choose a reason for hiding this comment

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

P1 Badge Restore global copy handlers after switching to module script

Loading app.js as type="module" makes top-level functions module-scoped, but the page still uses inline handlers (onclick='copyToClipboard(this)' and onclick="copyComparisonLink()") that resolve names on window. In this mode, those handlers throw ReferenceError at click time, so the changelog row copy action no longer works and copy interactions become error-prone unless separately rebound.

Useful? React with 👍 / 👎.

Copy link
Author

Choose a reason for hiding this comment

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

yes after clicking copy button in both single version and version comparison search it throws the reference error and on more issue is after click copyComparisonlink in version comparison search it throws refernce error but link is copied and data is also reloaded ,why it's because in copy button is placed in form div and not mentioned type property default is type= "submit "

Done implement the changes

Comment on lines +276 to +277
const versionA = findEarliestVersion(changelogA, packageName);
const versionB = findEarliestVersion(changelogB, packageName);

Choose a reason for hiding this comment

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

P1 Badge Compare release versions instead of earliest package entries

The full comparison path currently picks each package version with findEarliestVersion(...), i.e. the oldest publish date in each changelog. For packages that have multiple builds in a stable train (pre-releases plus stable), this compares stale versions and can mislabel rows and aggregate counts (Version Changed/Unchanged/Added/Removed). The nearby findStableVersion helper is never used, so the main comparison can report incorrect results.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants