fix(ui): prevent warning indicator from overflowing container

This commit is contained in:
Carlos Valente
2026-07-18 12:49:33 +02:00
committed by Carlos Valente
parent 64082ceac0
commit 0c5e87b7e7
3 changed files with 22 additions and 6 deletions
@@ -17,7 +17,7 @@ $skip-opacity: 0.2;
'binder pb-actions estatus estatus' 'binder pb-actions estatus estatus'
'binder ... ... ...'; 'binder ... ... ...';
grid-template-columns: $block-binder-width 3rem 1fr 3rem; grid-template-columns: $block-binder-width 3rem minmax(0, 1fr) 3rem;
grid-template-rows: 0.125rem 2rem 2rem auto 0.125rem; grid-template-rows: 0.125rem 2rem 2rem auto 0.125rem;
align-items: center; align-items: center;
padding-right: $block-clearance; padding-right: $block-clearance;
@@ -137,6 +137,7 @@ $skip-opacity: 0.2;
align-items: center; align-items: center;
gap: $block-clearance; gap: $block-clearance;
height: 100%; height: 100%;
min-width: 0;
} }
.eventTimers.editMode:hover { .eventTimers.editMode:hover {
@@ -4,10 +4,15 @@
.timerNote { .timerNote {
width: 1.25em; width: 1.25em;
flex: 0 0 1.25em;
color: $blue-500; color: $blue-500;
font-size: 1.5em; font-size: 1.5em;
} }
.timerNotePlaceholder {
visibility: hidden;
}
.inactive { .inactive {
color: $muted-gray; color: $muted-gray;
} }
@@ -21,6 +21,7 @@ interface TimeInputFlowProps {
linkStart: boolean; linkStart: boolean;
delay: number; delay: number;
showLabels?: boolean; showLabels?: boolean;
showWarnings?: boolean;
} }
export default memo(TimeInputFlow); export default memo(TimeInputFlow);
@@ -33,6 +34,7 @@ function TimeInputFlow({
linkStart, linkStart,
delay, delay,
showLabels, showLabels,
showWarnings = true,
}: TimeInputFlowProps) { }: TimeInputFlowProps) {
const { updateEntry, updateTimer } = useEntryActionsContext(); const { updateEntry, updateTimer } = useEntryActionsContext();
@@ -130,11 +132,19 @@ function TimeInputFlow({
</TimeInputGroup> </TimeInputGroup>
</div> </div>
{warnings.length > 0 && ( {showWarnings &&
<Tooltip text={warnings.join(' - ')} className={style.timerNote} data-testid='event-warning' render={<span />}> (warnings.length > 0 ? (
<IoAlertCircleOutline /> <Tooltip
</Tooltip> text={warnings.join(' - ')}
)} className={style.timerNote}
data-testid='event-warning'
render={<span />}
>
<IoAlertCircleOutline />
</Tooltip>
) : (
<span className={`${style.timerNote} ${style.timerNotePlaceholder}`} aria-hidden='true' />
))}
</> </>
); );
} }