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
+20 -14
View File
@@ -62,25 +62,31 @@ function SubjectColumn({ subject }: { subject: SubjectData }) {
<div className={styles.barGroup}>
{expectedPct != null && (
<div className={styles.barRow}>
<div
ref={expectedRef}
className={`${styles.bar} ${styles.barExpected}`}
data-width={expectedPct}
/>
<div className={styles.barLabel}>
{expectedPct.toFixed(0)}% <span className={styles.barLabelSuffix}>expected</span>
<div className={styles.barHeader}>
<span className={styles.barLabelSuffix}>Expected</span>
<span className={styles.barLabel}>{expectedPct.toFixed(0)}%</span>
</div>
<div className={styles.barTrack}>
<div
ref={expectedRef}
className={`${styles.bar} ${styles.barExpected}`}
data-width={expectedPct}
/>
</div>
</div>
)}
{exceedingPct != null && (
<div className={styles.barRow}>
<div
ref={exceedingRef}
className={`${styles.bar} ${styles.barExceeding}`}
data-width={exceedingPct}
/>
<div className={styles.barLabel}>
{exceedingPct.toFixed(0)}% <span className={styles.barLabelSuffix}>exceeding</span>
<div className={styles.barHeader}>
<span className={styles.barLabelSuffix}>Exceeding</span>
<span className={styles.barLabel}>{exceedingPct.toFixed(0)}%</span>
</div>
<div className={styles.barTrack}>
<div
ref={exceedingRef}
className={`${styles.bar} ${styles.barExceeding}`}
data-width={exceedingPct}
/>
</div>
</div>
)}