mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-06 00:47:52 +00:00
fix(deploy-modal): hide frozen countdown label in inline feedback style (#1534)
In inline deploy feedback style, the auto-close countdown label
("closes in Xs") was visible but permanently frozen. canAutoClose
was already false in inline style (the banner owns the lifecycle),
but showCountdown was driven by !gateHoldsOpen, showing the label
even when no countdown timer could ever start.
Change showCountdown to canAutoClose so the label only appears
when the modal is actually eligible to auto-close (modal style,
succeeded, no observing gate). No gate contracts or modal-style
behavior change.
Adds regression tests: inline succeeded hides the label, modal
succeeded shows it.
This commit is contained in:
@@ -229,7 +229,7 @@ export function DeployFeedbackModal({ isMinimized, onMinimize }: DeployFeedbackM
|
||||
rowCount={logRows.length}
|
||||
errorMessage={errorMessage}
|
||||
countdown={countdown}
|
||||
showCountdown={!gateHoldsOpen}
|
||||
showCountdown={canAutoClose}
|
||||
gateStatus={healthGate?.status ?? null}
|
||||
/>
|
||||
<Button
|
||||
@@ -413,7 +413,7 @@ interface StatusIndicatorProps {
|
||||
rowCount: number;
|
||||
errorMessage?: string;
|
||||
countdown: number;
|
||||
/** False while a health gate is observing or terminal-unhealthy (no auto-close). */
|
||||
/** False when auto-close is not eligible: inline style, or while a gate is observing or terminal-unhealthy. */
|
||||
showCountdown: boolean;
|
||||
/** Active health gate status, or null when no gate was started. */
|
||||
gateStatus: 'observing' | 'passed' | 'failed' | 'unknown' | null;
|
||||
|
||||
@@ -78,6 +78,20 @@ describe('DeployFeedbackModal Inline vs Modal style', () => {
|
||||
expect(onMinimize).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('inline style: succeeded state shows no auto-close countdown label', () => {
|
||||
mockStyle = 'inline';
|
||||
mockPanelState = panel({ status: 'succeeded' });
|
||||
render(<DeployFeedbackModal isMinimized={false} onMinimize={onMinimize} />);
|
||||
expect(screen.queryByText(/closes in/i)).toBeNull();
|
||||
});
|
||||
|
||||
it('modal style: succeeded state shows auto-close countdown label', () => {
|
||||
mockStyle = 'modal';
|
||||
mockPanelState = panel({ status: 'succeeded' });
|
||||
render(<DeployFeedbackModal isMinimized={false} onMinimize={onMinimize} />);
|
||||
expect(screen.getByText(/closes in/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('modal style owns the live terminal; inline style renders no terminal (single socket)', () => {
|
||||
mockStyle = 'modal';
|
||||
const view = render(<DeployFeedbackModal isMinimized={false} onMinimize={onMinimize} />);
|
||||
|
||||
Reference in New Issue
Block a user