fix: improve deployment progress UI and prevent duplicate deployment rows
- Redesign DeploymentProgress component: track-based layout with amber brand color, checkmarks for completed steps, user-friendly labels (Prepare, Image, Network, Launch, Verify, Activate, Live) - Delete terminal (STOPPED/FAILED) deployments before creating new ones for the same app+environment, preventing duplicate rows in the UI - Update CLAUDE.md with comprehensive key class locations, correct deploy stages, database migration reference, and REST endpoint summary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,74 +1,104 @@
|
||||
.container {
|
||||
position: relative;
|
||||
padding: 12px 0 4px;
|
||||
}
|
||||
|
||||
/* Background track line spanning full width between first and last dot */
|
||||
.track {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: calc(100% / 14);
|
||||
right: calc(100% / 14);
|
||||
height: 2px;
|
||||
background: var(--border-subtle);
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.trackFill {
|
||||
height: 100%;
|
||||
background: var(--amber);
|
||||
border-radius: 1px;
|
||||
transition: width 0.4s ease;
|
||||
}
|
||||
|
||||
.trackFailed {
|
||||
background: var(--error);
|
||||
}
|
||||
|
||||
/* Steps row — dots + labels positioned over the track */
|
||||
.steps {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
padding: 8px 0;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.step {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
width: calc(100% / 7);
|
||||
}
|
||||
|
||||
/* Dots */
|
||||
.dot {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--border-subtle);
|
||||
background: transparent;
|
||||
background: var(--surface, #1a1a1a);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.dotCompleted {
|
||||
background: var(--success);
|
||||
border-color: var(--success);
|
||||
.dot.completed {
|
||||
background: var(--amber);
|
||||
border-color: var(--amber);
|
||||
color: var(--surface, #1a1a1a);
|
||||
}
|
||||
|
||||
.dotActive {
|
||||
background: var(--accent, #6c7aff);
|
||||
border-color: var(--accent, #6c7aff);
|
||||
animation: pulse 1.5s ease-in-out infinite;
|
||||
.dot.active {
|
||||
border-color: var(--amber);
|
||||
background: var(--amber);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent);
|
||||
animation: pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.dotFailed {
|
||||
.dot.failed {
|
||||
background: var(--error);
|
||||
border-color: var(--error);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 25%, transparent);
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 32px;
|
||||
height: 2px;
|
||||
background: var(--border-subtle);
|
||||
}
|
||||
|
||||
.lineCompleted {
|
||||
background: var(--success);
|
||||
}
|
||||
|
||||
/* Labels */
|
||||
.label {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
margin-top: 4px;
|
||||
margin-top: 6px;
|
||||
line-height: 1;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.labelDone {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.labelActive {
|
||||
color: var(--accent, #6c7aff);
|
||||
color: var(--amber);
|
||||
font-weight: 600;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.labelFailed {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.stepColumn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent); }
|
||||
50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 10%, transparent); }
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import styles from './DeploymentProgress.module.css';
|
||||
|
||||
const STAGES = [
|
||||
{ key: 'PRE_FLIGHT', label: 'Pre-flight' },
|
||||
{ key: 'PULL_IMAGE', label: 'Pull' },
|
||||
{ key: 'PRE_FLIGHT', label: 'Prepare' },
|
||||
{ key: 'PULL_IMAGE', label: 'Image' },
|
||||
{ key: 'CREATE_NETWORK', label: 'Network' },
|
||||
{ key: 'START_REPLICAS', label: 'Start' },
|
||||
{ key: 'HEALTH_CHECK', label: 'Health' },
|
||||
{ key: 'SWAP_TRAFFIC', label: 'Swap' },
|
||||
{ key: 'COMPLETE', label: 'Done' },
|
||||
{ key: 'START_REPLICAS', label: 'Launch' },
|
||||
{ key: 'HEALTH_CHECK', label: 'Verify' },
|
||||
{ key: 'SWAP_TRAFFIC', label: 'Activate' },
|
||||
{ key: 'COMPLETE', label: 'Live' },
|
||||
];
|
||||
|
||||
interface DeploymentProgressProps {
|
||||
@@ -22,25 +22,48 @@ export function DeploymentProgress({ currentStage, failed }: DeploymentProgressP
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
{STAGES.map((stage, i) => {
|
||||
const isCompleted = i < currentIndex;
|
||||
const isActive = i === currentIndex && !failed;
|
||||
const isFailed = i === currentIndex && failed;
|
||||
<div className={styles.track}>
|
||||
<div
|
||||
className={`${styles.trackFill} ${failed ? styles.trackFailed : ''}`}
|
||||
style={{ width: `${(currentIndex / (STAGES.length - 1)) * 100}%` }}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.steps}>
|
||||
{STAGES.map((stage, i) => {
|
||||
const isCompleted = i < currentIndex;
|
||||
const isActive = i === currentIndex && !failed;
|
||||
const isFailed = i === currentIndex && failed;
|
||||
|
||||
return (
|
||||
<div key={stage.key} className={styles.step}>
|
||||
{i > 0 && (
|
||||
<div className={`${styles.line} ${isCompleted || isActive || isFailed ? styles.lineCompleted : ''}`} />
|
||||
)}
|
||||
<div className={styles.stepColumn}>
|
||||
<div className={`${styles.dot} ${isCompleted ? styles.dotCompleted : ''} ${isActive ? styles.dotActive : ''} ${isFailed ? styles.dotFailed : ''}`} />
|
||||
<span className={`${styles.label} ${isActive ? styles.labelActive : ''} ${isFailed ? styles.labelFailed : ''}`}>
|
||||
return (
|
||||
<div key={stage.key} className={styles.step}>
|
||||
<div
|
||||
className={[
|
||||
styles.dot,
|
||||
isCompleted ? styles.completed : '',
|
||||
isActive ? styles.active : '',
|
||||
isFailed ? styles.failed : '',
|
||||
].join(' ')}
|
||||
>
|
||||
{isCompleted && (
|
||||
<svg width="8" height="8" viewBox="0 0 12 12" fill="none">
|
||||
<path d="M2 6l3 3 5-5" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
<span
|
||||
className={[
|
||||
styles.label,
|
||||
isCompleted ? styles.labelDone : '',
|
||||
isActive ? styles.labelActive : '',
|
||||
isFailed ? styles.labelFailed : '',
|
||||
].join(' ')}
|
||||
>
|
||||
{stage.label}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user