diff --git a/plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx b/plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx index 82d103ea9..e70aedca8 100644 --- a/plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx +++ b/plugins/openchoreo-react/src/components/YamlDiffViewer/YamlDiffViewer.tsx @@ -48,17 +48,22 @@ const useStyles = makeStyles(theme => ({ whiteSpace: 'nowrap', }, container: ({ height, isDark }) => ({ - height, fontSize: '0.75rem', border: `1px solid ${theme.palette.divider}`, borderRadius: theme.shape.borderRadius, overflow: 'hidden', backgroundColor: isDark ? '#1e1e1e' : '#fafafa', - '& .cm-mergeView, & .cm-mergeViewEditors': { - height: '100%', + // Per CodeMirror's MergeView docs: views are not scrollable by default — + // the .cm-mergeView itself must have a height and `overflow: auto` to + // become the scroller. Both panes are children of .cm-mergeView, so they + // scroll together as one unit. CM's baseTheme forces inner .cm-scroller + // to height:auto + overflow:visible when nested in a .cm-mergeView, so + // we don't override those. + '& .cm-mergeView': { + height, + overflow: 'auto', }, '& .cm-editor': { - height: '100%', backgroundColor: 'transparent', }, '& .cm-scroller': { diff --git a/plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx b/plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx index 0733e5a8f..f750fea6c 100644 --- a/plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx +++ b/plugins/openchoreo/src/components/Environments/EnvironmentOverridesPage.tsx @@ -708,7 +708,7 @@ export const EnvironmentOverridesPage = ({ disabled={saving || deleting} style={{ marginRight: 8 }} > - View diff + View release diff diff --git a/plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx b/plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx index f21122047..a648c34ac 100644 --- a/plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx +++ b/plugins/openchoreo/src/components/Environments/components/ComponentReleaseDiffDialog.tsx @@ -74,25 +74,29 @@ export const ComponentReleaseDiffDialog = ({ setOriginal(null); setModified(null); + // Diff orientation: LHS shows the target env's *current* release ("before"), + // RHS shows the upstream env's incoming release ("after"). The dialog title's + // `upstreamEnv → targetEnv` arrow still reflects promotion direction, not + // LHS → RHS. const fetches: Array> = []; - if (upstreamReleaseName) { + if (releaseName) { fetches.push( - api.fetchComponentRelease(entity, upstreamReleaseName).then(res => { + api.fetchComponentRelease(entity, releaseName).then(res => { if (cancelled) return; if (!res?.success || !res.data) { - setError(`Couldn't fetch ${upstreamEnvName}'s release manifest.`); + setError(`Couldn't fetch ${environmentName}'s release manifest.`); return; } setOriginal(YAML.stringify(res.data)); }), ); } - if (releaseName) { + if (upstreamReleaseName) { fetches.push( - api.fetchComponentRelease(entity, releaseName).then(res => { + api.fetchComponentRelease(entity, upstreamReleaseName).then(res => { if (cancelled) return; if (!res?.success || !res.data) { - setError(`Couldn't fetch ${environmentName}'s release manifest.`); + setError(`Couldn't fetch ${upstreamEnvName}'s release manifest.`); return; } setModified(YAML.stringify(res.data)); @@ -146,28 +150,28 @@ export const ComponentReleaseDiffDialog = ({ )} - {previewMode === 'source-only' && original && ( + {previewMode === 'source-only' && modified && ( <> {environmentName} has no release yet — this is the manifest that will be created from{' '} {upstreamEnvName}. - + )} - {previewMode === 'target-only' && modified && ( + {previewMode === 'target-only' && original && ( <> {upstreamEnvName} has no release to compare; showing {environmentName}'s current manifest. - + )}