fix(detail): scale SATs cascade bars against full chart width
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 12s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 51s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 12s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 0s

Labels were sharing a flex row with the bar, so the bar's width %
was computed against the flex remainder after the label rather than
the full chart area. A 96% bar rendered around the 75% ruler mark,
and mobile was worse. Move labels to a header row above each bar and
give the bar a full-width track, so X% now aligns with X% on the ruler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tudor Sitaru
2026-04-14 08:40:38 +01:00
parent 3bf2e8f262
commit 24ba65c829
2 changed files with 42 additions and 22 deletions
+22 -8
View File
@@ -75,18 +75,31 @@
z-index: 1; z-index: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.65rem;
padding-top: 0.9rem; padding-top: 0.9rem;
} }
.barRow { .barRow {
display: flex; display: flex;
align-items: center; flex-direction: column;
gap: 0.2rem;
}
.barHeader {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 0.5rem; gap: 0.5rem;
} }
.bar { .barTrack {
width: 100%;
height: 22px; height: 22px;
position: relative;
}
.bar {
height: 100%;
border-radius: 6px; border-radius: 6px;
position: relative; position: relative;
transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
@@ -101,19 +114,20 @@
} }
.barLabel { .barLabel {
font-size: 0.72rem; font-size: 0.75rem;
font-weight: 600; font-weight: 700;
color: var(--text-primary, #1a1612); color: var(--text-primary, #1a1612);
white-space: nowrap; white-space: nowrap;
flex-shrink: 0;
position: relative; position: relative;
z-index: 3; z-index: 3;
} }
.barLabelSuffix { .barLabelSuffix {
font-weight: 400; font-weight: 500;
color: var(--text-muted, #6d685f); color: var(--text-muted, #6d685f);
font-size: 0.68rem; font-size: 0.62rem;
text-transform: uppercase;
letter-spacing: 0.06em;
} }
/* ── Ruler ── */ /* ── Ruler ── */
+20 -14
View File
@@ -62,25 +62,31 @@ function SubjectColumn({ subject }: { subject: SubjectData }) {
<div className={styles.barGroup}> <div className={styles.barGroup}>
{expectedPct != null && ( {expectedPct != null && (
<div className={styles.barRow}> <div className={styles.barRow}>
<div <div className={styles.barHeader}>
ref={expectedRef} <span className={styles.barLabelSuffix}>Expected</span>
className={`${styles.bar} ${styles.barExpected}`} <span className={styles.barLabel}>{expectedPct.toFixed(0)}%</span>
data-width={expectedPct} </div>
/> <div className={styles.barTrack}>
<div className={styles.barLabel}> <div
{expectedPct.toFixed(0)}% <span className={styles.barLabelSuffix}>expected</span> ref={expectedRef}
className={`${styles.bar} ${styles.barExpected}`}
data-width={expectedPct}
/>
</div> </div>
</div> </div>
)} )}
{exceedingPct != null && ( {exceedingPct != null && (
<div className={styles.barRow}> <div className={styles.barRow}>
<div <div className={styles.barHeader}>
ref={exceedingRef} <span className={styles.barLabelSuffix}>Exceeding</span>
className={`${styles.bar} ${styles.barExceeding}`} <span className={styles.barLabel}>{exceedingPct.toFixed(0)}%</span>
data-width={exceedingPct} </div>
/> <div className={styles.barTrack}>
<div className={styles.barLabel}> <div
{exceedingPct.toFixed(0)}% <span className={styles.barLabelSuffix}>exceeding</span> ref={exceedingRef}
className={`${styles.bar} ${styles.barExceeding}`}
data-width={exceedingPct}
/>
</div> </div>
</div> </div>
)} )}