Skip to content

fix(release-diff): swap orientation, fix scroll, rename promote action#556

Merged
LakshanSS merged 1 commit into
openchoreo:mainfrom
kaviththiranga:fix/release-diff-polish
May 16, 2026
Merged

fix(release-diff): swap orientation, fix scroll, rename promote action#556
LakshanSS merged 1 commit into
openchoreo:mainfrom
kaviththiranga:fix/release-diff-polish

Conversation

@kaviththiranga
Copy link
Copy Markdown
Contributor

@kaviththiranga kaviththiranga commented May 16, 2026

Three small fixes to the release-diff experience:

  • Swap LHS/RHS in ComponentReleaseDiffDialog so the target env's current release is the "before" (left) and the upstream's incoming release is the "after" (right). Matches how reviewers actually read promotion diffs. The dialog title arrow still reflects promotion direction. Both callers (drift chip on the env detail panel and the promote action on the overrides page) pick up the new orientation automatically.

  • YamlDiffViewer: move height + overflow:auto onto .cm-mergeView per CodeMirror MergeView docs so both panes scroll as one unit instead of scrolling independently and breaking line alignment.

  • Rename the promote-flow button "View diff" -> "View release diff" to match the wording already used by the drift-chip button.

Before

Screenshot 2026-05-16 at 10 05 30
Screen.Recording.2026-05-16.at.10.05.50.mov

After

Screen.Recording.2026-05-16.at.10.31.45.mov

Summary by CodeRabbit

  • Changes

    • Updated button label in environment promote flow to "View release diff" for clarity.
    • Reoriented YAML diff viewer: target environment's current release now displays on the left, upstream environment's incoming release on the right.
  • Style

    • Improved scrolling behavior in diff viewer for better usability.

Review Change Stack

  Three small fixes to the release-diff experience:

  - Swap LHS/RHS in ComponentReleaseDiffDialog so the target env's current
    release is the "before" (left) and the upstream's incoming release is
    the "after" (right). Matches how reviewers actually read promotion
    diffs. The dialog title arrow still reflects promotion direction. Both
    callers (drift chip on the env detail panel and the promote action on
    the overrides page) pick up the new orientation automatically.

  - YamlDiffViewer: move height + overflow:auto onto .cm-mergeView per
    CodeMirror MergeView docs so both panes scroll as one unit instead of
    scrolling independently and breaking line alignment.

  - Rename the promote-flow button "View diff" -> "View release diff" to
    match the wording already used by the drift-chip button.

Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

The PR reorients the release diff display in the environment promote workflow. Target environment's current release now appears as the original/left side and upstream's incoming release as the modified/right side. Supporting styling adjusts CodeMirror scroll behavior, and the button label clarifies the diff type.

Changes

Release Diff Orientation Refactor

Layer / File(s) Summary
YamlDiffViewer scroll container
plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx
CSS styling adjusted to apply prop-driven height and overflow: auto to the merge view, making the merge view itself the scroll container instead of constraining nested viewers to 100% height.
Release diff orientation logic
plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx
Fetch/state mapping reoriented: target environment's releaseName populates original YAML, upstream's upstreamReleaseName populates modified YAML. Labels and single-sided preview rendering updated to reflect the new left-to-right orientation.
Promote button label update
plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx
Button label changed from "View diff" to "View release diff" for clarity in the promote workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A diff reoriented, left and right,
Target's current meets upstream's light,
The merge view scrolls with grace and ease,
Release labels flow to please! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request description provides clear context for all three fixes with before/after screenshots, but lacks several required template sections like Purpose, Goals, Release notes, and Testing details. Complete the PR description by adding required sections: Purpose (with issue links if applicable), Goals, Release note, and Test environment details to meet template requirements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title concisely and accurately summarizes all three changes: swapping diff orientation, fixing scroll behavior, and renaming the promote button action.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx (1)

12-15: ⚡ Quick win

Update JSDoc comments to reflect the new usage pattern.

The prop documentation describes the "typical" usage before this PR's orientation swap. Now that ComponentReleaseDiffDialog passes the target environment's current release as original and the upstream's incoming release as modified, these comments are backwards. Consider updating them to be more generic or to reflect the new typical usage:

-  /** Original (left) YAML — typically the upstream env's manifest. */
+  /** Original (left) YAML — typically the "before" state. */
   original: string;
-  /** Modified (right) YAML — typically the current env's manifest. */
+  /** Modified (right) YAML — typically the "after" state. */
   modified: string;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx`
around lines 12 - 15, Update the JSDoc on YamlDiffViewer props to reflect the
new orientation: change the comments for the original and modified props (the
properties named original and modified in YamlDiffViewer) to either generic
descriptions like "left-side YAML" and "right-side YAML" or to document the new
typical usage where ComponentReleaseDiffDialog supplies the target environment's
current release as original and the upstream incoming release as modified;
ensure the comment text references YamlDiffViewer.original and
YamlDiffViewer.modified (and optionally mention ComponentReleaseDiffDialog) so
the new behavior is clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx`:
- Around line 12-15: Update the JSDoc on YamlDiffViewer props to reflect the new
orientation: change the comments for the original and modified props (the
properties named original and modified in YamlDiffViewer) to either generic
descriptions like "left-side YAML" and "right-side YAML" or to document the new
typical usage where ComponentReleaseDiffDialog supplies the target environment's
current release as original and the upstream incoming release as modified;
ensure the comment text references YamlDiffViewer.original and
YamlDiffViewer.modified (and optionally mention ComponentReleaseDiffDialog) so
the new behavior is clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3170374-b632-4d01-92c2-46f32daa5746

📥 Commits

Reviewing files that changed from the base of the PR and between 15e3f40 and dc21781.

📒 Files selected for processing (3)
  • plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx
  • plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx
  • plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ronments/components/ComponentReleaseDiffDialog.tsx 0.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@LakshanSS LakshanSS left a comment

Choose a reason for hiding this comment

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

LGTM

@LakshanSS LakshanSS merged commit 6d94027 into openchoreo:main May 16, 2026
7 of 8 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.

2 participants