Skip to content

Commit c3fabfc

Browse files
chore: temp - tone down drift chip (will be split to separate branch)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
1 parent 879722a commit c3fabfc

8 files changed

Lines changed: 10 additions & 83 deletions

File tree

plugins/openchoreo/src/components/Environments/PipelineDAG/DeployFlowCanvas.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import { useDeployFlowCanvasStyles } from '../styles';
2323
import { MiniEnvironmentNode } from '../components/MiniEnvironmentNode';
2424
import { SetupCard } from '../components/SetupCard';
2525
import type { ActionTrackers, Environment } from '../types';
26-
import type { ReleaseDriftInfo } from '../hooks/computeReleaseDrift';
27-
2826
const SETUP_NODE_ID = '__setup__';
2927

3028
export interface DeployFlowCanvasProps {
@@ -36,8 +34,6 @@ export interface DeployFlowCanvasProps {
3634
refreshingEnvName: (envName: string) => boolean;
3735
isAlreadyPromoted: (sourceEnv: Environment, targetEnvName: string) => boolean;
3836
actionTrackers: ActionTrackers;
39-
/** Per-env drift info, keyed by env name. Missing entries default to no drift. */
40-
driftByEnv?: Map<string, ReleaseDriftInfo>;
4137
/** Per-env active-incident summary, keyed by env name. */
4238
incidentsSummaries?: Map<string, { activeCount: number; loading: boolean }>;
4339
onSelectEnv: (envName: string | null) => void;
@@ -65,7 +61,6 @@ export const DeployFlowCanvas: FC<DeployFlowCanvasProps> = ({
6561
refreshingEnvName,
6662
isAlreadyPromoted,
6763
actionTrackers,
68-
driftByEnv,
6964
incidentsSummaries,
7065
onSelectEnv,
7166
onSelectSetup,
@@ -255,7 +250,6 @@ export const DeployFlowCanvas: FC<DeployFlowCanvasProps> = ({
255250
isRefreshing={refreshingEnvName(env.name)}
256251
isAlreadyPromoted={target => isAlreadyPromoted(env, target)}
257252
actionTrackers={actionTrackers}
258-
driftInfo={driftByEnv?.get(env.name)}
259253
activeIncidentCount={
260254
incidentsSummaries?.get(env.name)?.activeCount
261255
}

plugins/openchoreo/src/components/Environments/PipelineDAG/PipelineCanvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ export const PipelineCanvas: FC = () => {
385385
refreshingEnvName={envName => refreshTracker.isActive(envName)}
386386
isAlreadyPromoted={isAlreadyPromoted}
387387
actionTrackers={actionTrackers}
388-
driftByEnv={driftByEnv}
389388
incidentsSummaries={incidentsSummaries}
390389
onSelectEnv={name =>
391390
setSelection(name ? { kind: 'env', name } : null)

plugins/openchoreo/src/components/Environments/components/EnvironmentDetailPanel.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ describe('EnvironmentDetailPanel', () => {
415415
expect(screen.queryByLabelText('Copy release name')).toBeNull();
416416
});
417417

418-
it('renders a short "Behind upstream" line when driftInfo.isBehind', () => {
418+
it('renders a short "Behind {upstream}" line when driftInfo.isBehind', () => {
419419
renderPanel({
420420
selection: {
421421
kind: 'env',
@@ -430,7 +430,7 @@ describe('EnvironmentDetailPanel', () => {
430430
aheadUpstreams: [{ envName: 'dev', releaseName: 'rel-7' }],
431431
},
432432
});
433-
expect(screen.getByText(/^Behind upstream$/)).toBeInTheDocument();
433+
expect(screen.getByText(/^Behind dev$/)).toBeInTheDocument();
434434
// Full upstream details live on the tooltip, not inline.
435435
expect(screen.queryByText(/rel-7/)).toBeNull();
436436
});

plugins/openchoreo/src/components/Environments/components/EnvironmentDetailPanel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
1919
import RefreshIcon from '@material-ui/icons/Refresh';
2020
import AllInboxOutlinedIcon from '@material-ui/icons/AllInboxOutlined';
2121
import FileCopyOutlinedIcon from '@material-ui/icons/FileCopyOutlined';
22+
import InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';
2223
import ReportProblemOutlinedIcon from '@material-ui/icons/ReportProblemOutlined';
2324
import SettingsOutlinedIcon from '@material-ui/icons/SettingsOutlined';
2425
import { StatusBadge } from '@openchoreo/backstage-design-system';
@@ -300,8 +301,10 @@ export const EnvironmentDetailPanel = ({
300301
}
301302
>
302303
<Box className={classes.driftLabel}>
303-
<ReportProblemOutlinedIcon fontSize="small" />
304-
<Typography variant="caption">Behind upstream</Typography>
304+
<InfoOutlinedIcon fontSize="small" />
305+
<Typography variant="caption">
306+
Behind {driftInfo.aheadUpstreams[0]?.envName}
307+
</Typography>
305308
</Box>
306309
</Tooltip>
307310
{driftInfo.aheadUpstreams[0]?.releaseName &&

plugins/openchoreo/src/components/Environments/components/MiniEnvironmentNode.test.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -319,32 +319,6 @@ describe('MiniEnvironmentNode', () => {
319319
).toBeNull();
320320
});
321321

322-
it('renders the drift badge when driftInfo.isBehind is true', () => {
323-
renderNode({
324-
environment: makeEnv({
325-
name: 'staging',
326-
bindingName: 'staging-binding',
327-
deployment: { status: 'Ready', releaseName: 'rel-5' },
328-
}),
329-
driftInfo: {
330-
isBehind: true,
331-
aheadUpstreams: [{ envName: 'dev', releaseName: 'rel-7' }],
332-
},
333-
});
334-
expect(screen.getByLabelText('behind upstream')).toBeInTheDocument();
335-
});
336-
337-
it('omits the drift badge when not behind', () => {
338-
renderNode({
339-
environment: makeEnv({
340-
name: 'staging',
341-
bindingName: 'staging-binding',
342-
deployment: { status: 'Ready' },
343-
}),
344-
});
345-
expect(screen.queryByLabelText('behind upstream')).toBeNull();
346-
});
347-
348322
it('lists "View release manifest" in the overflow menu when releaseName exists', async () => {
349323
const user = userEvent.setup();
350324
renderNode({

plugins/openchoreo/src/components/Environments/components/MiniEnvironmentNode.tsx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { formatRelativeTime } from '@openchoreo/backstage-plugin-react';
2424
import { useMiniEnvironmentNodeStyles } from '../styles';
2525
import { useEnvironmentStatusVariant } from '../hooks/useEnvironmentStatusVariant';
2626
import { usePromotionAction } from '../hooks/usePromotionAction';
27-
import { NO_DRIFT, type ReleaseDriftInfo } from '../hooks/computeReleaseDrift';
2827
import { deriveVersionLabel } from '../utils/deriveVersionLabel';
2928
import type { ActionTrackers, Environment } from '../types';
3029
import { ReleaseManifestDialog } from './ReleaseManifestDialog';
@@ -35,8 +34,6 @@ export interface MiniEnvironmentNodeProps {
3534
isRefreshing: boolean;
3635
isAlreadyPromoted: (targetEnvName: string) => boolean;
3736
actionTrackers: ActionTrackers;
38-
/** Drift relative to direct upstreams; defaults to no drift. */
39-
driftInfo?: ReleaseDriftInfo;
4037
/**
4138
* Active-incident count from useIncidentsSummary. Undefined when
4239
* observability isn't configured; rendered as a red chip when > 0.
@@ -62,7 +59,6 @@ export const MiniEnvironmentNode = ({
6259
isRefreshing,
6360
isAlreadyPromoted,
6461
actionTrackers,
65-
driftInfo = NO_DRIFT,
6662
activeIncidentCount,
6763
onSelect,
6864
onRefresh,
@@ -274,33 +270,6 @@ export const MiniEnvironmentNode = ({
274270
<span className={classes.versionChip}>{versionLabel}</span>
275271
</Tooltip>
276272
)}
277-
{driftInfo.isBehind && (
278-
<Tooltip
279-
title={
280-
<>
281-
<div>
282-
Behind{' '}
283-
{driftInfo.aheadUpstreams.map(u => u.envName).join(', ')}
284-
</div>
285-
{driftInfo.aheadUpstreams[0]?.releaseName && (
286-
<div>
287-
{driftInfo.aheadUpstreams[0].envName} on{' '}
288-
{driftInfo.aheadUpstreams[0].releaseName}
289-
</div>
290-
)}
291-
</>
292-
}
293-
PopperProps={{ disablePortal: true }}
294-
>
295-
<span
296-
className={classes.driftBadge}
297-
aria-label="behind upstream"
298-
>
299-
<ReportProblemOutlinedIcon fontSize="inherit" />
300-
behind
301-
</span>
302-
</Tooltip>
303-
)}
304273
</Box>
305274

306275
{/* Row 2 — supplementary: incidents + freshness. Skipped

plugins/openchoreo/src/components/Environments/components/SetupDetailPane.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const LatestReleaseRow = ({
6161

6262
return (
6363
<Box display="flex" flexDirection="column" gridGap={4}>
64-
<Typography variant="subtitle2">Latest release</Typography>
64+
<Typography variant="subtitle2">Latest Release</Typography>
6565
{releasesLoading && !latest && (
6666
<Typography variant="body2" color="textSecondary">
6767
Loading…
@@ -268,7 +268,7 @@ export const SetupDetailPane = ({
268268
/* Auto-deploy ON: configure component + read-only latest release */
269269
<>
270270
<Box display="flex" flexDirection="column" gridGap={8}>
271-
<Typography variant="subtitle2">Component</Typography>
271+
<Typography variant="subtitle2">Release</Typography>
272272
<Typography variant="caption" color="textSecondary">
273273
Auto-deploy is on. Saving any configuration change creates a
274274
release automatically and rolls it out to{' '}

plugins/openchoreo/src/components/Environments/styles.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,6 @@ export const useMiniEnvironmentNodeStyles = makeStyles(theme => ({
260260
padding: theme.spacing(0.25, 0.75),
261261
whiteSpace: 'nowrap',
262262
},
263-
driftBadge: {
264-
display: 'inline-flex',
265-
alignItems: 'center',
266-
gap: 2,
267-
fontSize: '0.7rem',
268-
fontWeight: 500,
269-
color: theme.palette.warning.dark,
270-
backgroundColor: alpha(theme.palette.warning.main, 0.16),
271-
borderRadius: 4,
272-
padding: theme.spacing(0.1, 0.5),
273-
whiteSpace: 'nowrap',
274-
},
275263
metaChip: {
276264
display: 'inline-flex',
277265
alignItems: 'center',
@@ -530,7 +518,7 @@ export const useEnvironmentDetailPanelStyles = makeStyles(theme => ({
530518
display: 'flex',
531519
alignItems: 'center',
532520
gap: theme.spacing(0.5),
533-
color: theme.palette.warning.dark,
521+
color: theme.palette.info.dark,
534522
flex: 1,
535523
minWidth: 0,
536524
},

0 commit comments

Comments
 (0)