diff --git a/frontend/src/index.css b/frontend/src/index.css index 140da1b..5168b61 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -1168,10 +1168,11 @@ h4.sec{ .ci-card-btn{width:30px;height:30px;font-size:14px;flex:none} .ci-card .ci-label{flex:1;min-width:0;font-size:19px;font-weight:600;letter-spacing:-.014em;text-align:center;overflow-wrap:anywhere} .ci-card .ci-value{font-size:14px;color:var(--label-2);word-break:break-all;text-align:center;font-variant-numeric:tabular-nums} -/* long-press reorder: the lifted card floats above the rest, which dim slightly to recede. */ -.ci-rail.is-reordering{scroll-snap-type:none} -.ci-rail.is-reordering .ci-card:not(.is-dragging){opacity:.6} -.ci-card.is-dragging{transform:scale(1.03);box-shadow:0 12px 30px -8px rgba(0,0,0,.4);z-index:2} +/* reorder row under a card (only shown with >1 card): ◀ position ▶ to nudge the card one slot + along the rail. A plain, reliable control — no drag gesture to fight the horizontal scroll. */ +.ci-reorder{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:2px} +.ci-reorder .ci-pos{font-size:13px;color:var(--label-2);font-variant-numeric:tabular-nums;min-width:44px;text-align:center} +.ci-reorder .iconbtn:disabled{opacity:.3;pointer-events:none} /* The QR itself: lean-qr paints 1 module per pixel, so scale it up with the browser's nearest-neighbour so every module stays a crisp square instead of a blurred blob. White quiet-zone padding is baked in by the renderer; the plate underneath just frames it. */ diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js index aa131ee..6517939 100644 --- a/frontend/src/lib/pt-br-locale.test.js +++ b/frontend/src/lib/pt-br-locale.test.js @@ -28,10 +28,10 @@ describe('Brazilian Portuguese locale', () => { const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex') expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(631) - expect(inherited).toHaveLength(615) + expect(inherited).toHaveLength(617) // If this fails, review the changed keys and wording before accepting a new hash. From // frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list - expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('8aa678164e6e66010767af67175b1be48139334f54cdd07b75c3f28866a48f57') + expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('6a9e0df18bdd7020d2ad84104a020f2728f68b629933235fae7741b4ec71226d') }) test('does not leak European Portuguese UI terms', () => { diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index 92b60cf..5e206ae 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -1158,6 +1158,8 @@ export default { 'Membership number or code': 'Mitgliedsnummer oder Code', 'Save card': 'Karte speichern', 'Gym card': 'Studio-Karte', + 'Move left': 'Nach links', + 'Move right': 'Nach rechts', 'Edit card': 'Karte bearbeiten', 'Re-scan': 'Neu scannen', 'Scan it with the camera or import a photo.': 'Scanne sie mit der Kamera oder importiere ein Foto.', diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index be1eb37..6b14d47 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Número de socio o código', 'Save card': 'Guardar tarjeta', 'Gym card': 'Tarjeta del gimnasio', + 'Move left': 'Mover a la izquierda', + 'Move right': 'Mover a la derecha', 'Edit card': 'Editar tarjeta', 'Re-scan': 'Volver a escanear', 'Scan it with the camera or import a photo.': 'Escanéala con la cámara o importa una foto.', diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index 704d0d1..f3b37a4 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Numéro de membre ou code', 'Save card': 'Enregistrer la carte', 'Gym card': 'Carte de salle', + 'Move left': 'Déplacer à gauche', + 'Move right': 'Déplacer à droite', 'Edit card': 'Modifier la carte', 'Re-scan': 'Rescanner', 'Scan it with the camera or import a photo.': 'Scanne-la avec l’appareil photo ou importe une photo.', diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index 923066c..936f19a 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'मेंबरशिप नंबर या कोड', 'Save card': 'कार्ड सहेजें', 'Gym card': 'जिम कार्ड', + 'Move left': 'बाएँ ले जाएँ', + 'Move right': 'दाएँ ले जाएँ', 'Edit card': 'कार्ड संपादित करें', 'Re-scan': 'फिर से स्कैन करें', 'Scan it with the camera or import a photo.': 'इसे कैमरे से स्कैन करें या फ़ोटो इम्पोर्ट करें।', diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js index da6702b..4deed29 100644 --- a/frontend/src/locales/hu.js +++ b/frontend/src/locales/hu.js @@ -807,6 +807,8 @@ export default { 'Membership number or code': 'Tagsági szám vagy kód', 'Save card': 'Kártya mentése', 'Gym card': 'Terembérlet', + 'Move left': 'Balra', + 'Move right': 'Jobbra', 'Edit card': 'Kártya szerkesztése', 'Re-scan': 'Újraolvasás', 'Scan it with the camera or import a photo.': 'Olvasd be a kamerával, vagy importálj egy fotót.', diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index 3a98e9f..64cf97a 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Numero tessera o codice', 'Save card': 'Salva tessera', 'Gym card': 'Tessera palestra', + 'Move left': 'Sposta a sinistra', + 'Move right': 'Sposta a destra', 'Edit card': 'Modifica tessera', 'Re-scan': 'Scansiona di nuovo', 'Scan it with the camera or import a photo.': 'Scansionala con la fotocamera o importa una foto.', diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index c411344..2bc5b8f 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': '회원 번호 또는 코드', 'Save card': '카드 저장', 'Gym card': '헬스장 카드', + 'Move left': '왼쪽으로 이동', + 'Move right': '오른쪽으로 이동', 'Edit card': '카드 편집', 'Re-scan': '다시 스캔', 'Scan it with the camera or import a photo.': '카메라로 스캔하거나 사진을 가져오세요.', diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 195fed8..c20cfaa 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Numer członkowski lub kod', 'Save card': 'Zapisz kartę', 'Gym card': 'Karta siłowni', + 'Move left': 'Przesuń w lewo', + 'Move right': 'Przesuń w prawo', 'Edit card': 'Edytuj kartę', 'Re-scan': 'Zeskanuj ponownie', 'Scan it with the camera or import a photo.': 'Zeskanuj ją aparatem lub zaimportuj zdjęcie.', diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index a1eead5..60c8cd1 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Número de sócio ou código', 'Save card': 'Guardar cartão', 'Gym card': 'Cartão do ginásio', + 'Move left': 'Mover para a esquerda', + 'Move right': 'Mover para a direita', 'Edit card': 'Editar cartão', 'Re-scan': 'Digitalizar de novo', 'Scan it with the camera or import a photo.': 'Digitaliza-o com a câmara ou importa uma foto.', diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index db18d51..cafbfc8 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Номер участника или код', 'Save card': 'Сохранить карту', 'Gym card': 'Карта зала', + 'Move left': 'Влево', + 'Move right': 'Вправо', 'Edit card': 'Изменить карту', 'Re-scan': 'Сканировать заново', 'Scan it with the camera or import a photo.': 'Отсканируйте её камерой или импортируйте фото.', diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js index a647758..9061748 100644 --- a/frontend/src/locales/th.js +++ b/frontend/src/locales/th.js @@ -815,6 +815,8 @@ export default { 'Membership number or code': 'หมายเลขสมาชิกหรือรหัส', 'Save card': 'บันทึกบัตร', 'Gym card': 'บัตรยิม', + 'Move left': 'ย้ายไปทางซ้าย', + 'Move right': 'ย้ายไปทางขวา', 'Edit card': 'แก้ไขบัตร', 'Re-scan': 'สแกนใหม่', 'Scan it with the camera or import a photo.': 'สแกนด้วยกล้องหรือนำเข้ารูปถ่าย', diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index b3318ea..d51bbca 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': 'Üyelik numarası veya kodu', 'Save card': 'Kartı kaydet', 'Gym card': 'Salon kartı', + 'Move left': 'Sola taşı', + 'Move right': 'Sağa taşı', 'Edit card': 'Kartı düzenle', 'Re-scan': 'Yeniden tara', 'Scan it with the camera or import a photo.': 'Kamerayla tara ya da bir fotoğraf içe aktar.', diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index a489dee..053d497 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -1139,6 +1139,8 @@ export default { 'Membership number or code': '会员号或代码', 'Save card': '保存卡片', 'Gym card': '健身房卡片', + 'Move left': '向左移动', + 'Move right': '向右移动', 'Edit card': '编辑卡片', 'Re-scan': '重新扫描', 'Scan it with the camera or import a photo.': '用相机扫描或导入照片。', diff --git a/frontend/src/views/CheckIn.jsx b/frontend/src/views/CheckIn.jsx index b62f253..546b293 100644 --- a/frontend/src/views/CheckIn.jsx +++ b/frontend/src/views/CheckIn.jsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useRef, useState } from 'react' +import { useLayoutEffect, useRef, useState } from 'react' import { useNavigate } from 'react-router-dom' import { useStore } from '../store/useStore.js' import { useUI } from '../store/useUI.js' @@ -13,16 +13,9 @@ import CameraScan from '../components/CameraScan.jsx' import { Button, TextField } from '../components/ui.jsx' import { confirmSheet } from '../sheets.jsx' -// Long-press before a card lifts for reordering, and the finger travel that instead counts as a -// horizontal swipe of the rail. Mirrors the routine-editor drag (views/RoutineEdit.jsx) so the -// gesture feels the same across the app. -export const CI_LONG_PRESS_MS = 380 -export const CI_DRAG_SLOP = 8 - // Move the card at `from` to sit at index `to`, returning a new array (the input is left alone). -// This is the whole of the reorder once the drop target is known — kept as a pure function, apart -// from the pointer maths that computes `to`, so the ordering contract can be tested without a DOM. -// Out-of-range or no-op moves return an unchanged copy rather than throwing. +// Backs the on-card ◀ ▶ reorder buttons. Out-of-range or no-op moves return an unchanged copy +// rather than throwing, so a button at either end is simply inert. export function moveGymCard(cards, from, to) { const next = [...cards] if (from < 0 || from >= next.length) return next @@ -41,8 +34,8 @@ export function moveGymCard(cards, from, to) { // The rail reopens on the card you used last (lastGymCardId) and remembers the one you settle on, // so a member with two gyms lands on the right code without swiping. Cards are added by scanning // or importing a photo only — never by typing a code, which is too easy to fat-finger into a -// code that silently fails at the turnstile. An existing card can be edited (rename, re-scan) and -// the whole rail can be reordered with a long-press drag. +// code that silently fails at the turnstile. An existing card can be edited (rename, re-scan), and +// with more than one card each carries ◀ ▶ buttons to nudge its position along the rail. export default function CheckIn() { const nav = useNavigate() const cards = useStore(s => s.S.gymCards) || [] @@ -50,7 +43,6 @@ export default function CheckIn() { const update = useStore(s => s.update) const railRef = useRef(null) const [active, setActive] = useState(0) - const reorder = useRailReorder(railRef, cards) // Open on the last-used card. Done once on mount (and whenever the saved id changes from // elsewhere) with layout effect so the jump happens before paint — no visible scroll from 0. @@ -85,13 +77,14 @@ export default function CheckIn() { -