From 306753d6a1987a80282a698980f08c2625dba0e1 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 9 Nov 2026 10:02:02 +0100 Subject: [PATCH] fix(native): placeholders pass the tests and the theme, the swipe actions use tokens, the task card stays simple --- client/src/index.css | 4 +-- client/src/mobile/components/MContextMenu.tsx | 4 +-- client/src/mobile/components/MSkeleton.tsx | 3 ++- client/src/mobile/components/MSwipeRow.tsx | 6 ++--- .../mobile/components/useLongPress.test.tsx | 16 ++++++++--- .../mobile/screens/trip/tabs/MTodoListTab.tsx | 27 +++++++++++++------ client/src/theme/README.md | 2 +- .../mobile/admin/MAdminAddonManager.test.tsx | 6 ++--- .../admin/MAdminCategoryManager.test.tsx | 6 ++--- .../mobile/admin/MAdminGitHubPanel.test.tsx | 6 ++--- .../admin/MAdminMcpTokensPanel.test.tsx | 4 +-- .../MAdminPackingTemplateManager.test.tsx | 6 ++--- .../admin/MAdminPermissionsPanel.test.tsx | 4 +-- .../mobile/admin/MAdminUsersSection.test.tsx | 4 +-- .../tests/unit/mobile/atlas/MAtlas.test.tsx | 6 ++--- .../collections/MCollTripPickerSheet.test.tsx | 4 +-- .../mobile/collections/MCollections.test.tsx | 6 ++--- .../unit/mobile/journey/MJourney.test.tsx | 6 ++--- .../mobile/journey/MJourneyDetail.test.tsx | 4 +-- .../MPlacesSaveToCollectionSheet.test.tsx | 4 +-- 20 files changed, 74 insertions(+), 54 deletions(-) diff --git a/client/src/index.css b/client/src/index.css index 7bea87652..2f93e4c62 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -769,7 +769,7 @@ input[type="number"], input[type="time"], input[type="date"], input[type="dateti --fs-scale-caption: 1; --success: #16a34a; --success-soft: #dcfce7; - --danger: #dc2626; --danger-soft: #fef2f2; + --danger: #dc2626; --danger-soft: #fef2f2; --danger-text: #ffffff; --warning: #d97706; --warning-soft: #fffbeb; --info: #2563eb; --info-soft: #eff6ff; @@ -866,7 +866,7 @@ input[type="number"], input[type="time"], input[type="date"], input[type="dateti --day-tint-l-max: 0.88; --success: #22c55e; --success-soft: rgba(34, 197, 94, 0.15); - --danger: #ef4444; --danger-soft: rgba(239, 68, 68, 0.15); + --danger: #ef4444; --danger-soft: rgba(239, 68, 68, 0.15); --danger-text: #ffffff; --warning: #f59e0b; --warning-soft: rgba(245, 158, 11, 0.15); --info: #3b82f6; --info-soft: rgba(59, 130, 246, 0.15); diff --git a/client/src/mobile/components/MContextMenu.tsx b/client/src/mobile/components/MContextMenu.tsx index 48fd944ca..ff8170d56 100644 --- a/client/src/mobile/components/MContextMenu.tsx +++ b/client/src/mobile/components/MContextMenu.tsx @@ -7,7 +7,7 @@ import MSheet from './MSheet'; * card's own buttons offer, so this is a second way, never the only one. */ -export interface ContextAction { +interface ContextAction { key: string; label: string; icon: ReactElement; @@ -38,7 +38,7 @@ export default function MContextMenu({ open, title, actions, onClose }: MContext onClose(); action.onClick(); }} - className={`flex w-full items-center gap-[11px] rounded-xl px-[10px] py-[11px] text-start text-[0.84375rem] font-semibold active:bg-[color:var(--m-ic)] ${ + className={`flex w-full items-center gap-[11px] rounded-xl px-[10px] py-[11px] text-start text-body font-semibold active:bg-[color:var(--m-ic)] ${ danger ? 'text-[color:var(--m-st-danger)]' : 'text-m-ink' }`} > diff --git a/client/src/mobile/components/MSkeleton.tsx b/client/src/mobile/components/MSkeleton.tsx index 830cb2d1a..aeddd6b05 100644 --- a/client/src/mobile/components/MSkeleton.tsx +++ b/client/src/mobile/components/MSkeleton.tsx @@ -8,7 +8,7 @@ import { useTranslation } from '../../i18n'; * once as "Loading" for a screen reader; the shapes themselves are hidden from it. */ -export type MSkeletonVariant = 'rows' | 'cards' | 'detail' | 'map'; +type MSkeletonVariant = 'rows' | 'cards' | 'detail' | 'map'; interface MSkeletonProps { variant: MSkeletonVariant; @@ -69,6 +69,7 @@ export default function MSkeleton({ variant, count = 4, framed = true, className return (
diff --git a/client/src/mobile/components/MSwipeRow.tsx b/client/src/mobile/components/MSwipeRow.tsx index 8a16053b9..ce47a2a8f 100644 --- a/client/src/mobile/components/MSwipeRow.tsx +++ b/client/src/mobile/components/MSwipeRow.tsx @@ -45,9 +45,9 @@ const AXIS_BIAS = 1.5; const FULL_SHARE = 0.62; const TONE: Record = { - danger: 'bg-danger text-white', // theme-lint-disable: white on the danger fill, as the delete buttons draw it + danger: 'bg-danger text-[color:var(--danger-text)]', accent: 'bg-m-act text-m-actfg', - neutral: 'bg-[color:var(--m-faint)] text-white', // theme-lint-disable: white on the neutral action fill + neutral: 'bg-[color:var(--bg-inverse)] text-[color:var(--text-inverse)]', }; // The row open now, so opening another closes it. @@ -201,7 +201,7 @@ export default function MSwipeRow({ data-swipe-action="" tabIndex={open ? 0 : -1} onClick={() => run(action)} - className={`flex h-full w-[76px] flex-none flex-col items-center justify-center gap-1 text-[0.6875rem] font-semibold ${TONE[action.tone]}`} + className={`flex h-full w-[76px] flex-none flex-col items-center justify-center gap-1 text-caption font-semibold ${TONE[action.tone]}`} >