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: the queue chip says 'Up next' in sentence case, as Plan does

Duarte Santoseae59189f78e
diff --git a/frontend/src/components/QueueRow.jsx b/frontend/src/components/QueueRow.jsx
index d2f7184f4..bfd07a473 100644
--- a/frontend/src/components/QueueRow.jsx
+++ b/frontend/src/components/QueueRow.jsx
@@ -36,12 +36,14 @@ export default function QueueRow({ S, today, onStart, managed }) {
{/* Your own loop speaks in rounds, as Plan does; a coach's week keeps its plain count. */}
<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). */}
{/* 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">{i.state === 'pinned' ? fmtDate(i.on, true) : word[i.state]}</span>
+ {i.state === 'done' && <Icon name="check" />}{i.name}<span className="dim 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/index.css b/frontend/src/index.css
index 14cb7c6db..1f7cab562 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -572,6 +572,7 @@ h4.sec{
.chip:active{background:var(--surface-2)}
.chip.on{background:var(--acc);color:var(--on-acc);font-weight:500}
.chip.on .dim{color:color-mix(in srgb,var(--on-acc) 62%,transparent)}
+.chip .qstate{text-transform:none}
/* On a phone these rows scroll by swipe. On a pointer device lib/hchips.js lets you
click-drag anywhere on the row to pull it along; a grab cursor on rows that actually
overflow (data-xscroll, set by hchips.js on hover) is the hint. */
diff --git a/frontend/src/views/Home.queue.test.jsx b/frontend/src/views/Home.queue.test.jsx
index 198e23051..8d74647c0 100644
--- a/frontend/src/views/Home.queue.test.jsx
+++ b/frontend/src/views/Home.queue.test.jsx
@@ -70,6 +70,15 @@ describe('Home — coach week progress row', () => {
expect(todayTitle()).toBe('US W1 D1')
})
+ it('keeps "Up next" in sentence case, as Plan says it, though .chip capitalizes names', async () => {
+ setS()
+ mount()
+ expect(chips()[0].querySelector('.qstate').textContent).toBe('Up next')
+ const { readFileSync } = await import('node:fs')
+ const css = readFileSync(`${process.cwd()}/src/index.css`, 'utf8')
+ expect(css).toMatch(/\.chip \.qstate\{text-transform:none\}/)
+ })
+
it('a finished workout on a routine marks its chip done and moves the light on', () => {
setS({ workouts: [logged('d1')] })
mount()