Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(places): settle the gates for the place form rework

Mauricec8e48460b608
diff --git a/client/scripts/eslint-baseline.json b/client/scripts/eslint-baseline.json
index df4ac5097..9c19b5144 100644
--- a/client/scripts/eslint-baseline.json
+++ b/client/scripts/eslint-baseline.json
@@ -1,6 +1,6 @@
{
"src": {
- "@typescript-eslint/no-non-null-assertion": 368,
+ "@typescript-eslint/no-non-null-assertion": 367,
"@typescript-eslint/no-misused-promises": 820,
"no-console": 88,
"complexity": 217,
diff --git a/client/scripts/theme-baseline.json b/client/scripts/theme-baseline.json
index fe60408e7..10da2cade 100644
--- a/client/scripts/theme-baseline.json
+++ b/client/scripts/theme-baseline.json
@@ -241,7 +241,7 @@
"mobile/screens/trip/sheets/MDaysSheet.tsx": 4,
"mobile/screens/trip/sheets/MExportSheet.tsx": 2,
"mobile/screens/trip/sheets/MImportSheet.tsx": 2,
- "mobile/screens/trip/sheets/MLinkedCosts.tsx": 9,
+ "mobile/screens/trip/sheets/MLinkedCosts.tsx": 8,
"mobile/screens/trip/sheets/MMehrSheet.tsx": 3,
"mobile/screens/trip/sheets/MNoteSheet.tsx": 1,
"mobile/screens/trip/sheets/MPlaceEditSheet.tsx": 2,
@@ -250,8 +250,8 @@
"mobile/screens/trip/sheets/MTransportFormSheet.tsx": 9,
"mobile/screens/trip/sheets/MTransportSheet.tsx": 9,
"mobile/screens/trip/sheets/MTripSheetUi.tsx": 5,
- "mobile/screens/trip/sheets/PlCategoryPicker.tsx": 2,
- "mobile/screens/trip/sheets/PlFileAttach.tsx": 7,
+ "mobile/screens/trip/sheets/PlCategoryPicker.tsx": 1,
+ "mobile/screens/trip/sheets/PlFileAttach.tsx": 3,
"mobile/screens/trip/sheets/PlPlaceSearch.tsx": 6,
"mobile/screens/trip/sheets/PlSheetChrome.tsx": 5,
"mobile/screens/trip/sheets/PlTimeFields.tsx": 3,
diff --git a/client/src/components/Planner/PlaceContactFields.test.tsx b/client/src/components/Planner/PlaceContactFields.test.tsx
index 82ea80228..987ae9eda 100644
--- a/client/src/components/Planner/PlaceContactFields.test.tsx
+++ b/client/src/components/Planner/PlaceContactFields.test.tsx
@@ -54,7 +54,7 @@ describe('PlaceContactFields (#2472)', () => {
const opens = screen.getAllByRole('textbox', { name: /Monday opens/ })
await user.type(opens[0], '0930')
expect(opens[0]).toHaveValue('09:30')
- expect(JSON.parse(onChange.mock.lastCall![1])[0]).toEqual({ closed: false, open: '09:30' })
+ expect(JSON.parse(onChange.mock.lastCall?.[1])[0]).toEqual({ closed: false, open: '09:30' })
})
it('FE-PLANNER-CONTACT-004: looked-up hours fill an empty place, and an edited one offers to take them over', async () => {
@@ -97,7 +97,7 @@ describe('PlaceContactFields (#2472)', () => {
const allDay = screen.getByRole('switch', { name: 'Monday: Open 24 hours' })
expect(allDay).toHaveAttribute('aria-checked', 'false')
await user.click(allDay)
- expect(JSON.parse(onChange.mock.lastCall![1])[0]).toEqual({ closed: false, open: '00:00', close: '23:59' })
+ expect(JSON.parse(onChange.mock.lastCall?.[1])[0]).toEqual({ closed: false, open: '00:00', close: '23:59' })
expect(allDay).toHaveAttribute('aria-checked', 'true')
// The two time fields give way to the word.
expect(screen.queryByRole('textbox', { name: /Monday opens/ })).not.toBeInTheDocument()
@@ -105,7 +105,7 @@ describe('PlaceContactFields (#2472)', () => {
// Closing the day turns the all-day switch off.
await user.click(screen.getByRole('switch', { name: 'Monday: Closed' }))
- expect(JSON.parse(onChange.mock.lastCall![1])[0]).toEqual({ closed: true })
+ expect(JSON.parse(onChange.mock.lastCall?.[1])[0]).toEqual({ closed: true })
expect(allDay).toHaveAttribute('aria-checked', 'false')
})
diff --git a/client/src/components/Planner/PlaceDetailsColumn.tsx b/client/src/components/Planner/PlaceDetailsColumn.tsx
index b2155ba30..f1e66e541 100644
--- a/client/src/components/Planner/PlaceDetailsColumn.tsx
+++ b/client/src/components/Planner/PlaceDetailsColumn.tsx
@@ -251,7 +251,7 @@ export default function PlaceDetailsColumn({
className="flex h-[36px] w-full shrink-0 items-center gap-2 rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] pe-3 ps-3.5 text-start"
>
<Landmark size={13} strokeWidth={2.2} className="flex-none text-m-muted" />
- <span className="min-w-0 flex-1 truncate font-geist text-[0.75rem] font-semibold text-m-ink">{t('places.details.title')}</span>
+ <span className="min-w-0 flex-1 truncate font-geist text-caption font-semibold text-m-ink">{t('places.details.title')}</span>
<ChevronDown
size={13}
strokeWidth={2.2}
diff --git a/client/src/components/Planner/PlaceFormModal.test.tsx b/client/src/components/Planner/PlaceFormModal.test.tsx
index ebd365d1a..a5a4bfd1f 100644
--- a/client/src/components/Planner/PlaceFormModal.test.tsx
+++ b/client/src/components/Planner/PlaceFormModal.test.tsx
@@ -2448,8 +2448,9 @@ describe('PlaceFormModal on the dialog frame', () => {
const coords = screen.getByRole('group', { name: 'Coordinates' });
expect(within(coords).getByPlaceholderText(/Latitude/i)).toBeInTheDocument();
expect(within(coords).getByPlaceholderText(/Longitude/i)).toBeInTheDocument();
- // Each Markdown field keeps its own formatting bar.
- expect(screen.getAllByRole('toolbar')).toHaveLength(2);
+ // Each Markdown field keeps its own formatting bar; only the open tab's is shown.
+ expect(screen.getAllByRole('toolbar', { hidden: true })).toHaveLength(2);
+ expect(screen.getAllByRole('toolbar')).toHaveLength(1);
});
it('FE-PLANNER-PLACEFORM-105: the new category field takes the focus when it opens', async () => {
@@ -2685,7 +2686,8 @@ describe('PlaceFormModal in the look of the booking editors', () => {
it('FE-PLANNER-PLACEFORM-120: the formatting bars show their names in the shared tooltip, never the native one', async () => {
const user = userEvent.setup();
render(<PlaceFormModal {...defaultProps} />);
- const bars = screen.getAllByRole('toolbar');
+ // Both Markdown texts have a bar; the hidden tab's waits under its tab.
+ const bars = screen.getAllByRole('toolbar', { hidden: true });
expect(bars).toHaveLength(2);
for (const bar of bars) {
for (const button of within(bar).getAllByRole('button')) expect(button).not.toHaveAttribute('title');
@@ -2748,6 +2750,8 @@ describe('PlaceFormModal and the columns beside it', () => {
const assignment = buildAssignment({ id: 123, day_id: 5, place, notes: 'Old note' });
render(<PlaceFormModal {...defaultProps} onSave={onSave} place={place} assignmentId={123} dayAssignments={[assignment]} />);
+ // The day's note sits under its own tab.
+ await user.click(within(screen.getByRole('group', { name: 'Text to edit' })).getByRole('button', { name: /day/i }));
const notes = screen.getByRole('textbox', { name: 'Notes for this day' });
expect(notes).toHaveValue('Old note');
await user.clear(notes);
diff --git a/client/src/components/Planner/PlaceFormTexts.tsx b/client/src/components/Planner/PlaceFormTexts.tsx
index 797594d7c..cf571469a 100644
--- a/client/src/components/Planner/PlaceFormTexts.tsx
+++ b/client/src/components/Planner/PlaceFormTexts.tsx
@@ -58,7 +58,7 @@ export function PlaceFormTexts({
return (
<div className={PANEL}>
- <Segmented
+ <Segmented<PlaceTextField>
fill
value={shown.field}
onChange={setActive}
diff --git a/client/src/components/Planner/TagColorField.tsx b/client/src/components/Planner/TagColorField.tsx
index 3883e5b28..f2f5f2372 100644
--- a/client/src/components/Planner/TagColorField.tsx
+++ b/client/src/components/Planner/TagColorField.tsx
@@ -97,6 +97,8 @@ export function TagColorField({
<div className="flex w-full flex-col gap-2.5">
<div
role="slider"
+ // The gradient runs left to right in every language; so does the pick on it.
+ dir="ltr"
tabIndex={0}
aria-label={t('places.tagColorCustom')}
aria-valuetext={hex}
@@ -111,10 +113,15 @@ export function TagColorField({
return { h: hsv.h, s: p.x, v: 1 - p.y };
})}
>
- <span className={THUMB} style={{ left: `${hsv.s * 100}%`, top: `${(1 - hsv.v) * 100}%`, background: hex }} />
+ <span
+ className={THUMB}
+ style={{ insetInlineStart: `${hsv.s * 100}%`, top: `${(1 - hsv.v) * 100}%`, background: hex }}
+ />
</div>
<div
role="slider"
+ // The gradient runs left to right in every language; so does the pick on it.
+ dir="ltr"
tabIndex={0}
aria-label={t('places.tagColorHue')}
aria-valuenow={Math.round(hsv.h)}
@@ -132,7 +139,10 @@ export function TagColorField({
}}
{...drag((e) => ({ ...hsv, h: at(e).x * 359.9 }))}
>
- <span className={`${THUMB} top-1/2`} style={{ left: `${(hsv.h / 360) * 100}%`, background: hueHex(hsv.h) }} />
+ <span
+ className={`${THUMB} top-1/2`}
+ style={{ insetInlineStart: `${(hsv.h / 360) * 100}%`, background: hueHex(hsv.h) }}
+ />
</div>
<div className="flex items-center gap-2">
<span
diff --git a/client/src/components/Planner/placeHours.test.ts b/client/src/components/Planner/placeHours.test.ts
index 27d3bc7b3..b64f81aac 100644
--- a/client/src/components/Planner/placeHours.test.ts
+++ b/client/src/components/Planner/placeHours.test.ts
@@ -67,7 +67,7 @@ describe('typing and taking over (#2472)', () => {
// Google writes a place open all week as one period on Sunday that never closes.
expect(weekFromPeriods([{ open: p(0, 0), close: null }])).toEqual(Array.from({ length: 7 }, () => ({ closed: false, ...ALL_DAY })))
// A day from midnight to the next midnight is the same.
- expect(weekFromPeriods([{ open: p(1, 0), close: p(2, 0) }])![0]).toEqual({ closed: false, ...ALL_DAY })
+ expect(weekFromPeriods([{ open: p(1, 0), close: p(2, 0) }])?.[0]).toEqual({ closed: false, ...ALL_DAY })
expect(isAllDay({ closed: false, open: '00:00', close: '23:59' })).toBe(true)
expect(isAllDay({ closed: false, open: '00:00', close: '00:00' })).toBe(true)
expect(isAllDay({ closed: false, open: '00:00', close: '22:00' })).toBe(false)
@@ -78,10 +78,10 @@ describe('typing and taking over (#2472)', () => {
const week = emptyWeek()
week[0] = { closed: false, ...ALL_DAY }
week[1] = { closed: false, open: '09:00', close: '17:00' }
- const lines = hoursLines(writeWeek(week), 'en', 'Closed', 'Open 24 hours')!
+ const lines = hoursLines(writeWeek(week), 'en', 'Closed', 'Open 24 hours') ?? []
expect(lines[0]).toBe('Monday: Open 24 hours')
expect(lines[1]).toBe('Tuesday: 09:00 – 17:00')
// Without the label the times stay, as before.
- expect(hoursLines(writeWeek(week), 'en', 'Closed')![0]).toBe('Monday: 00:00 – 23:59')
+ expect(hoursLines(writeWeek(week), 'en', 'Closed')?.[0]).toBe('Monday: 00:00 – 23:59')
})
})
diff --git a/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx b/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
index 79cbca704..6c48c70dd 100644
--- a/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
@@ -1,5 +1,6 @@
import { useEffect, useMemo, useRef, useState, type ClipboardEvent } from 'react'
import { Globe, MapPin, MapPinOff } from 'lucide-react'
+import { fs } from '../../../../components/shared/DialogShell'
import MSheet from '../../../components/MSheet'
import {
DEFAULT_FORM,
@@ -373,7 +374,8 @@ export default function MPlaceEditSheet({ planner, onOpenExpense }: MPlaceEditSh
onChange={e => handleChange('website', e.target.value)}
placeholder="https://"
aria-label={t('places.formWebsite')}
- className="min-w-0 flex-1 bg-transparent font-[inherit] text-[0.84375rem] font-medium text-m-ink outline-none placeholder:text-m-faint"
+ className="min-w-0 flex-1 bg-transparent font-[inherit] font-medium text-m-ink outline-none placeholder:text-m-faint"
+ style={fs(13.5, 'body')}
/>
</label>
diff --git a/client/src/mobile/screens/trip/sheets/PlCategoryPicker.tsx b/client/src/mobile/screens/trip/sheets/PlCategoryPicker.tsx
index c9faf713b..d484d7e11 100644
--- a/client/src/mobile/screens/trip/sheets/PlCategoryPicker.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlCategoryPicker.tsx
@@ -1,4 +1,4 @@
-import { useState } from 'react'
+import { createElement, useState } from 'react'
import { Ban, Check, ChevronDown, Plus, X } from 'lucide-react'
import { getCategoryIcon } from '../../../../components/shared/categoryIcons'
import { useNewCategory } from '../../../../components/Planner/usePlaceForm'
@@ -35,7 +35,14 @@ export default function PlCategoryPicker({ planner, value, onChange }: PlCategor
} = useNewCategory({ variant: 'sheet', create: tripActions.addCategory, onCreated: pick, t, toast })
const current = (categories || []).find(cat => String(cat.id) === value)
- const CurrentIcon = current ? getCategoryIcon(current.icon) : Ban
+ // The icon of the picked category, made as an element: a component looked up while
+ // rendering would be a new one each time to React.
+ const currentIcon = createElement(current ? getCategoryIcon(current.icon) : Ban, {
+ size: 15,
+ strokeWidth: 2,
+ className: 'flex-none',
+ style: current?.color ? { color: current.color } : undefined,
+ })
return (
<div>
@@ -46,7 +53,7 @@ export default function PlCategoryPicker({ planner, value, onChange }: PlCategor
onClick={() => setOpen(v => !v)}
className={`${SELECT_FIELD_CLS} gap-[10px] text-start`}
>
- <CurrentIcon size={15} strokeWidth={2} className="flex-none" style={current?.color ? { color: current.color } : undefined} />
+ {currentIcon}
<span className={`${ROW_TEXT} font-medium ${current ? 'text-m-ink' : 'text-m-faint'}`}>
{current ? current.name : t('places.noCategory')}
</span>
diff --git a/client/src/mobile/screens/trip/sheets/PlContactFields.test.tsx b/client/src/mobile/screens/trip/sheets/PlContactFields.test.tsx
index d46c7476d..414856aa9 100644
--- a/client/src/mobile/screens/trip/sheets/PlContactFields.test.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlContactFields.test.tsx
@@ -43,11 +43,11 @@ describe('PlContactFields', () => {
fireEvent.click(screen.getByRole('button', { name: 'places.hoursAdd' }));
fireEvent.click(screen.getByRole('switch', { name: 'Monday: places.hoursAllDay' }));
- expect(JSON.parse(onChange.mock.lastCall![1])[0]).toEqual({ closed: false, open: '00:00', close: '23:59' });
+ expect(JSON.parse(onChange.mock.lastCall?.[1])[0]).toEqual({ closed: false, open: '00:00', close: '23:59' });
expect(screen.getByRole('switch', { name: 'Monday: places.hoursAllDay' })).toHaveAttribute('aria-checked', 'true');
fireEvent.click(screen.getByRole('switch', { name: 'Tuesday: places.hoursClosed' }));
- expect(JSON.parse(onChange.mock.lastCall![1])[1]).toEqual({ closed: true });
+ expect(JSON.parse(onChange.mock.lastCall?.[1])[1]).toEqual({ closed: true });
expect(screen.getByText('places.hoursClosed')).toBeInTheDocument();
});
@@ -57,7 +57,7 @@ describe('PlContactFields', () => {
fireEvent.click(screen.getByRole('button', { name: 'places.hoursAdd' }));
fireEvent.click(screen.getByRole('switch', { name: 'Monday: places.hoursClosed' }));
fireEvent.click(screen.getByRole('button', { name: 'places.hoursCopyFirst:Monday' }));
- expect(JSON.parse(onChange.mock.lastCall![1]).every((d: { closed: boolean }) => d.closed)).toBe(true);
+ expect(JSON.parse(onChange.mock.lastCall?.[1]).every((d: { closed: boolean }) => d.closed)).toBe(true);
fireEvent.click(screen.getByRole('button', { name: 'places.hoursRemove' }));
expect(onChange).toHaveBeenLastCalledWith('opening_hours', '');
expect(screen.getByRole('button', { name: 'places.hoursAdd' })).toBeInTheDocument();
diff --git a/client/src/mobile/screens/trip/sheets/PlContactFields.tsx b/client/src/mobile/screens/trip/sheets/PlContactFields.tsx
index 9a19b4b30..98531a4a3 100644
--- a/client/src/mobile/screens/trip/sheets/PlContactFields.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlContactFields.tsx
@@ -4,22 +4,26 @@ import { Clock, Copy, DoorClosed, Mail, Phone, RotateCcw, X } from 'lucide-react
import { isAllDay, weekdayNames } from '../../../../components/Planner/placeHours';
import { usePlaceHours } from '../../../../components/Planner/usePlaceHours';
import CustomTimePicker from '../../../../components/shared/CustomTimePicker';
+import { fs } from '../../../../components/shared/DialogShell';
import { NO_AUTOFILL } from '../../../../utils/noAutofill';
import { AddFieldButton, AMOUNT_FIELD_CLS, Eyebrow, FORM_PAIR_CLS } from './PlSheetChrome';
+/** The text of the sheet's fields, 13.5 px as in FIELD_CLS, following the text size setting. */
+const FIELD_TEXT = fs(13.5, 'body');
+
type Translate = (key: string, params?: Record<string, string | number>) => string;
const LABEL = 'mb-[5px] mt-3 uppercase';
const BARE_INPUT =
- 'min-w-0 flex-1 bg-transparent font-[inherit] text-[0.84375rem] font-medium text-m-ink outline-none placeholder:text-m-faint';
+ 'min-w-0 flex-1 bg-transparent font-[inherit] font-medium text-m-ink outline-none placeholder:text-m-faint';
const HEAD_BUTTON = 'grid h-[28px] w-[28px] place-items-center rounded-full text-m-muted active:bg-[color:var(--m-ic)]';
const WEEK = 'overflow-hidden rounded-[18px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)]';
const DAY_ROW =
'grid grid-cols-[22px_minmax(0,1fr)_auto] items-center gap-[6px] border-b border-[color:var(--m-rowbr)] px-[8px] py-[6px] last:border-b-0';
/** A closed or all-day day says so where its two times would be. */
-const DAY_STATE = 'flex h-[38px] items-center px-[4px] text-[0.78125rem] font-medium text-m-muted';
+const DAY_STATE = 'flex h-[38px] items-center px-[4px] font-medium text-m-muted';
/** The two switches after the times: round, as tall as a time field. */
-const DAY_BUTTON = 'grid h-[30px] w-[30px] flex-none place-items-center rounded-full text-[0.6875rem] font-bold';
+const DAY_BUTTON = 'grid h-[30px] w-[30px] flex-none place-items-center rounded-full font-bold';
const DAY_BUTTON_OFF = 'bg-[color:var(--m-card)] text-m-muted';
const DAY_BUTTON_ON = 'bg-m-act text-m-actfg';
@@ -69,6 +73,7 @@ export function PlContactFields({
placeholder="+49 …"
aria-label={t('places.formPhone')}
className={BARE_INPUT}
+ style={FIELD_TEXT}
{...NO_AUTOFILL}
/>
</label>
@@ -86,6 +91,7 @@ export function PlContactFields({
placeholder="info@…"
aria-label={t('places.formEmail')}
className={BARE_INPUT}
+ style={FIELD_TEXT}
{...NO_AUTOFILL}
/>
</label>
@@ -131,9 +137,13 @@ export function PlContactFields({
const allDay = isAllDay(day);
return (
<div key={i} className={DAY_ROW}>
- <span className="text-[0.71875rem] font-semibold text-m-ink">{names[i]}</span>
+ <span className="font-semibold text-m-ink" style={fs(11.5, 'caption')}>
+ {names[i]}
+ </span>
{day.closed || allDay ? (
- <span className={DAY_STATE}>{day.closed ? t('places.hoursClosed') : t('places.hoursAllDay')}</span>
+ <span className={DAY_STATE} style={fs(12.5, 'body')}>
+ {day.closed ? t('places.hoursClosed') : t('places.hoursAllDay')}
+ </span>
) : (
<div className="flex min-w-0 items-center gap-[3px]">
<div className="min-w-0 flex-1">
@@ -160,6 +170,7 @@ export function PlContactFields({
aria-label={`${longNames[i]}: ${t('places.hoursAllDay')}`}
onClick={() => hours.toggleAllDay(i)}
className={`${DAY_BUTTON} ${allDay ? DAY_BUTTON_ON : DAY_BUTTON_OFF}`}
+ style={fs(11, 'caption')}
>
24h
</button>
diff --git a/client/src/mobile/screens/trip/sheets/PlFileAttach.tsx b/client/src/mobile/screens/trip/sheets/PlFileAttach.tsx
index cbfee6d89..255ec1f72 100644
--- a/client/src/mobile/screens/trip/sheets/PlFileAttach.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlFileAttach.tsx
@@ -41,10 +41,10 @@ export default function PlFileAttach({ planner, files, onAdd, onRemove, canAttac
<Eyebrow className="mb-[5px] mt-3 uppercase">{t('files.title')}</Eyebrow>
{(canAttach || canLink) && (
<div className={`grid gap-2 ${canAttach && canLink ? 'grid-cols-2' : 'grid-cols-1'}`}>
- {canAttach && <AddFieldButton icon={Paperclip} label={t('files.attach')} onClick={() => inputRef.current?.click()} />}
{canLink && (
<AddFieldButton icon={Link2} label={t('files.link')} onClick={() => setPicking(v => !v)} pressed={picking} ariaExpanded={picking} />
)}
+ {canAttach && <AddFieldButton icon={Paperclip} label={t('files.attach')} onClick={() => inputRef.current?.click()} />}
</div>
)}
<input
diff --git a/client/src/mobile/screens/trip/sheets/PlPlaceTexts.tsx b/client/src/mobile/screens/trip/sheets/PlPlaceTexts.tsx
index b112f5d1c..46363e864 100644
--- a/client/src/mobile/screens/trip/sheets/PlPlaceTexts.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlPlaceTexts.tsx
@@ -1,4 +1,5 @@
import { usePlaceTextTabs, type PlaceTextField } from '../../../../components/Planner/usePlaceTextTabs';
+import { fs } from '../../../../components/shared/DialogShell';
import MSegmented from '../../../components/MSegmented';
import { Eyebrow, FIELD_AREA_CLS } from './PlSheetChrome';
@@ -34,7 +35,7 @@ export function PlPlaceTexts({
return (
<div className="flex flex-col gap-2">
<Eyebrow className="-mb-[3px] mt-3 uppercase">{t('places.textsLabel')}</Eyebrow>
- <MSegmented
+ <MSegmented<PlaceTextField>
value={shown.field}
onChange={setActive}
options={tabs.map((tab) => ({
@@ -57,7 +58,9 @@ export function PlPlaceTexts({
aria-label={tab.aria}
className={FIELD_AREA_CLS}
/>
- <p className="m-0 mt-[5px] px-[6px] font-geist text-[0.65625rem] leading-snug text-m-faint">{tab.hint}</p>
+ <p className="m-0 mt-[5px] px-[6px] font-geist leading-snug text-m-faint" style={fs(10.5, 'caption')}>
+ {tab.hint}
+ </p>
</div>
))}
</div>
diff --git a/client/src/mobile/screens/trip/sheets/PlSheetChrome.tsx b/client/src/mobile/screens/trip/sheets/PlSheetChrome.tsx
index 111ebf15b..d85afa869 100644
--- a/client/src/mobile/screens/trip/sheets/PlSheetChrome.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlSheetChrome.tsx
@@ -3,6 +3,7 @@ import { Plus, Trash2, X } from 'lucide-react'
import type { LucideIcon } from 'lucide-react'
import MIconBtn from '../../../components/MIconBtn'
import { edgeFadeClass, useEdgeFade } from '../../../components/useEdgeFade'
+import { fs } from '../../../../components/shared/DialogShell'
import { CustomDatePicker } from '../../../../components/shared/CustomDateTimePicker'
/**
@@ -58,7 +59,7 @@ export function AddFieldButton({ icon: Icon, label, onClick, disabled, pressed,
className={`${SELECT_FIELD_CLS} gap-[10px] text-start disabled:opacity-40 ${pressed ? '!border-transparent !bg-m-act text-m-actfg' : 'text-m-faint'}`}
>
<Icon size={14} strokeWidth={2} aria-hidden="true" className="flex-none" />
- <span className="min-w-0 flex-1 truncate text-[0.84375rem] font-medium">{label}</span>
+ <span className="min-w-0 flex-1 truncate font-medium" style={fs(13.5, 'body')}>{label}</span>
<Plus size={14} strokeWidth={2.2} aria-hidden="true" className="flex-none" />
</button>
)
diff --git a/client/src/mobile/screens/trip/sheets/PlTags.tsx b/client/src/mobile/screens/trip/sheets/PlTags.tsx
index cdd1dc01a..ce88cc4b8 100644
--- a/client/src/mobile/screens/trip/sheets/PlTags.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlTags.tsx
@@ -20,14 +20,14 @@ const CHIP =
const CHIP_OFF = 'border-[color:var(--m-rowbr)] bg-[color:var(--m-card)]';
const DOT_BUTTON = 'grid h-[30px] w-[26px] flex-none place-items-center ps-[3px]';
const DOT = 'h-[12px] w-[12px] rounded-full ring-1 ring-inset ring-[color:var(--m-rowbr)]';
-const NAME_BUTTON = 'inline-flex h-full min-w-0 items-center gap-[5px] text-[0.75rem] font-semibold';
+const NAME_BUTTON = 'inline-flex h-full min-w-0 items-center gap-[5px] text-caption font-semibold';
/** The tick of a picked tag, in a round white badge. */
const TICK =
'me-[3px] grid h-[22px] w-[22px] flex-none place-items-center rounded-full bg-[color:var(--m-card)] shadow-sm';
/** Where a new tag is typed: the rest of the field's line, at least wide enough for a short name. */
const NEW_TAG = 'flex h-[30px] min-w-[9rem] flex-1 items-center gap-[6px]';
const NEW_INPUT =
- 'min-w-0 flex-1 bg-transparent font-[inherit] text-[0.75rem] font-semibold text-m-ink outline-none placeholder:font-medium placeholder:text-m-faint';
+ 'min-w-0 flex-1 bg-transparent font-[inherit] text-caption font-semibold text-m-ink outline-none placeholder:font-medium placeholder:text-m-faint';
const ADD_BUTTON = 'grid h-[30px] w-[30px] flex-none place-items-center rounded-full';
/** The palette laid into the sheet under the field, in the sheet's own surface. */
const PALETTE =
diff --git a/client/tests/unit/mobile/trip/MPlaceEditSheet.test.tsx b/client/tests/unit/mobile/trip/MPlaceEditSheet.test.tsx
index c0d43d6ba..4e5b0d3f1 100644
--- a/client/tests/unit/mobile/trip/MPlaceEditSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MPlaceEditSheet.test.tsx
@@ -77,7 +77,7 @@ describe('MPlaceEditSheet', () => {
expect(screen.getByPlaceholderText('places.formLatLabel')).toHaveValue('35.7148')
expect(screen.getByPlaceholderText('places.formLngLabel')).toHaveValue('139.7967')
expect(screen.getByPlaceholderText('https://')).toHaveValue('https://senso-ji.jp')
- expect(screen.getByRole('button', { name: /Food/ }).className).toContain('bg-m-act')
+ expect(screen.getByRole('button', { name: /^places.formCategory:/ })).toHaveAccessibleName('places.formCategory: Food')
expect(submit()).toHaveTextContent('common.save')
})
@@ -135,6 +135,7 @@ describe('MPlaceEditSheet', () => {
fireEvent.change(nameField(), { target: { value: 'Nakamise' } })
fireEvent.change(screen.getByPlaceholderText('places.formLatLabel'), { target: { value: '35.71' } })
fireEvent.change(screen.getByPlaceholderText('places.formLngLabel'), { target: { value: '139.79' } })
+ fireEvent.click(screen.getByRole('button', { name: /^places.formCategory:/ }))
fireEvent.click(screen.getByRole('button', { name: /Food/ }))
fireEvent.click(submit())
diff --git a/client/tests/unit/mobile/trip/PlCategoryPicker.test.tsx b/client/tests/unit/mobile/trip/PlCategoryPicker.test.tsx
index 8dc2266bf..d36926385 100644
--- a/client/tests/unit/mobile/trip/PlCategoryPicker.test.tsx
+++ b/client/tests/unit/mobile/trip/PlCategoryPicker.test.tsx
@@ -49,7 +49,7 @@ describe('PlCategoryPicker', () => {
setup({}, '4')
expect(field()).toHaveAccessibleName('places.formCategory: Museums')
openList()
- expect(screen.getByRole('button', { name: /Museums/ })).toHaveAttribute('aria-pressed', 'true')
+ expect(screen.getByRole('button', { name: 'Museums' })).toHaveAttribute('aria-pressed', 'true')
expect(screen.getByRole('button', { name: /^places.noCategory$/ })).toHaveAttribute('aria-pressed', 'false')
})