style(row): move RWM score next to name, enlarge buttons, show label on mobile
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 32s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m3s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

Group school name and score together on the left using a nameScore flex
container, so the percentage sits close to the name rather than pushed to the
far right. Action buttons get slightly more padding on desktop (0.4375rem v
0.3125rem). On mobile the scoreLabel is now visible inline instead of hidden,
so the percentage reads as R,W&M not a bare number.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 22:44:39 +00:00
parent 6ddfcadbde
commit 65e3d8460d
2 changed files with 54 additions and 34 deletions

View File

@@ -38,16 +38,23 @@
gap: 0.3rem; gap: 0.3rem;
} }
/* Line 1 */ /* Line 1: name+score on the left, actions pinned right */
.rowTop { .rowTop {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1rem;
}
/* Name + score grouped together on the left */
.nameScore {
display: flex;
align-items: baseline;
gap: 0.75rem; gap: 0.75rem;
flex: 1;
min-width: 0;
} }
.schoolName { .schoolName {
flex: 1;
min-width: 0;
font-size: 0.9375rem; font-size: 0.9375rem;
font-weight: 600; font-weight: 600;
color: var(--text-primary, #1a1612); color: var(--text-primary, #1a1612);
@@ -55,21 +62,21 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
min-width: 0;
flex-shrink: 1;
} }
.schoolName:hover { .schoolName:hover {
color: var(--accent-coral, #e07256); color: var(--accent-coral, #e07256);
} }
/* Score block: number + trend + label stacked */ /* Score block: value + label inline */
.scoreBlock { .scoreBlock {
display: flex; display: flex;
flex-direction: column; align-items: baseline;
align-items: flex-end; gap: 0.3rem;
flex-shrink: 0; flex-shrink: 0;
gap: 0; white-space: nowrap;
min-width: 60px;
text-align: right;
} }
.scoreValue { .scoreValue {
@@ -80,7 +87,7 @@
line-height: 1.2; line-height: 1.2;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.25rem; gap: 0.2rem;
} }
.scoreNA { .scoreNA {
@@ -89,7 +96,7 @@
} }
.scoreLabel { .scoreLabel {
font-size: 0.6875rem; font-size: 0.75rem;
color: var(--text-muted, #8a847a); color: var(--text-muted, #8a847a);
white-space: nowrap; white-space: nowrap;
} }
@@ -113,21 +120,21 @@
color: var(--text-muted, #8a847a); color: var(--text-muted, #8a847a);
} }
/* Action buttons */ /* Action buttons — pinned right, slightly larger on desktop */
.rowActions { .rowActions {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.375rem; gap: 0.5rem;
flex-shrink: 0; flex-shrink: 0;
} }
.btnView { .btnView {
padding: 0.3125rem 0.625rem; padding: 0.4375rem 0.875rem;
font-size: 0.8125rem; font-size: 0.875rem;
font-weight: 500; font-weight: 500;
color: var(--text-secondary, #5c564d); color: var(--text-secondary, #5c564d);
border: 1px solid var(--border-color, #e5dfd5); border: 1px solid var(--border-color, #e5dfd5);
border-radius: 5px; border-radius: 6px;
text-decoration: none; text-decoration: none;
transition: all 0.15s ease; transition: all 0.15s ease;
white-space: nowrap; white-space: nowrap;
@@ -140,13 +147,13 @@
} }
.btnCompare { .btnCompare {
padding: 0.3125rem 0.625rem; padding: 0.4375rem 0.875rem;
font-size: 0.8125rem; font-size: 0.875rem;
font-weight: 600; font-weight: 600;
color: white; color: white;
background: var(--accent-coral, #e07256); background: var(--accent-coral, #e07256);
border: none; border: none;
border-radius: 5px; border-radius: 6px;
cursor: pointer; cursor: pointer;
transition: background 0.15s ease; transition: background 0.15s ease;
white-space: nowrap; white-space: nowrap;
@@ -157,13 +164,13 @@
} }
.btnRemove { .btnRemove {
padding: 0.3125rem 0.625rem; padding: 0.4375rem 0.875rem;
font-size: 0.8125rem; font-size: 0.875rem;
font-weight: 500; font-weight: 500;
color: var(--text-secondary, #5c564d); color: var(--text-secondary, #5c564d);
background: var(--bg-secondary, #f3ede4); background: var(--bg-secondary, #f3ede4);
border: 1px solid var(--border-color, #e5dfd5); border: 1px solid var(--border-color, #e5dfd5);
border-radius: 5px; border-radius: 6px;
cursor: pointer; cursor: pointer;
transition: all 0.15s ease; transition: all 0.15s ease;
white-space: nowrap; white-space: nowrap;
@@ -237,25 +244,36 @@
gap: 0.5rem; gap: 0.5rem;
} }
.schoolName { /* School name takes full width, score+actions wrap below */
.nameScore {
flex-basis: 100%; flex-basis: 100%;
white-space: normal; min-width: 0;
font-size: 0.9375rem;
} }
.schoolName {
white-space: normal;
}
/* Score block stays inline with label visible */
.scoreBlock { .scoreBlock {
flex-direction: row; align-items: baseline;
align-items: center;
gap: 0.375rem;
flex-basis: auto;
} }
.scoreLabel { .scoreLabel {
display: none; font-size: 0.7rem;
} }
/* Actions move to end of the wrapped row */
.rowActions { .rowActions {
margin-left: auto; margin-left: auto;
gap: 0.375rem;
}
.btnView,
.btnCompare,
.btnRemove {
padding: 0.375rem 0.75rem;
font-size: 0.8125rem;
} }
.rowProgress { .rowProgress {

View File

@@ -41,8 +41,9 @@ export function SchoolRow({
return ( return (
<div className={`${styles.row} ${isInCompare ? styles.rowInCompare : ''}`}> <div className={`${styles.row} ${isInCompare ? styles.rowInCompare : ''}`}>
<div className={styles.rowMain}> <div className={styles.rowMain}>
{/* Line 1: Name + score + actions */} {/* Line 1: Name + score on left, actions pinned right */}
<div className={styles.rowTop}> <div className={styles.rowTop}>
<div className={styles.nameScore}>
<a href={`/school/${school.urn}`} className={styles.schoolName}> <a href={`/school/${school.urn}`} className={styles.schoolName}>
{school.school_name} {school.school_name}
</a> </a>
@@ -81,6 +82,7 @@ export function SchoolRow({
)} )}
<span className={styles.scoreLabel}>R, W &amp; M</span> <span className={styles.scoreLabel}>R, W &amp; M</span>
</div> </div>
</div>
<div className={styles.rowActions}> <div className={styles.rowActions}>
<a href={`/school/${school.urn}`} className={styles.btnView}> <a href={`/school/${school.urn}`} className={styles.btnView}>