Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Home: a pinned queue chip's date keeps the chip's capitals again; only the state words keep their sentence case

Duarte Santos7eaa09221959
diff --git a/frontend/src/components/QueueRow.jsx b/frontend/src/components/QueueRow.jsx
index bfd07a473..05f8f0b15 100644
--- a/frontend/src/components/QueueRow.jsx
+++ b/frontend/src/components/QueueRow.jsx
@@ -37,13 +37,14 @@ export default function QueueRow({ S, today, onStart, managed }) {
<div className="small muted">{managed ? t('{0} of {1} done this round.', v.items.length - v.remaining.length, v.items.length) : `${v.items.length - v.remaining.length} / ${v.items.length}`}</div>
</div>
{/* The state word keeps its sentence case ("Up next", as on Plan): .chip capitalizes every
- word for the routine names, which made it "Up Next" here (QA 10-06). */}
+ word for the routine names, which made it "Up Next" here (QA 10-06). A pinned chip's date
+ keeps .chip's capitals, so it reads "Seg., 12 out." and not "seg." in Portuguese. */}
{/* three chips do not fit one phone row and .chips hides its scrollbar — wrap instead */}
<div className="chips" style={{ flexWrap: 'wrap' }}>
{v.items.map((i, n) => <button key={n} className={'chip' + (i.state === 'next' ? ' on' : '')}
disabled={i.state === 'done'} onClick={() => onStart(i.id)}
style={{ display: 'inline-flex', alignItems: 'center', gap: 5, opacity: i.state === 'done' ? 0.55 : undefined }}>
- {i.state === 'done' && <Icon name="check" />}{i.name}<span className="dim qstate">{i.state === 'pinned' ? fmtDate(i.on, true) : word[i.state]}</span>
+ {i.state === 'done' && <Icon name="check" />}{i.name}<span className={'dim' + (i.state === 'pinned' ? '' : ' qstate')}>{i.state === 'pinned' ? fmtDate(i.on, true) : word[i.state]}</span>
</button>)}
</div>
<div className="small muted queue-status" style={{ marginTop: 8 }}>{status}</div>
diff --git a/frontend/src/views/Home.queue.test.jsx b/frontend/src/views/Home.queue.test.jsx
index 8d74647c0..420d21c61 100644
--- a/frontend/src/views/Home.queue.test.jsx
+++ b/frontend/src/views/Home.queue.test.jsx
@@ -245,6 +245,9 @@ describe('Home — a session pinned to a day', () => {
mount()
expect(chipTexts()).toEqual(['US W1 D1' + fmtDate(on, true), 'US W1 D2Up next', 'US W1 D3Later'])
expect(chips()[0].className).toBe('chip')
+ // the date keeps .chip's capitals ("Seg." in Portuguese); only the state words opt out
+ expect(chips()[0].querySelector('.qstate')).toBeNull()
+ expect(chips()[1].querySelector('.qstate').textContent).toBe('Up next')
expect(chips()[0].disabled).toBe(false)
expect(chips()[1].className).toBe('chip on')
expect(status()).toBe('Next: US W1 D2, today')