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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
RTL: logical CSS/JSX, dir/lang, slider, centering left physical
yazid389bc2d44120
diff --git a/frontend/index.html b/frontend/index.htmlindex 12f563d5c..2ca215f40 100644--- a/frontend/index.html+++ b/frontend/index.html@@ -3,6 +3,16 @@<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,user-scalable=no">+<script>+ // Set direction before first paint so an Arabic profile never flashes as LTR.+ // The app re-applies this on every language change (lib/i18n.js setLang).+ try {+ var s = JSON.parse(localStorage.getItem('gym_state_v1') || '{}');+ var l = s.lang || 'en';+ document.documentElement.lang = l;+ document.documentElement.dir = l === 'ar' ? 'rtl' : 'ltr';+ } catch (e) {}+</script><title>openGym</title><meta name="description" content="Personal gym & body weight tracker"><meta name="theme-color" content="#0c0e12">diff --git a/frontend/src/components/Heatmap.jsx b/frontend/src/components/Heatmap.jsxindex 8ecc29aa2..ecfafa24c 100644--- a/frontend/src/components/Heatmap.jsx+++ b/frontend/src/components/Heatmap.jsx@@ -52,7 +52,7 @@ export default function Heatmap({ S, onDay }) {return <><div className="hm-wrap" ref={wrapRef}>- <div className="hm-months" style={{ marginLeft: 30 }}>{months}</div>+ <div className="hm-months" style={{ marginInlineStart: 30 }}>{months}</div><div className="hm-body"><div className="hm-days">{dayLabels.map((lbl, i) => <span key={i}>{lbl ? t(lbl) : ''}</span>)}</div><div className="hm-grid">{cols}</div>diff --git a/frontend/src/components/Icon.jsx b/frontend/src/components/Icon.jsxindex 065eb2429..7069be36a 100644--- a/frontend/src/components/Icon.jsx+++ b/frontend/src/components/Icon.jsx@@ -142,6 +142,7 @@ export default function Icon({ name, size, className = '', style, ...rest }) {return (<svgclassName={'icn ' + className}+ data-icon={name}viewBox="0 0 24 24"aria-hidden="true"focusable="false"diff --git a/frontend/src/components/MuscleExplorer.jsx b/frontend/src/components/MuscleExplorer.jsxindex 43b653150..68bf045ad 100644--- a/frontend/src/components/MuscleExplorer.jsx+++ b/frontend/src/components/MuscleExplorer.jsx@@ -46,7 +46,7 @@ export default function MuscleExplorer({ onPick, onDetail, onPlan }) {{profile && <div className="small dim row" style={{ margin: '-4px 2px 10px', gap: 6, alignItems: 'center' }}><Icon name="dumbbell" style={{ fontSize: 13 }} />{showAll ? t('Showing all equipment') : t('Showing what you have in "{0}"', profile.name)}- <button className="chip nocap" style={{ marginLeft: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => { setShowAll(v => !v); setEq(''); setShown(40) }}>+ <button className="chip nocap" style={{ marginInlineStart: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => { setShowAll(v => !v); setEq(''); setShown(40) }}>{showAll ? t('Filter by "{0}"', profile.name) : t('Show all equipment')}</button></div>}diff --git a/frontend/src/components/ui.jsx b/frontend/src/components/ui.jsxindex 6299e4b06..6c5864c95 100644--- a/frontend/src/components/ui.jsx+++ b/frontend/src/components/ui.jsx@@ -195,7 +195,10 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNamconst el = ref.currentif (!el) return valueconst r = el.getBoundingClientRect()- const f = Math.min(1, Math.max(0, (clientX - r.left) / r.width))+ // The fraction is read from the physical left edge, then mirrored in RTL where the+ // minimum sits at the inline-start (right) end of the track.+ let f = Math.min(1, Math.max(0, (clientX - r.left) / r.width))+ if (document.documentElement.dir === 'rtl') f = 1 - fconst raw = min + f * (max - min)const snapped = Math.round(raw / step) * step// step can be fractional (0.1) — round away binary noise@@ -220,8 +223,11 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNam}, [drag, onChange, posToValue])const key = e => {- const d = e.key === 'ArrowRight' || e.key === 'ArrowUp' ? step- : e.key === 'ArrowLeft' || e.key === 'ArrowDown' ? -step : 0+ // The arrow pointing at the inline-end (max) end still increases; in RTL that is Left.+ const inc = document.documentElement.dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight'+ const dec = document.documentElement.dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft'+ const d = e.key === inc || e.key === 'ArrowUp' ? step+ : e.key === dec || e.key === 'ArrowDown' ? -step : 0if (!d) returne.preventDefault()onChange(Math.min(max, Math.max(min, Math.round((value + d) * 1000) / 1000)))@@ -239,7 +245,10 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNamonPointerDown={e => {e.currentTarget.setPointerCapture?.(e.pointerId)const r = e.currentTarget.getBoundingClientRect()- const knobX = r.left + (pct / 100) * r.width+ // The knob is measured from inline-start: left in LTR, right in RTL.+ const knobX = document.documentElement.dir === 'rtl'+ ? r.right - (pct / 100) * r.width+ : r.left + (pct / 100) * r.widthconst d = e.clientX - knobXoffset.current = Math.abs(d) <= SLIDER_GRAB_PX ? d : 0setDrag(true)@@ -247,7 +256,7 @@ export function Slider({ value, min = 0, max = 100, step = 1, onChange, classNam}}><span className="sld-track"><span className="sld-fill" style={{ width: pct + '%' }} /></span>- <span className="sld-knob" style={{ left: pct + '%' }} />+ <span className="sld-knob" style={{ insetInlineStart: pct + '%' }} /></div>)}diff --git a/frontend/src/components/ui.test.jsx b/frontend/src/components/ui.test.jsxindex 80db7fc1b..e52f62d1f 100644--- a/frontend/src/components/ui.test.jsx+++ b/frontend/src/components/ui.test.jsx@@ -58,6 +58,60 @@ describe('Slider', () => {})})+describe('Slider under dir=rtl', () => {+ // The Slider scales from inline-start: min sits on the left in LTR and on the right in+ // RTL. These cases pin the RTL behaviour — the pointer math, the grab point and the+ // arrow keys — the parts that would silently break if the direction handling were+ // dropped.+ beforeEach(() => {+ document.documentElement.dir = 'rtl'+ })+ afterEach(() => {+ document.documentElement.dir = 'ltr'+ })++ const mountSlider = (value, onChange) => {+ act(() => root.render(<Slider value={value} min={0} max={300} step={1} onChange={onChange} />))+ const el = host.querySelector('.sld')+ vi.spyOn(el, 'getBoundingClientRect').mockReturnValue({ left: 100, right: 400, width: 300, top: 0, bottom: 20, height: 20, x: 100, y: 0 })+ return el+ }++ it('reads the pointer from the physical right: the left end is near max, the right end near min', () => {+ const onChange = vi.fn()+ const el = mountSlider(80, onChange)+ pointer(el, 'pointerdown', { x: 110 }) // f = .033 → mirrored .967 → 290+ expect(onChange).toHaveBeenLastCalledWith(290)+ pointer(el, 'pointerdown', { x: 390 }) // f = .967 → mirrored .033 → 10+ expect(onChange).toHaveBeenLastCalledWith(10)+ })++ it('grabs the knob from the right end and drags relative to the finger', () => {+ const onChange = vi.fn()+ const el = mountSlider(80, onChange) // RTL knob sits at x=400-80=320+ pointer(el, 'pointerdown', { x: 320 + SLIDER_GRAB_PX - 2 })+ expect(onChange).not.toHaveBeenCalled() // grabbing must not jump+ pointer(window, 'pointermove', { x: 320 + SLIDER_GRAB_PX - 2 + 60 })+ expect(onChange).toHaveBeenLastCalledWith(20) // moved toward min by 60, not to the finger+ pointer(window, 'pointerup')+ })++ it('swaps the horizontal arrows in RTL and keeps the vertical arrows as they are', () => {+ const onChange = vi.fn()+ const el = mountSlider(50, onChange)+ // The arrow toward the inline-end (max) still increases — that is Left in RTL.+ const key = k => act(() => el.dispatchEvent(new KeyboardEvent('keydown', { key: k, bubbles: true })))+ key('ArrowLeft')+ expect(onChange).toHaveBeenLastCalledWith(51)+ key('ArrowRight')+ expect(onChange).toHaveBeenLastCalledWith(49)+ key('ArrowUp')+ expect(onChange).toHaveBeenLastCalledWith(51)+ key('ArrowDown')+ expect(onChange).toHaveBeenLastCalledWith(49)+ })+})+describe('Stepper', () => {// controlled like every real caller: the parent re-renders with the new valuefunction Host({ initial, onChange, step }) {diff --git a/frontend/src/index.css b/frontend/src/index.cssindex da086b7ac..ccffa4117 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -174,7 +174,7 @@ body.resting #app{padding-bottom:calc(206px + var(--sab))}/* sync banner: one line for a signed-in user whose changes are not on the server yet */.sync-banner{- display:flex;align-items:center;gap:9px;width:100%;text-align:left;+ display:flex;align-items:center;gap:9px;width:100%;text-align: start;margin:0 0 12px;padding:9px 12px;border-radius:var(--r);background:color-mix(in srgb,var(--yellow) 16%,var(--surface));color:var(--label);font-size:13px;line-height:1.35;}@@ -232,7 +232,7 @@ h4.sec{German the title and the two buttons ("Ziel", "+ Eintragen") outgrow a 320px card by about55px, so the button pair may drop to a second line — still flush right, hence the auto margin. */.bw-head{flex-wrap:wrap;row-gap:8px}-.bw-head>.row{margin-left:auto}+.bw-head>.row{margin-inline-start:auto}/* ----------------------------------------------------------------- card -- */.card{@@ -251,15 +251,15 @@ h4.sec{.sect-f{font-size:13px;color:var(--label-2);padding:7px 4px 0;line-height:1.38}.lrow{- display:flex;align-items:center;gap:12px;width:100%;text-align:left;+ display:flex;align-items:center;gap:12px;width:100%;text-align: start;padding:11px 14px;min-height:46px;position:relative;color:var(--label);background:none;}/* hairline starts after the icon rail so the list reads as one object */.lrow+.lrow::before{- content:'';position:absolute;left:14px;right:0;top:0;height:var(--hair);background:var(--sep);+ content:'';position:absolute;inset-inline-start:14px;inset-inline-end:0;top:0;height:var(--hair);background:var(--sep);}-.lrow:has(.lrow-i)+.lrow:has(.lrow-i)::before{left:55px}+.lrow:has(.lrow-i)+.lrow:has(.lrow-i)::before{inset-inline-start:55px}.lrow.tap:active{background:var(--surface-2)}.lrow-i{width:29px;height:29px;border-radius:7px;flex:none;font-size:18px;@@ -286,7 +286,7 @@ h4.sec{to 21px. A basis of 45% fixes that but reserves the space even for "3", costing the title141px on the rows that need it most. A cap does neither. */.lrow-v{color:var(--label-2);font-size:17px;letter-spacing:-.012em;flex:0 1 auto;max-width:55%;min-width:0;- overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}+ overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align: end}.lrow-c{color:var(--label);font-size:15px;flex:none;--icon-stroke:2.4}.lrow-k{color:var(--acc);font-size:17px;flex:none;--icon-stroke:2.4}.lrow.danger,.lrow.danger .lrow-t{color:var(--red)}@@ -299,7 +299,7 @@ h4.sec{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;}.lrow.lrow-stack-value .lrow-m{grid-column:1;grid-row:1}-.lrow.lrow-stack-value .lrow-v{grid-column:1;grid-row:2;width:100%;max-width:none;text-align:left}+.lrow.lrow-stack-value .lrow-v{grid-column:1;grid-row:2;width:100%;max-width:none;text-align:start}.lrow.lrow-stack-value .lrow-c{grid-column:2;grid-row:1 / span 2;align-self:center}/* an (i) before a row's control: painted small and dim so the control stays the loud thing,but with a finger-sized target like everything else — the padding is the hit area and the@@ -307,7 +307,7 @@ h4.sec{hit area back under the row's own 12px gap instead of adding to it. */.helpbtn{color:var(--label-3);font-size:16px;background:none;line-height:0;flex:none;- margin:-11px -2px -11px -4px;padding:11px 4px;+ margin-block:-11px;margin-inline:-4px -2px;padding:11px 4px;}.helpbtn:active{color:var(--label)}@@ -339,7 +339,7 @@ h4.sec{the WebView recomposites the blurred region on every scroll frame, and on Android that isthe single most expensive thing on the screen. See @supports below for the no-blur case. */#tabbar{- position:fixed;left:0;right:0;bottom:0;z-index:50;+ position:fixed;inset-inline-start:0;inset-inline-end:0;bottom:0;z-index:50;display:flex;justify-content:space-around;align-items:flex-end;padding:7px 6px calc(6px + var(--sab));background:color-mix(in srgb,var(--bg-el) 94%,transparent);@@ -422,7 +422,7 @@ h4.sec{.item{display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:var(--r-card);padding:10px 12px;min-height:60px;- transition:background var(--fast);text-align:left;width:100%;+ transition:background var(--fast);text-align: start;width:100%;}.item:active{background:var(--surface-2)}.routine-list{position:relative}@@ -455,7 +455,7 @@ h4.sec{.tag.acc{background:var(--acc-soft);color:var(--acc)}/* favourite marker (issue #6): a small yellow star glued to the exercise name — distinct fromthe accent "chosen" tag at the row's end, which means "already in a routine or the log" */-.fav-star{color:var(--yellow);font-size:12px;display:inline-block;margin-right:5px;vertical-align:-1px}+.fav-star{color:var(--yellow);font-size:12px;display:inline-block;margin-inline-end:5px;vertical-align:-1px}.fav-btn{margin-top:-4px}.fav-btn.on{color:var(--yellow)}@@ -517,22 +517,22 @@ body.chips-dragging *{cursor:inherit}/* --- search field --- */.searchf{position:relative;display:flex;align-items:center}.searchf .lead{- position:absolute;left:11px;font-size:16px;color:var(--label-3);+ position:absolute;inset-inline-start:11px;font-size:16px;color:var(--label-3);pointer-events:none;--icon-stroke:2.1;z-index:1;}-.searchf .field{padding-left:35px;padding-right:36px;background:var(--surface-2);border-radius:10px}+.searchf .field{padding-inline-start:35px;padding-inline-end:36px;background:var(--surface-2);border-radius:10px}:root[data-theme="light"] .searchf .field{background:rgba(118,118,128,.12)}.searchf .clear{- position:absolute;right:8px;width:22px;height:22px;border-radius:50%;+ position:absolute;inset-inline-end:8px;width:22px;height:22px;border-radius:50%;background:var(--label-3);color:var(--bg);display:flex;align-items:center;justify-content:center;font-size:11px;--icon-stroke:3;}/* legacy .search wrapper */.search{position:relative}-.search .input{padding-left:35px;background:var(--surface-2);border-radius:10px}+.search .input{padding-inline-start:35px;background:var(--surface-2);border-radius:10px}:root[data-theme="light"] .search .input{background:rgba(118,118,128,.12)}.search>svg{- position:absolute;left:11px;top:50%;transform:translateY(-50%);z-index:1;+ position:absolute;inset-inline-start:11px;top:50%;transform:translateY(-50%);z-index:1;width:16px;height:16px;stroke:var(--label-3);fill:none;stroke-width:2.1;stroke-linecap:round;}@@ -565,7 +565,7 @@ body.chips-dragging *{cursor:inherit}.seg>button{flex:1 1 0;min-width:0}:root[data-theme="light"] .seg{background:rgba(118,118,128,.12)}.seg-sel{- position:absolute;z-index:0;top:2px;bottom:2px;left:2px;+ position:absolute;z-index:0;top:2px;bottom:2px;inset-inline-start:2px;width:calc((100% - 4px)/var(--n));transform:translateX(calc(100% * var(--i)));background:var(--surface);border-radius:7px;@@ -585,7 +585,7 @@ body.chips-dragging *{cursor:inherit}shrinks below its labels, so a row whose title and control do not both fit — most translatedpacks at 390px: "Übungs-Animationen" against "Voll · Klein · Aus" — wraps the control onto itsown line under the title instead of painting it over the title. */-.seg-inline{flex:none;min-width:132px;max-width:100%;margin-left:auto}+.seg-inline{flex:none;min-width:132px;max-width:100%;margin-inline-start:auto}.lrow:has(.seg-inline){flex-wrap:wrap}.lrow:has(.seg-inline) .lrow-m{min-width:min(150px,100%)}.seg-range{margin-bottom:10px}@@ -603,7 +603,7 @@ body.chips-dragging *{cursor:inherit}its picker icon. Such a row wraps the field onto a line of its own under the title instead, stillflush right — the same way a row carrying an inline segmented control does. */.lrow:has(.timef){flex-wrap:wrap}-.lrow>.timef{margin-left:auto}+.lrow>.timef{margin-inline-start:auto}.timef::-webkit-calendar-picker-indicator{filter:invert(.5)}:root[data-theme="light"] .timef::-webkit-calendar-picker-indicator{filter:none}@@ -639,7 +639,7 @@ body.chips-dragging *{cursor:inherit}/* --- slider --- */.sld{position:relative;height:32px;display:flex;align-items:center;cursor:pointer;touch-action:none}.sld-track{- position:absolute;left:0;right:0;height:6px;border-radius:99px;+ position:absolute;inset-inline-start:0;inset-inline-end:0;height:6px;border-radius:99px;background:var(--surface-3);overflow:hidden;}.sld-fill{display:block;height:100%;background:var(--acc);border-radius:99px}@@ -697,8 +697,8 @@ body.chips-dragging *{cursor:inherit}font-size:12px;font-weight:500;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);}-.exmedia .gifhint{right:9px}-.exmedia .giftoggle{left:9px}+.exmedia .gifhint{inset-inline-end:9px}+.exmedia .giftoggle{inset-inline-start:9px}.exmedia .gifhint .icn,.exmedia .giftoggle .icn{font-size:13px}/* superset: both exercises are on screen together, so the animations have to give way —at 180px you had to scroll a full screen between two exercises done back-to-back */@@ -722,7 +722,7 @@ body.chips-dragging *{cursor:inherit}.sethead .ck-sp{width:30px;flex:none}.setrow{display:flex;align-items:center;gap:8px;padding:7px 0;position:relative}.setrow+.setrow::before{- content:'';position:absolute;left:32px;right:0;top:0;height:var(--hair);background:var(--sep);+ content:'';position:absolute;inset-inline-start:32px;inset-inline-end:0;top:0;height:var(--hair);background:var(--sep);}.setph{margin:8px 0 2px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--dim);display:flex;align-items:center;gap:10px}.setph::after{content:'';flex:1;height:1px;background:var(--sep)}@@ -831,7 +831,7 @@ body.chips-dragging *{cursor:inherit}}.effpick .menu-item.on{background:color-mix(in srgb,var(--bc) 14%,var(--surface))}.effpick .menu-on.is-on{color:var(--bc)}-.effpick .effpick-free{padding-right:8px}+.effpick .effpick-free{padding-inline-end:8px}.effpick .effpick-free .stp{flex:none;width:148px}.effpick .effpick-free .stp .num{font-size:17px;font-weight:600}.effpick .effpick-free .stp .num::placeholder{color:var(--label-3);font-weight:500}@@ -843,7 +843,7 @@ body.chips-dragging *{cursor:inherit}line up with the header exactly like a straight set — only the leading .n circle is replaced bya small L/R badge of the same width. */.setrow-side{display:flex;align-items:center;gap:8px;padding:4px 0;position:relative}-.setrow-side+.setrow-side::before{content:'';position:absolute;left:32px;right:0;top:0;height:var(--hair);background:var(--sep)}+.setrow-side+.setrow-side::before{content:'';position:absolute;inset-inline-start:32px;inset-inline-end:0;top:0;height:var(--hair);background:var(--sep)}.setrow-side>.n{align-self:center}.setrow-side .side-rows{flex:1;min-width:0;display:flex;flex-direction:column}/* inner side rows: no leading number circle (the badge takes its place), no top hairline between@@ -953,7 +953,7 @@ body.chips-dragging *{cursor:inherit}/* Under an L/R row the set number already sits outside the .side-rows box, so the indent thattucks a straight row's drops under its number would be paid twice — at 320 px both numberfields of a per-side drop collapsed to 0 px (QA C3). The label starts under the badge instead. */-.setrow-side .side-rows .subrow{padding-left:0}+.setrow-side .side-rows .subrow{padding-inline-start:0}.subrow .subn{font-size:11px;color:var(--label-3);flex:none;width:46px}/* the number outranks the buttons here as in the row above: room for "227.5" (a drop's weight)or "100" (the second mini is always reps) at 13 px, and the buttons shrink to 16 px first */@@ -966,7 +966,7 @@ body.chips-dragging *{cursor:inherit}/* label 46, two minis at their floors 70 + 60, the ✕ and three gaps: 252 px with the indent — thewhole row at 320 px. The label starts under the number circle's inner edge there instead. */@media (max-width:359px){- .subrow{padding-left:24px}+ .subrow{padding-inline-start:24px}}/* The number is the set's menu (drop / burst / remove); a 24px circle needs a finger-sized hit area. */.setrow .n::before{content:'';position:absolute;inset:-10px}@@ -988,7 +988,7 @@ body.chips-dragging *{cursor:inherit}/* why the next target is what it is (issue #17) */.progline{width:100%;display:flex;align-items:flex-start;gap:7px;margin:6px 0 2px;padding:0;- text-align:left;font-size:13px;line-height:1.38;color:var(--acc);+ text-align: start;font-size:13px;line-height:1.38;color:var(--acc);}.progline.warn{color:var(--yellow)}.progline svg{flex:none;margin-top:2px}@@ -1019,7 +1019,7 @@ body.chips-dragging *{cursor:inherit}/* --- rest timer --- */#timer{- position:fixed;left:12px;right:12px;bottom:calc(88px + var(--sab));z-index:60;+ position:fixed;inset-inline-start:12px;inset-inline-end:12px;bottom:calc(88px + var(--sab));z-index:60;/* nearly opaque: the set rows underneath were reading through the old 82% and made theclock hard to pick out mid-set. The blur stays, so it still sits above the page. */background:color-mix(in srgb,var(--surface) 97%,transparent);@@ -1040,7 +1040,7 @@ body.chips-dragging *{cursor:inherit}#timer.rest .head{display:flex;align-items:center;gap:12px}#timer.rest .acts{display:flex;align-items:center;gap:8px}#timer.rest .acts .btn{padding-top:11px;padding-bottom:11px} /* sweaty hands, mid-set */-#timer.rest .acts .skip{margin-left:auto;min-width:84px}+#timer.rest .acts .skip{margin-inline-start:auto;min-width:84px}/* work timer (issue #16): the same bar doing the opposite job — outlined and tinted so aglance tells "you are holding this" apart from "you are recovering". */#timer.working{border:var(--hair) solid var(--acc)}@@ -1060,7 +1060,7 @@ body.chips-dragging *{cursor:inherit}touch-action:none;overscroll-behavior:none;}.sheet{- position:absolute;left:0;right:0;bottom:0;background:var(--bg-el);+ position:absolute;inset-inline-start:0;inset-inline-end:0;bottom:0;background:var(--bg-el);border-radius:var(--r-xl) var(--r-xl) 0 0;padding:8px 18px calc(20px + var(--sab));/* A tall sheet stops short of the status bar / Dynamic Island: every cap carries the top@@ -1103,7 +1103,7 @@ body.chips-dragging *{cursor:inherit}.efftbl{background:var(--surface);border-radius:var(--r-lg);overflow:hidden;margin:14px 0 12px}.efftbl .r{display:flex;align-items:center;gap:10px;padding:10px 14px;position:relative}.efftbl .r+.r::before{- content:'';position:absolute;left:14px;right:0;top:0;height:var(--hair);background:var(--sep);+ content:'';position:absolute;inset-inline-start:14px;inset-inline-end:0;top:0;height:var(--hair);background:var(--sep);}.efftbl .n{width:36px;flex:none;text-align:center;font-size:17px;font-weight:600;@@ -1152,7 +1152,7 @@ body.chips-dragging *{cursor:inherit}}.bwin{display:flex;align-items:baseline;justify-content:center;gap:7px;margin:16px 0}.bwin input{- width:150px;background:none;border:none;outline:none;text-align:right;+ width:150px;background:none;border:none;outline:none;text-align: end;font-size:52px;font-weight:600;letter-spacing:-.035em;color:var(--label);}.bwin span{color:var(--label-2);font-size:19px}@@ -1173,7 +1173,7 @@ body.chips-dragging *{cursor:inherit}/* --- activity heatmap --- */.hm-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:2px}.hm-wrap::-webkit-scrollbar{display:none}-.hm-months{display:flex;margin-left:28px;margin-bottom:5px}+.hm-months{display:flex;margin-inline-start:28px;margin-bottom:5px}.hm-months span{flex:none;width:14px;font-size:11px;color:var(--label-3);white-space:nowrap;overflow:visible}.hm-body{display:flex}.hm-days{display:flex;flex-direction:column;gap:3px;flex:none;width:28px}@@ -1233,7 +1233,7 @@ body.chips-dragging *{cursor:inherit}.mrow .nm{flex:1;min-width:0;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mrow .bar{width:74px;height:5px;border-radius:3px;background:var(--surface-2);flex:none;overflow:hidden}.mrow .bar i{display:block;height:100%;background:var(--acc);border-radius:3px}-.mrow .v{font-size:12px;color:var(--label-2);min-width:52px;text-align:right;flex:none}+.mrow .v{font-size:12px;color:var(--label-2);min-width:52px;text-align: end;flex:none}/* A headline number inside a card — tile weight without a tile around it, for the pair ofreadings at the top of the effort card. */.stat-v{font-size:26px;font-weight:600;letter-spacing:-.026em;line-height:1.1}@@ -1277,7 +1277,7 @@ body.chips-dragging *{cursor:inherit}.empty{text-align:center;color:var(--label-2);padding:44px 20px;font-size:15px;line-height:1.45}.empty .ico{font-size:34px;color:var(--label-2);margin-bottom:12px;display:flex;justify-content:center}.steps-list{- padding-left:18px;color:var(--label-2);font-size:15px;line-height:1.5;+ padding-inline-start:18px;color:var(--label-2);font-size:15px;line-height:1.5;display:flex;flex-direction:column;gap:9px;}.steps-list::marker{color:var(--label-3)}@@ -1298,7 +1298,7 @@ body.chips-dragging *{cursor:inherit}.cal-d i.plan{background:var(--label-3)}.cal-d i.ovr{background:var(--orange)}.cal-legend{display:flex;gap:14px;justify-content:center;margin-top:12px;font-size:12px;color:var(--label-3)}-.cal-legend i{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:5px}+.cal-legend i{display:inline-block;width:6px;height:6px;border-radius:50%;margin-inline-end:5px}/* --- accent swatches --- */.swatches{display:flex;gap:12px;flex-wrap:wrap}@@ -1309,7 +1309,7 @@ body.chips-dragging *{cursor:inherit}/* --- supersets --- */.ss-label{font-size:12px;font-weight:600;letter-spacing:-.004em;text-transform:none;- color:var(--acc);margin:8px 0 5px 4px;display:flex;align-items:center;gap:5px;+ color:var(--acc);margin-block:8px 5px;margin-inline-start:4px;display:flex;align-items:center;gap:5px;}.ss-label .icn{font-size:13px}.item.in-ss{box-shadow:inset 3px 0 0 var(--acc)}@@ -1335,11 +1335,11 @@ body.chips-dragging *{cursor:inherit}it is the line that decides whether the numbers fit. 8 px each, and the superset card insidea unit keeps 4 (none below 360), so every set row has the same 256 px at 320 as in a plaincard, and 296–304 at 368. */- .wl-unit .card,.ss-card .card{padding-left:8px;padding-right:8px}- .wl-unit .ss-card{padding-left:4px;padding-right:4px}+ .wl-unit .card,.ss-card .card{padding-inline:8px}+ .wl-unit .ss-card{padding-inline:4px}}@media (max-width:359px){- .wl-unit .ss-card{padding-left:0;padding-right:0}+ .wl-unit .ss-card{padding-inline:0}}.ss-hd{font-size:12px;font-weight:600;color:var(--acc);margin-bottom:12px;@@ -1372,7 +1372,7 @@ body.chips-dragging *{cursor:inherit}.today-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;padding:12px 14px;border-radius:var(--r);background:var(--surface-2);- transition:background var(--fast);width:100%;text-align:left;cursor:pointer;+ transition:background var(--fast);width:100%;text-align: start;cursor:pointer;}.today-row:active{background:var(--surface-3)}.today-row .lbl2{font-size:11px;font-weight:500;letter-spacing:.03em;text-transform:uppercase;color:var(--label-3)}@@ -1472,7 +1472,7 @@ body.chips-dragging *{cursor:inherit}.cam-frame{position:absolute;inset:0;margin:auto;width:62%;aspect-ratio:1;border:2px dashed rgba(255,255,255,.75);border-radius:14px;pointer-events:none}/* ------------------------------------------------- the Coach entry on Plan -- */.coach-cta{- display:flex;align-items:center;gap:13px;width:100%;text-align:left;+ display:flex;align-items:center;gap:13px;width:100%;text-align: start;margin-bottom:12px;padding:14px 16px;border-radius:var(--r-card);background:linear-gradient(135deg,var(--acc-soft),color-mix(in srgb,var(--acc) 6%,var(--surface)));border:1px solid color-mix(in srgb,var(--acc) 35%,transparent);@@ -1487,3 +1487,27 @@ body.chips-dragging *{cursor:inherit}.coach-cta-t b{font-size:17px;font-weight:600;letter-spacing:-.015em;color:var(--label)}.coach-cta-t span{font-size:13px;color:var(--label-2);line-height:1.35}.coach-cta-chev{color:var(--acc);font-size:15px;flex:none}++/* ----------------------------------------------------------- RTL (Arabic) -- */+/* Directional icons flip: back chevrons point right, trailing chevrons point left. */+[dir="rtl"] [data-icon="chevronLeft"],+[dir="rtl"] [data-icon="chevronRight"]{transform:scaleX(-1)}+/* Segmented control: flex order reverses, so the sliding indicator moves the other way. */+[dir="rtl"] .seg-sel{transform:translateX(calc(-100% * var(--i)))}+/* Numbers and dates inside Arabic text still read left-to-right. */+[dir="rtl"] .num,[dir="rtl"] input[type="number"]{direction:ltr}+/* Superset edge stripe points at the inline start (the right, in RTL). */+[dir="rtl"] .item.in-ss{box-shadow:inset -3px 0 0 var(--acc)}+/* Slider: the thumb is offset from inline-start, which is the right edge in RTL, so the+ half-width centering shift points the other way. */+[dir="rtl"] .sld-knob{transform:translateX(50%)}+[dir="rtl"] .sld.dragging .sld-knob{transform:translateX(50%) scale(1.14)}+/* Switch: the knob rests at inline-start (the right, in RTL), so "on" travels the other+ way — the physical +20px would push it out of the track. */+[dir="rtl"] .sw.on .knob{transform:translateX(-20px)}+[dir="rtl"] .sw.on:active .knob{transform:translateX(-16px)}+/* Chronological grids keep their left-to-right order: heatmap weeks and calendar+ weekdays would otherwise mirror. */+[dir="rtl"] .hm-wrap,[dir="rtl"] .cal-grid{direction:ltr}+/* Tight tracking is tuned for Latin; Arabic is a connected script and gets none. */+[dir="rtl"] *{letter-spacing:0}diff --git a/frontend/src/lib/i18n.js b/frontend/src/lib/i18n.jsindex 71069331a..948a7f922 100644--- a/frontend/src/lib/i18n.js+++ b/frontend/src/lib/i18n.js@@ -41,6 +41,8 @@ export async function setLang(l) {: (await exerciseNamePacks['../exercise-names/' + base + '.js']()).default} catch (e) { exerciseNames = null }_setLangState(l, derivePack(l, dict), derivePack(l, instr), derivePack(l, exerciseNames))+ document.documentElement.lang = l+ document.documentElement.dir = l === 'ar' ? 'rtl' : 'ltr'notify()}diff --git a/frontend/src/lib/plan-share.js b/frontend/src/lib/plan-share.jsindex affc02f85..c8a4c30bd 100644--- a/frontend/src/lib/plan-share.js+++ b/frontend/src/lib/plan-share.js@@ -12,7 +12,7 @@ import { EXIDX, isBodyweightEq } from './exercises.js'import { modeOf, fmtSec, isBw, isPerSide, sideReps, MAX_PLANNED_WARMUPS } from './history.js'import { deriveSessionName } from './session-merge.js'import { uid, todayISO, DAYN, weekOrder, weekStartOf, fmtNum, exCount } from './format.js'-import { t, exerciseNameFor } from './i18n-core.js'+import { t, exerciseNameFor, getLang } from './i18n-core.js'import { convertWeight } from './units.js'import { MUSCLES, inMuscleOrder } from './muscles.js'@@ -355,7 +355,7 @@ export function planPrintHTML(S, owner) {? routines.map(r => routineHTML(r, unit)).join(''): `<p class="none">${esc(t('No routines yet.'))}</p>`const sub = [owner, todayISO()].filter(Boolean).map(esc).join(' · ')- return `<!doctype html><html><head><meta charset="utf-8">+ return `<!doctype html><html lang="${getLang()}" dir="${getLang() === 'ar' ? 'rtl' : 'ltr'}"><head><meta charset="utf-8"><title>${esc(t('Weekly Training Plan'))}</title><style>@page { margin: 16mm 15mm; }@@ -391,12 +391,12 @@ export function planPrintHTML(S, owner) {.ex + .ex, .ss + .ex, .ex + .ss { border-top: 1px solid #f2f3f6; }.ex-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }.ex-n { text-transform: capitalize; font-weight: 500; }- .ex-n .part { text-transform: capitalize; color: #9aa0ae; font-weight: 400; font-size: 12px; margin-left: 8px; }+ .ex-n .part { text-transform: capitalize; color: #9aa0ae; font-weight: 400; font-size: 12px; margin-inline-start: 8px; }.ex-s { color: #3d424e; white-space: nowrap; font-variant-numeric: tabular-nums; }.ex-note { color: #6a7080; font-size: 12px; margin-top: 2px; }.ex.empty, .none { color: #a2a8b6; }- .ss { break-inside: avoid; page-break-inside: avoid; border-left: 3px solid #cfe08a; padding-left: 12px; margin: 4px 0; }+ .ss { break-inside: avoid; page-break-inside: avoid; border-inline-start: 3px solid #cfe08a; padding-inline-start: 12px; margin: 4px 0; }.ss-tag { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #6a7a3a; font-weight: 700; padding-top: 4px; }.ss .ex:first-of-type { padding-top: 2px; }diff --git a/frontend/src/sheets.backfill.test.jsx b/frontend/src/sheets.backfill.test.jsxindex de4cc9ee7..501a085ce 100644--- a/frontend/src/sheets.backfill.test.jsx+++ b/frontend/src/sheets.backfill.test.jsx@@ -73,7 +73,7 @@ describe('log a past workout', () => {// and where even the longest word leaves no room for the field (Polish "Godzina rozpoczęcia"// at 320px), the field drops onto its own line rather than over the edge of the card.expect(cssSource).toContain('.lrow:has(.timef){flex-wrap:wrap}')- expect(cssSource).toContain('.lrow>.timef{margin-left:auto}')+ expect(cssSource).toContain('.lrow>.timef{margin-inline-start:auto}')})it('starts a backfilled session straight away on a free day', () => {diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsxindex e484bdf87..2168c295a 100644--- a/frontend/src/sheets.jsx+++ b/frontend/src/sheets.jsx@@ -282,7 +282,7 @@ function ImportSummary({ parsed, close }) {{parsed.from === parsed.to ? fmtDate(parsed.from, true) : fmtDate(parsed.from, true) + ' – ' + fmtDate(parsed.to, true)}</div>- <div className="tiles" style={{ textAlign: 'left' }}>+ <div className="tiles" style={{ textAlign: 'start' }}>{isBW ? <><div className="tile"><div className="l">{t('Weigh-ins')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{parsed.bodyweight.length}</div></div><div className="tile"><div className="l">{t('New')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fresh}</div></div>@@ -491,7 +491,7 @@ function HevyImportSheet({ close }) {{!w.from && b.from && (b.from === b.to ? fmtDate(b.from, true) : fmtDate(b.from, true) + ' – ' + fmtDate(b.to, true))}</div>- <div className="tiles" style={{ textAlign: 'left' }}>+ <div className="tiles" style={{ textAlign: 'start' }}><div className="tile"><div className="l">{t('Workouts')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{w.workouts.length}</div></div><div className="tile"><div className="l">{t('Routines')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{r.routines.length}</div></div><div className="tile"><div className="l">{t('Exercises matched')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{w.matched + r.matched}</div></div>@@ -958,7 +958,7 @@ function ExercisePicker({ onPick, close }) {{profile && <div className="small dim row" style={{ margin: '8px 0 2px', gap: 6, alignItems: 'center' }}><Icon name="dumbbell" style={{ fontSize: 13 }} />{showAll ? t('Showing all equipment') : t('Showing what you have in "{0}"', profile.name)}- <button className="chip nocap" style={{ marginLeft: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => setShowAll(v => !v)}>+ <button className="chip nocap" style={{ marginInlineStart: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => setShowAll(v => !v)}>{showAll ? t('Filter by "{0}"', profile.name) : t('Show all equipment')}</button></div>}@@ -968,7 +968,7 @@ function ExercisePicker({ onPick, close }) {those are cross-body-part views where a stale equipment filter would be confusing. */}<div className="chips" ref={bpStrip} style={{ margin: eqOpts.length > 1 ? '10px 0 6px' : '10px 0' }}>{favCount > 0 && <button className={'chip' + (bp === '☆' ? ' on' : '')} onClick={() => { setBp('☆'); setEq(''); setShown(50) }}><Icon name="starFill" className="fav-star" />{t('Favourites')} ({favCount})</button>}- {chosenCount > 0 && <button className={'chip' + (bp === '★' ? ' on' : '')} onClick={() => { setBp('★'); setEq(''); setShown(50) }}><Icon name="starFill" style={{ fontSize: 12, display: 'inline-block', marginRight: 4, verticalAlign: '-1px' }} />{t('Chosen')} ({chosenCount})</button>}+ {chosenCount > 0 && <button className={'chip' + (bp === '★' ? ' on' : '')} onClick={() => { setBp('★'); setEq(''); setShown(50) }}><Icon name="starFill" style={{ fontSize: 12, display: 'inline-block', marginInlineEnd: 4, verticalAlign: '-1px' }} />{t('Chosen')} ({chosenCount})</button>}<button className={'chip nocap' + (!bp ? ' on' : '')} onClick={() => { setBp(''); setShown(50) }}>{t('All')}</button>{BODYPARTS.map(b => <button key={b} className={'chip' + (bp === b ? ' on' : '')} onClick={() => { setBp(b); setShown(50) }}>{t(b)}</button>)}</div>@@ -1702,7 +1702,7 @@ function WorkoutDetail({ w, close }) {<div className="grow"><div className="tt capitalize" style={{ fontWeight: 600 }}>{ex ? exerciseNameFor(ex) : (e.n || e.id)} {w.prs && w.prs.includes(e.id) && <span className="pr"><Icon name="trophy" />PR</span>}</div><div className="ss">{e.sets.filter(hasCompletedWork).map(s => setLabel(e.id, s, e.target)).join(' · ') || t('no sets')}</div>{e.note && <div className="small dim" style={{ marginTop: 3 }}>- {e.notePin && <Icon name="flag" style={{ fontSize: 12, marginRight: 4, verticalAlign: '-1px', color: 'var(--yellow)' }} />}{e.note}+ {e.notePin && <Icon name="flag" style={{ fontSize: 12, marginInlineEnd: 4, verticalAlign: '-1px', color: 'var(--yellow)' }} />}{e.note}</div>}</div></div>}@@ -2160,17 +2160,17 @@ function FinishSummary({ w, prs, e1prs = [], close }) {return <div style={{ textAlign: 'center', padding: '8px 0' }}><div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="trophy" /></div><h3 style={{ margin: '8px 0' }}>{t('Workout complete!')}</h3>- <div className="tiles" style={{ textAlign: 'left' }}>+ <div className="tiles" style={{ textAlign: 'start' }}><div className="tile"><div className="l">{t('Duration')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtDur(w.end - w.start)}</div></div><div className="tile"><div className="l">{t('Volume')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtVol(w.vol, st.unit)}</div></div><div className="tile"><div className="l">{t('Sets')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{t('{0} sets · {1} work', setsDone(w), workSetsDone(w))}</div></div><div className="tile"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: 20 }}>{prs.length || '—'}</div></div></div>- {(prs.length > 0 || e1prs.length > 0) && <div style={{ textAlign: 'left', marginBottom: 12 }}>- {prs.map(id => <div key={id} className="small accent row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} <span className="capitalize">{EXIDX[id] ? exerciseNameFor(EXIDX[id]) : id}</span></div>)}- {e1prs.map(p => <div key={p.id} className="small accent row" style={{ gap: 5 }}><Icon name="chartLine" style={{ fontSize: 13 }} />{t('Best estimated 1RM:')} <span className="capitalize">{EXIDX[p.id] ? exerciseNameFor(EXIDX[p.id]) : p.id}</span> · {fmtNum(p.est)} {st.unit}</div>)}+ {(prs.length > 0 || e1prs.length > 0) && <div style={{ textAlign: 'start', marginBottom: 12 }}>+ {prs.map(id => <div key={id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} {EXIDX[id] ? exerciseNameFor(EXIDX[id]) : id}</div>)}+ {e1prs.map(p => <div key={p.id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="chartLine" style={{ fontSize: 13 }} />{t('Best estimated 1RM:')} {EXIDX[p.id] ? exerciseNameFor(EXIDX[p.id]) : p.id} · {fmtNum(p.est)} {st.unit}</div>)}</div>}- <h4 className="sec" style={{ textAlign: 'left' }}>{t('What you just trained')}</h4>+ <h4 className="sec" style={{ textAlign: 'start' }}>{t('What you just trained')}</h4><BodyMap load={loadOfWorkouts([w])} body={st.body} /><div style={{ height: 14 }} /><Button variant="primary" onClick={() => { close(); nav('/home') }}>{t('Nice!')}</Button>diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsxindex cda0978dc..4f779d5e4 100644--- a/frontend/src/views/Admin.jsx+++ b/frontend/src/views/Admin.jsx@@ -69,7 +69,7 @@ function UserDetail({ id, onChanged, close }) {{u.invitedBy && <span className="adm-pill">invite {u.invitedBy}</span>}<span className="adm-pill">joined {u.created ? fmtDate(u.created.slice(0, 10)) : '—'}</span></div>- <div className="tiles" style={{ textAlign: 'left' }}>+ <div className="tiles" style={{ textAlign: 'start' }}><div className="tile"><div className="l">Workouts</div><div className="v" style={{ fontSize: '1.1rem' }}>{workouts.length}</div></div><div className="tile"><div className="l">Weigh-ins</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.bodyweight.length}</div></div><div className="tile"><div className="l">Routines</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.routines.length}</div></div>@@ -200,11 +200,11 @@ function AuditCard({ tick }) {<div className="grow"><div className="small" style={{ fontWeight: 600 }}>{line.title}{/* a red pill, not a red row: twenty fumbled Face IDs in a row shouldn't read as an incident */}- {!e.ok && <span className="adm-pill bad" style={{ marginLeft: 6 }}>failed</span>}- {auditCat(e.ev) === 'admin' && <span className="adm-pill acc" style={{ marginLeft: 6 }}>admin</span>}</div>+ {!e.ok && <span className="adm-pill bad" style={{ marginInlineStart: 6 }}>failed</span>}+ {auditCat(e.ev) === 'admin' && <span className="adm-pill acc" style={{ marginInlineStart: 6 }}>admin</span>}</div>{line.sub && <div className="dim" style={{ fontSize: '.72rem' }}>{line.sub}</div>}</div>- <span className="small muted" style={{ flex: 'none', marginLeft: 8 }}>{fmtWhen(e.ts, meta?.now)}</span>+ <span className="small muted" style={{ flex: 'none', marginInlineStart: 8 }}>{fmtWhen(e.ts, meta?.now)}</span></div>})}{meta && !rows.length && <div className="adm-empty">Nothing logged yet.</div>}@@ -237,7 +237,7 @@ export default function Admin() {return <div className="narrow"><div className="hdr"><button className="iconbtn" onClick={() => nav('/settings')} aria-label="Back"><Icon name="chevronLeft" /></button>- <div style={{ flex: 1, marginLeft: 8 }}><h1 style={{ margin: 0 }}>Admin</h1>+ <div style={{ flex: 1, marginInlineStart: 8 }}><h1 style={{ margin: 0 }}>Admin</h1><div className="sub">{users ? users.length + ' users · ' + activeCount + ' active this week' : 'Loading…'}</div></div><button className="iconbtn" onClick={() => { loadUsers(); loadInvites(); setTick(n => n + 1) }} aria-label="refresh">↻</button></div>@@ -273,7 +273,7 @@ export default function Admin() {<div className="adm-lead">Everyone with a profile on this instance. Tap one to see their activity or to disable the account — their data is never deleted from here.</div><div className="list">{(users || []).map(u => <div key={u.id} className="item" onClick={() => openUser(u.id)} style={u.disabled ? { opacity: .55 } : null}>- <div className="grow"><div className="tt">{u.live && <Icon name="dot" style={{ fontSize: 9, color: 'var(--green)', display: 'inline-block', marginRight: 5 }} />}{u.name} {u.admin && <span className="adm-pill acc" style={{ marginLeft: 4 }}>admin</span>}{u.disabled && <span className="adm-pill bad" style={{ marginLeft: 4 }}>disabled</span>}</div>+ <div className="grow"><div className="tt">{u.live && <Icon name="dot" style={{ fontSize: 9, color: 'var(--green)', display: 'inline-block', marginInlineEnd: 5 }} />}{u.name} {u.admin && <span className="adm-pill acc" style={{ marginInlineStart: 4 }}>admin</span>}{u.disabled && <span className="adm-pill bad" style={{ marginInlineStart: 4 }}>disabled</span>}</div><div className="ss">{u.live ? 'training now · ' + u.live.name : u.workouts + ' workouts' + (u.lastWorkout ? ' · last ' + fmtDate(u.lastWorkout) : '') + ' · last sync ' + rel(u.lastSync)}</div></div>{u.hasPush && <Icon name="bell" title="push notifications on" style={{ fontSize: 15, color: 'var(--label-3)' }} />}<Icon name="chevronRight" className="chev" /></div>)}diff --git a/frontend/src/views/AdminCoach.jsx b/frontend/src/views/AdminCoach.jsxindex 54bd8f05f..7929dc986 100644--- a/frontend/src/views/AdminCoach.jsx+++ b/frontend/src/views/AdminCoach.jsx@@ -294,7 +294,7 @@ export default function AdminCoach() {<details className="adm-fold"><summary>Activity <Icon name="chevronRight" className="chev" /></summary><div className="adm-fold-b">- <div className="tiles" style={{ textAlign: 'left', marginBottom: 10 }}>+ <div className="tiles" style={{ textAlign: 'start', marginBottom: 10 }}><div className="tile"><div className="l">Jobs today</div><div className="v" style={{ fontSize: '1.1rem' }}>{d.jobsToday}</div></div><div className="tile"><div className="l">Last success</div><div className="v" style={{ fontSize: '.85rem' }}>{rel(d.lastSuccess?.at)}</div></div></div>diff --git a/frontend/src/views/CoachChat.jsx b/frontend/src/views/CoachChat.jsxindex c5bcea349..4769b1c4f 100644--- a/frontend/src/views/CoachChat.jsx+++ b/frontend/src/views/CoachChat.jsx@@ -606,7 +606,7 @@ function ProposalDetail({ entry, S }) {const r = b?.routines?.[Math.min(tab, (b?.routines?.length || 1) - 1)]const weekDays = useMemo(() => new Set(Object.keys(b?.week || {}).map(Number)), [b])return <div className="pdetail">- <div className="pcard-hd" style={{ paddingLeft: 0, paddingRight: 0 }}>+ <div className="pcard-hd" style={{ paddingInline: 0 }}><div className="pcard-eyebrow">{kind === 'create' ? t('Plan') : kind === 'debrief' ? t('Workout debrief') : t('Suggestions')} · {fmtDate(new Date(entry.at).toISOString().slice(0, 10))}</div><h2 className="pcard-h">{kind === 'create' ? (b?.name || t('Coach plan')) : kind === 'debrief' ? (entry.workout?.name || t('Workout')) : t(entry.decisions?.length === 1 ? '{0} suggestion' : '{0} suggestions', entry.decisions?.length || 0)}</h2>{!!entry.summary && <p className="pcard-sum">{entry.summary}</p>}@@ -625,7 +625,7 @@ function ProposalDetail({ entry, S }) {{kind === 'create' && b && <><WeekStrip days={weekDays} />- {b.routines.length > 1 && <div className="pcard-tabs" style={{ paddingLeft: 0, paddingRight: 0 }}>+ {b.routines.length > 1 && <div className="pcard-tabs" style={{ paddingInline: 0 }}>{b.routines.map((x, i) => <button key={x.id || i} className={'pcard-tab' + (i === tab ? ' on' : '')} onClick={() => setTab(i)}>{x.emoji} {x.name}</button>)}</div>}{r && <RoutineBlock r={r} unit={S.unit} />}diff --git a/frontend/src/views/CoachSetup.jsx b/frontend/src/views/CoachSetup.jsxindex 878d266ac..c0c699836 100644--- a/frontend/src/views/CoachSetup.jsx+++ b/frontend/src/views/CoachSetup.jsx@@ -115,7 +115,7 @@ export default function CoachSetup() {return <div className="narrow"><div className="hdr"><button className="iconbtn" onClick={() => nav('/settings')} aria-label={t('Back')}><Icon name="chevronLeft" /></button>- <div style={{ flex: 1, marginLeft: 10 }}><h1>{t('AI Coach')}</h1></div>+ <div style={{ flex: 1, marginInlineStart: 10 }}><h1>{t('AI Coach')}</h1></div></div><Section title={t('How should the Coach run?')} footer={current}>diff --git a/frontend/src/views/History.jsx b/frontend/src/views/History.jsxindex 6e99655e1..eaa89b160 100644--- a/frontend/src/views/History.jsx+++ b/frontend/src/views/History.jsx@@ -10,7 +10,7 @@ export default function History() {const S = useStore(s => s.S)return <><div className="hdr"><button className="iconbtn" onClick={() => nav('/stats')} aria-label={t('Stats')}><Icon name="chevronLeft" /></button>- <div style={{ flex: 1, marginLeft: 12 }}><h1>{t('History')}</h1><div className="sub">{t('{0} workouts', S.workouts.length)}</div></div></div>+ <div style={{ flex: 1, marginInlineStart: 12 }}><h1>{t('History')}</h1><div className="sub">{t('{0} workouts', S.workouts.length)}</div></div></div><Button icon="plus" onClick={logPastWorkoutSheet} style={{ marginBottom: 12 }}>{t('Log a past workout')}</Button>{S.workouts.length ? <div className="list">{[...S.workouts].reverse().map(w => <WorkoutRow key={w.id} w={w} onClick={() => workoutDetailSheet(w)} />)}</div>: <div className="empty"><div className="ico"><Icon name="history" /></div>{t('No workouts yet.')}</div>}diff --git a/frontend/src/views/Home.jsx b/frontend/src/views/Home.jsxindex 49baab18c..8f3aef84c 100644--- a/frontend/src/views/Home.jsx+++ b/frontend/src/views/Home.jsx@@ -157,7 +157,7 @@ export default function Home() {{fmtNum(Math.abs(delta))}</span>)}- <span className="dim small" style={{ marginLeft: 'auto' }}>{fmtDate(bw.d, true)}</span>+ <span className="dim small" style={{ marginInlineStart: 'auto' }}>{fmtDate(bw.d, true)}</span></div>{S.targetW && (<div className="small row" style={{ color: 'var(--yellow)', marginTop: 4, gap: 5 }}>diff --git a/frontend/src/views/Library.jsx b/frontend/src/views/Library.jsxindex 84ffd7dc8..db023755e 100644--- a/frontend/src/views/Library.jsx+++ b/frontend/src/views/Library.jsx@@ -43,7 +43,7 @@ export default function Library() {{profile && <div className="small dim row" style={{ margin: '-4px 2px 10px', gap: 6, alignItems: 'center' }}><Icon name="dumbbell" style={{ fontSize: 13 }} />{showAll ? t('Showing all equipment') : t('Showing what you have in "{0}"', profile.name)}- <button className="chip nocap" style={{ marginLeft: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => setShowAll(v => !v)}>+ <button className="chip nocap" style={{ marginInlineStart: 'auto', padding: '3px 10px', fontSize: 12 }} onClick={() => setShowAll(v => !v)}>{showAll ? t('Filter by "{0}"', profile.name) : t('Show all equipment')}</button></div>}diff --git a/frontend/src/views/Login.jsx b/frontend/src/views/Login.jsxindex f373ff762..c3a4fe3cf 100644--- a/frontend/src/views/Login.jsx+++ b/frontend/src/views/Login.jsx@@ -67,7 +67,7 @@ export default function Login() {{head}<div className="muted" style={{ marginBottom: 30 }}>{t('Live demo — everything stays in this browser.')}</div><Button variant="primary" icon="sparkles" onClick={() => setGuest(true)}>{t('Start the demo')}</Button>- <div className="card small muted" style={{ textAlign: 'left', marginTop: 16 }}>+ <div className="card small muted" style={{ textAlign: 'start', marginTop: 16 }}>{t('This demo runs entirely in your browser on example data — nothing is sent anywhere. Passkey sign-in and sync across your devices come with the openGym server, which you get by self-hosting it.')}</div><div className="dim small" style={{ marginTop: 22, lineHeight: 1.6 }}>@@ -85,7 +85,7 @@ export default function Login() {<div style={{ height: 10 }} /><Button icon="sparkles" onClick={() => useUI.getState().openSheet(close => <RegisterSheet close={close} />)}>{t('Create new profile')}</Button>{canGuest && <div style={{ height: 10 }} />}- </> : <div className="card small muted" style={{ textAlign: 'left' }}>{canGuest+ </> : <div className="card small muted" style={{ textAlign: 'start' }}>{canGuest? t("This browser doesn't support passkeys — you can still use openGym locally on this device.")// Without passkeys and without the guest entrance there is no way in from this browser,// so say that plainly instead of offering a local profile that cannot be created.diff --git a/frontend/src/views/Muscles.jsx b/frontend/src/views/Muscles.jsxindex a1de3db90..d9ac85e1f 100644--- a/frontend/src/views/Muscles.jsx+++ b/frontend/src/views/Muscles.jsx@@ -8,7 +8,7 @@ export default function Muscles() {const nav = useNavigate()return <><div className="hdr"><button className="iconbtn" onClick={() => nav('/library')} aria-label={t('Exercises')}><Icon name="chevronLeft" /></button>- <div style={{ flex: 1, marginLeft: 12 }}><h1>{t('Explore muscles')}</h1><div className="sub">{t('Choose a muscle to see exercises that train it.')}</div></div></div>+ <div style={{ flex: 1, marginInlineStart: 12 }}><h1>{t('Explore muscles')}</h1><div className="sub">{t('Choose a muscle to see exercises that train it.')}</div></div></div><MuscleExplorer onDetail={exerciseDetailSheet} onPlan={addToRoutineSheet} /></>diff --git a/frontend/src/views/Plan.jsx b/frontend/src/views/Plan.jsxindex ef00d8db4..bb838dbc2 100644--- a/frontend/src/views/Plan.jsx+++ b/frontend/src/views/Plan.jsx@@ -81,7 +81,7 @@ export default function Plan() {<div className="grow" style={{ minWidth: 0 }}><div className="tt" style={{ fontSize: 14 }}>{r.name}</div><div className="ss">{exCount(r.ex.length)}</div></div><button className="iconbtn sm" aria-label={t('Remove')} onClick={() => removeFromDay(d, r.id)}><Icon name="xmark" /></button></div>)}- <button className="btn ghost sm" style={{ marginTop: 4, marginLeft: 8 }} onClick={() => dayAddRoutineSheet(d)}>+ <button className="btn ghost sm" style={{ marginTop: 4, marginInlineStart: 8 }} onClick={() => dayAddRoutineSheet(d)}><Icon name="plus" /> {t('Add routine')}</button></div>diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 993c0373d..50c3dcabb 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -183,7 +183,7 @@ export default function Settings() {return <div className="narrow"><div className="hdr"><button className="iconbtn" onClick={() => nav('/home')} aria-label={t('Home')}><Icon name="chevronLeft" /></button>- <div style={{ flex: 1, marginLeft: 10 }}><h1>{t('Settings')}</h1></div>+ <div style={{ flex: 1, marginInlineStart: 10 }}><h1>{t('Settings')}</h1></div></div>{/* ---------- account (demo and mobile builds have nothing to sign in to) ---------- */}diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsxindex 3af72bb3b..425aa4f07 100644--- a/frontend/src/views/Stats.jsx+++ b/frontend/src/views/Stats.jsx@@ -197,8 +197,8 @@ function MuscleBalance({ S }) {<span style={{ display: 'block', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{row.name}{row.primary === sel- ? <span className="dim" style={{ fontSize: 11, marginLeft: 6 }}>{t('primary')}</span>- : <span className="dim" style={{ fontSize: 11, marginLeft: 6 }}>{t('secondary')}</span>}+ ? <span className="dim" style={{ fontSize: 11, marginInlineStart: 6 }}>{t('primary')}</span>+ : <span className="dim" style={{ fontSize: 11, marginInlineStart: 6 }}>{t('secondary')}</span>}</span><span className="small dim" style={{ display: 'block', fontWeight: 400 }}>{t('Est. 1RM')}: {fmtNum(row.est)} {S.unit} · {fmtDate(row.estDate, true)}</span></span>@@ -217,7 +217,7 @@ function MuscleBalance({ S }) {return <div key={slug} className="mrow"><span className="nm">{t(MUSCLE_NAME[slug])}</span><span className="bar"><i style={{ width: Math.round(strength[slug] * 100) + '%' }} /></span>- <span className="v" style={{ textAlign: 'right' }}>+ <span className="v" style={{ textAlign: 'end' }}>{sets90 ? t('{0} sets', fmtNum(sets90)) : strengthHint(slug)}{sets90 ? <span className="dim small" style={{ display: 'block', fontWeight: 400 }}>{strengthHint(slug)}</span> : null}</span>@@ -257,7 +257,7 @@ function EffortCard({ S }) {<div className="stat-v">{sum.avg == null ? '—' : fmtNum(toScale(kind, sum.avg)) + ' ' + hd}</div><div className="small dim">{t('average effort')}</div></div>- <div style={{ textAlign: 'right' }}>+ <div style={{ textAlign: 'end' }}><div className="stat-v" style={{ color: 'var(--yellow)' }}>{sum.hardPct == null ? '—' : Math.round(sum.hardPct * 100) + '%'}</div><div className="small dim">{t('at {0} {1} or harder', hd, fmtNum(toScale(kind, HARD_RIR)))}</div></div>diff --git a/frontend/src/views/Stats.test.js b/frontend/src/views/Stats.test.jsindex 179f8920d..aa2c921ed 100644--- a/frontend/src/views/Stats.test.js+++ b/frontend/src/views/Stats.test.js@@ -38,7 +38,7 @@ describe('Stats mixed-entry metric contract', () => {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;width:100%;max-width:none;text-align:left}')+ expect(cssSource).toContain('.lrow.lrow-stack-value .lrow-v{grid-column:1;grid-row:2;width:100%;max-width:none;text-align:start}')expect(cssSource).toContain('flex:0 1 auto;max-width:55%;min-width:0;')expect(cssSource).toContain('overflow:hidden;text-overflow:ellipsis;white-space:nowrap')})diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsxindex bed11c5e8..f633d2804 100644--- a/frontend/src/views/Workout.jsx+++ b/frontend/src/views/Workout.jsx@@ -397,9 +397,9 @@ function ExerciseBlock({ entryIdx, compact, dense, onToggle, onToggleSide, onFiestanding fact about the movement (exNotes), and the message you pinned to yourself lastsession. Today's own note is edited through the button in the header and shown last. */}{cfg.note && <div className="exnote">{cfg.note}</div>}- {standingNote && <div className="exnote"><Icon name="info" style={{ fontSize: 13, marginRight: 5, verticalAlign: '-2px' }} />{standingNote}</div>}+ {standingNote && <div className="exnote"><Icon name="info" style={{ fontSize: 13, marginInlineEnd: 5, verticalAlign: '-2px' }} />{standingNote}</div>}{pinnedNote && <div className="exnote" style={{ color: 'var(--yellow)' }}>- <Icon name="flag" style={{ fontSize: 13, marginRight: 5, verticalAlign: '-2px' }} />+ <Icon name="flag" style={{ fontSize: 13, marginInlineEnd: 5, verticalAlign: '-2px' }} />{t('From {0}:', fmtDate(pinnedNote.d, true))} {pinnedNote.note}</div>}{entry.note && <div className="exnote">{entry.note}</div>}