fix: stack exercise progress selector value

This commit is contained in:
Manuel committed 2026-08-25 17:47:52 +00:00
1 parent 7d2460c2c2
commit bcbde6245c
4 files changed
+22 -3

No files matched your search

+1 -1
View File
@@ -401,7 +401,7 @@ export default function Stats() {
<h2>{t('Exercise progress')}</h2>
{exHist.length ? <>
<div className="sect-b" style={{ marginBottom: 10 }}>
<SelectRow title={t('Exercise')} sheetTitle={t('Exercise progress')} value={curEx} onChange={setExId}
<SelectRow title={t('Exercise')} sheetTitle={t('Exercise progress')} value={curEx} onChange={setExId} stackedValue
options={exHist.map(id => ({ value: id, label: nameOf(id) + (exCurrent[id].mx ? ' ' + '—' + ' ' + fmtNum(exCurrent[id].mx) + ' ' + exCurrent[id].unit : '') }))} />
</div>
{exOpts.length > 1 && <Segmented className="seg-range" value={onEff ? 'effort' : onE1 ? 'e1rm' : 'top'} onChange={setExMetric} options={exOpts} />}
+11
View File
@@ -3,6 +3,8 @@ import { readFileSync } from 'node:fs'
import { bestWeightForEntry, metricModeForEntry, metricRowsForEntry } from '../lib/history.js'
const source = readFileSync(new URL('./Stats.jsx', import.meta.url), 'utf8')
const uiSource = readFileSync(new URL('../components/ui.jsx', import.meta.url), 'utf8')
const cssSource = readFileSync(new URL('../index.css', import.meta.url), 'utf8')
describe('Stats mixed-entry metric contract', () => {
it('selects authoritative reps rows before timed rows without stale topW', () => {
@@ -27,4 +29,13 @@ describe('Stats mixed-entry metric contract', () => {
expect(source).not.toContain('const loggedMode = entryMode(en)')
expect(source).not.toContain('(en.topW || 0)')
})
it('stacks the Stats exercise selector value without changing shared SelectRow defaults', () => {
expect(source).toContain("onChange={setExId} stackedValue")
expect(uiSource).toContain('sheetTitle, stackedValue = false')
expect(uiSource).toContain("className={stackedValue ? 'lrow-stack-value' : ''}")
expect(cssSource).toContain('.lrow.lrow-stack-value .lrow-m{grid-column:1;grid-row:1}')
expect(cssSource).toContain('.lrow.lrow-stack-value .lrow-v{grid-column:1;grid-row:2;text-align:left}')
expect(cssSource).toContain('overflow:hidden;text-overflow:ellipsis;white-space:nowrap')
})
})