}
+ )}
{/* Sheets */}
v.setSheet(null)} />
diff --git a/client/src/pages/atlas/atlasChrome.test.ts b/client/src/pages/atlas/atlasChrome.test.ts
new file mode 100644
index 000000000..a817c371b
--- /dev/null
+++ b/client/src/pages/atlas/atlasChrome.test.ts
@@ -0,0 +1,34 @@
+import { describe, expect, it } from 'vitest';
+import { chromeFitPadding, chromePan } from './atlasChrome';
+
+// FE-ATLAS-CHROME-001 onwards: the atlas camera beside the touch shell's rail and header.
+
+describe('atlas chrome insets', () => {
+ it('FE-ATLAS-CHROME-001: nothing covering the map leaves the opening view alone', () => {
+ expect(chromePan(undefined, -80, false)).toBeNull();
+ expect(chromePan({ top: 0, start: 0 }, 40, false)).toBeNull();
+ // A tall window: the far north is already below the header.
+ expect(chromePan({ top: 62, start: 0 }, 83, false)).toBeNull();
+ });
+
+ it('FE-ATLAS-CHROME-002: the world moves away from the rail, in either reading direction', () => {
+ expect(chromePan({ top: 62, start: 100 }, 83, false)).toEqual([-50, 0]);
+ expect(chromePan({ top: 62, start: 100 }, 83, true)).toEqual([50, 0]);
+ });
+
+ it('FE-ATLAS-CHROME-004: on a short window the far north comes down from under the header, just as far as it needs', () => {
+ expect(chromePan({ top: 62, start: 0 }, -77, false)).toEqual([0, -139]);
+ });
+
+ it("FE-ATLAS-CHROME-003: a country is framed clear of the rail's side and the header", () => {
+ expect(chromeFitPadding({ top: 62, start: 100 }, false)).toEqual({
+ paddingTopLeft: [124, 86],
+ paddingBottomRight: [24, 24],
+ });
+ expect(chromeFitPadding({ top: 62, start: 100 }, true)).toEqual({
+ paddingTopLeft: [24, 86],
+ paddingBottomRight: [124, 24],
+ });
+ expect(chromeFitPadding(undefined, false)).toEqual({ paddingTopLeft: [24, 24], paddingBottomRight: [24, 24] });
+ });
+});
diff --git a/client/src/pages/atlas/atlasChrome.ts b/client/src/pages/atlas/atlasChrome.ts
new file mode 100644
index 000000000..6679741d2
--- /dev/null
+++ b/client/src/pages/atlas/atlasChrome.ts
@@ -0,0 +1,49 @@
+/**
+ * How much of the atlas map's edges a screen's own chrome covers, in px: the
+ * touch shell's rail along the leading edge, its floating header along the top.
+ * The phone screen measures them (MAtlas), the camera keeps clear of them.
+ */
+export interface AtlasChromeInsets {
+ top: number;
+ start: number;
+}
+
+/** Arabic runs right to left, and the rail stands on the right then. */
+function documentRtl(): boolean {
+ return typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
+}
+
+/** The northern edge of the inhabited world, which the opening view keeps below the header. */
+export const NORTH_EDGE_LAT = 75;
+
+/**
+ * The pan that fits the opening view to what the chrome leaves free, or null
+ * when there is nothing to move. Sideways the centre moves into the middle of
+ * the map beside the rail. Upwards the world moves down only as far as its
+ * inhabited top (NORTH_EDGE_LAT, at `northEdgeY` in the map's own pixels) needs
+ * to clear the header: a tall window shows it below the header anyway, a phone
+ * had the stars of the far north under it. Leaflet pans the camera, so the
+ * numbers point the other way from the world's move.
+ */
+export function chromePan(
+ insets: AtlasChromeInsets | undefined,
+ northEdgeY: number,
+ rtl = documentRtl()
+): [number, number] | null {
+ if (!insets) return null;
+ const x = insets.start ? (rtl ? 1 : -1) * (insets.start / 2) : 0;
+ const y = Math.min(0, northEdgeY - insets.top);
+ return x || y ? [x, y] : null;
+}
+
+/** The padding a country is framed with, wider on the rail's side and under the header. */
+export function chromeFitPadding(
+ insets: AtlasChromeInsets | undefined,
+ rtl = documentRtl()
+): { paddingTopLeft: [number, number]; paddingBottomRight: [number, number] } {
+ const start = insets?.start ?? 0;
+ return {
+ paddingTopLeft: [24 + (rtl ? 0 : start), 24 + (insets?.top ?? 0)],
+ paddingBottomRight: [24 + (rtl ? start : 0), 24],
+ };
+}
diff --git a/client/src/pages/atlas/useAtlas.ts b/client/src/pages/atlas/useAtlas.ts
index d5556389d..6303f45f9 100644
--- a/client/src/pages/atlas/useAtlas.ts
+++ b/client/src/pages/atlas/useAtlas.ts
@@ -1,6 +1,6 @@
-import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react'
+import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState, useRef } from 'react'
import { useNavigate } from 'react-router'
-import { getIntlLanguage, getLocaleForLanguage, useTranslation } from '../../i18n'
+import { getLocaleForLanguage, useTranslation } from '../../i18n'
import { useSettingsStore } from '../../store/settingsStore'
import { useTileUrl } from '../../hooks/useTileUrl'
import { OFM_DARK, OFM_POSITRON } from '../../constants/mapDefaults'
@@ -19,20 +19,11 @@ import { usePlaceLanguage } from '../../hooks/usePlaceLanguage'
import { useServerPing } from '../../sync/useServerPing'
import type { AtlasConfirmAction, VisitedRegionMap } from './useAtlasCountryActions'
import { createWishlistPattern, svgWishlistFill } from './atlasWishlistFill'
+import { chromeFitPadding, chromePan, NORTH_EDGE_LAT, type AtlasChromeInsets } from './atlasChrome'
+import { useCountryNames } from './useCountryNames'
const PLANNED_KEY = 'trek_atlas_show_planned'
-function useCountryNames(language: string): (code: string) => string {
- const [resolver, setResolver] = useState<(code: string) => string>(() => (code: string) => code)
- useEffect(() => {
- try {
- const dn = new Intl.DisplayNames([getIntlLanguage(language)], { type: 'region' })
- setResolver(() => (code: string) => { try { return dn.of(code) || code } catch { return code } })
- } catch { /* */ }
- }, [language])
- return resolver
-}
-
/**
* Atlas page logic — the whole interactive globe lives here: atlas/bucket-list
* loading, the Leaflet map lifecycle (country + sub-national region layers,
@@ -41,7 +32,9 @@ function useCountryNames(language: string): (code: string) => string {
* the returned state via its presentational SidebarContent helper.
* Behaviour is identical to the previous in-component logic.
*/
-export function useAtlas() {
+export function useAtlas(options: { chromeInsets?: () => AtlasChromeInsets } = {}) {
+ const chromeInsetsRef = useRef(options.chromeInsets)
+ useLayoutEffect(() => { chromeInsetsRef.current = options.chromeInsets })
const { t, language } = useTranslation()
const placeLang = usePlaceLanguage()
const { settings } = useSettingsStore()
@@ -380,6 +373,9 @@ export function useAtlas() {
map.getPane('regionPane')!.style.zIndex = '401'
mapInstance.current = map
+ // The opening view centres the world beside the screen's chrome, not behind the rail and under the header.
+ const pan = chromePan(chromeInsetsRef.current?.(), map.latLngToContainerPoint([NORTH_EDGE_LAT, 0]).y)
+ if (pan) map.panBy(pan, { animate: false })
// Both renderers live as long as the map does (see the note on the refs); map.remove()
// disposes them along with every other layer it holds.
countryRendererRef.current = L.canvas({ padding: 0.5, tolerance: 5 })
@@ -954,7 +950,8 @@ export function useAtlas() {
const layer = country_layer_by_a2_ref.current[country_code]
try {
if (layer?.getBounds && mapInstance.current) {
- mapInstance.current.fitBounds(layer.getBounds(), { padding: [24, 24], animate: true, maxZoom: 6 })
+ const padding = chromeFitPadding(chromeInsetsRef.current?.())
+ mapInstance.current.fitBounds(layer.getBounds(), { ...padding, animate: true, maxZoom: 6 })
}
} catch (e ) {
console.error('Error fitting bounds', e)
diff --git a/client/src/pages/atlas/useCountryNames.ts b/client/src/pages/atlas/useCountryNames.ts
new file mode 100644
index 000000000..e6c3c7488
--- /dev/null
+++ b/client/src/pages/atlas/useCountryNames.ts
@@ -0,0 +1,22 @@
+import { useEffect, useState } from 'react';
+import { getIntlLanguage } from '../../i18n';
+
+/** A country's name in the reader's language, from its ISO code; the code itself where none is known. */
+export function useCountryNames(language: string): (code: string) => string {
+ const [resolver, setResolver] = useState<(code: string) => string>(() => (code: string) => code);
+ useEffect(() => {
+ try {
+ const dn = new Intl.DisplayNames([getIntlLanguage(language)], { type: 'region' });
+ setResolver(() => (code: string) => {
+ try {
+ return dn.of(code) || code;
+ } catch {
+ return code;
+ }
+ });
+ } catch {
+ /* no region names in this runtime: the codes stand */
+ }
+ }, [language]);
+ return resolver;
+}
diff --git a/client/tests/unit/mobile/MBottomNav.test.tsx b/client/tests/unit/mobile/MBottomNav.test.tsx
index c2cd945e6..cfcc2dee3 100644
--- a/client/tests/unit/mobile/MBottomNav.test.tsx
+++ b/client/tests/unit/mobile/MBottomNav.test.tsx
@@ -259,4 +259,25 @@ describe('MBottomNav', () => {
});
expect([placeholder.left.children.length, placeholder.right.children.length]).toEqual(groups);
});
+
+ it("FE-MOB-NAV-020: More is marked for its screens with a ring, not the centre button's fill", () => {
+ seedAddons(['vacay', 'atlas', 'journey', 'collections']);
+ nav('/atlas');
+ const more = screen.getByRole('button', { name: 'More' });
+ expect(more).toHaveAttribute('aria-current', 'page');
+ expect(more.className).toContain('ring-[color:var(--m-act)]');
+ expect(more.className).not.toContain('bg-m-act');
+ });
+
+ it('FE-MOB-NAV-021: a list fades out under the dock, a map runs to the edge', () => {
+ seedAddons(['atlas', 'journey']);
+ const dashboard = nav('/dashboard');
+ expect(dashboard.container.querySelector('.m-dock-scrim')).toBeInTheDocument();
+ dashboard.unmount();
+ for (const path of ['/atlas', '/journey/3']) {
+ const screenOverMap = nav(path);
+ expect([path, screenOverMap.container.querySelector('.m-dock-scrim')]).toEqual([path, null]);
+ screenOverMap.unmount();
+ }
+ });
});
diff --git a/client/tests/unit/mobile/MNavRail.test.tsx b/client/tests/unit/mobile/MNavRail.test.tsx
index ca792932e..978e8b51f 100644
--- a/client/tests/unit/mobile/MNavRail.test.tsx
+++ b/client/tests/unit/mobile/MNavRail.test.tsx
@@ -1,7 +1,8 @@
-import { FolderOpen, Map as MapIcon } from 'lucide-react';
+import { FolderOpen, Map as MapIcon, PenLine } from 'lucide-react';
import { useLocation } from 'react-router';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import MNavRail from '../../../src/mobile/components/MNavRail';
+import { useScreenRailAction } from '../../../src/mobile/components/railAction';
import MobileShell from '../../../src/mobile/MobileShell';
import MTripRail from '../../../src/mobile/screens/trip/MTripRail';
import { useAddonStore } from '../../../src/store/addonStore';
@@ -86,6 +87,43 @@ describe('MNavRail', () => {
render(, { initialEntries: ['/settings'] });
expect(within(rail()).getAllByRole('button')[0]).toHaveAccessibleName('My Trips');
});
+
+ it('FE-MOB-RAIL-009: the head is the same 56px circle on every top-level page, so no entry moves', () => {
+ const head = () => rail().firstElementChild?.firstElementChild as HTMLElement;
+ for (const path of ['/dashboard', '/atlas', '/settings', '/admin', '/vacay']) {
+ const { unmount } = render(, { initialEntries: [path] });
+ expect([path, head().className]).toEqual([path, expect.stringContaining('h-14 w-14')]);
+ unmount();
+ }
+ });
+
+ it("FE-MOB-RAIL-010: on the vacation calendar the head is the screen's own switch", () => {
+ const toggle = vi.fn();
+ function Vacay({ editing }: { editing: boolean }) {
+ useScreenRailAction({ label: editing ? 'Year' : 'Edit calendar', icon: PenLine, pressed: editing, run: toggle });
+ return null;
+ }
+ const { rerender } = render(
+ <>
+
+
+ >,
+ { initialEntries: ['/vacay'] }
+ );
+ const first = within(rail()).getAllByRole('button')[0];
+ expect(first).toHaveAccessibleName('Edit calendar');
+ fireEvent.click(first);
+ expect(toggle).toHaveBeenCalledOnce();
+
+ rerender(
+ <>
+
+
+ >
+ );
+ expect(within(rail()).getAllByRole('button')[0]).toHaveAccessibleName('Year');
+ expect(within(rail()).getAllByRole('button')[0].className).toContain('border-2');
+ });
});
describe('MTripRail', () => {
@@ -162,6 +200,19 @@ describe('MobileShell on a wide window', () => {
expect(screen.getByLabelText('note')).toBe(field);
});
+ it('FE-MOB-RAIL-011: the rail comes before the page, so a keyboard reaches the navigation first', () => {
+ setSizeClass('wide');
+ const { container } = render(
+
+
+ ,
+ { initialEntries: ['/dashboard'] }
+ );
+ const page = screen.getByRole('button', { name: 'in the page' });
+ expect(rail().compareDocumentPosition(page) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
+ expect(container.querySelector('.m-shell')?.getAttribute('data-size')).toBe('wide');
+ });
+
it('FE-MOB-RAIL-008: no rail inside a trip, which brings its own', () => {
setSizeClass('wide');
render(
diff --git a/client/tests/unit/mobile/collections/MCollPlaceRow.test.tsx b/client/tests/unit/mobile/collections/MCollPlaceRow.test.tsx
index 76ec43102..610f0f499 100644
--- a/client/tests/unit/mobile/collections/MCollPlaceRow.test.tsx
+++ b/client/tests/unit/mobile/collections/MCollPlaceRow.test.tsx
@@ -62,4 +62,14 @@ describe('MCollPlaceRow', () => {
expect(props.onToggleSelect).toHaveBeenCalledWith(7)
expect(props.onOpen).not.toHaveBeenCalled()
})
+
+ it('FE-MOB-COLL-013: one card holds the place and its pills, the status worded in a readable mix of its colour', () => {
+ renderRow()
+ const status = screen.getByRole('button', { name: 'Want to go' })
+ const place = screen.getByText('Jungfernstieg').closest('button') as HTMLElement
+ // Both inside the same card, not in a card of their own beside it.
+ expect(status.closest('.rounded-2xl')).toBe(place.parentElement)
+ expect(status.style.color).toContain('color-mix')
+ expect(status.style.color).toContain('var(--m-ink)')
+ })
})
diff --git a/client/tests/unit/mobile/largeScreenPanes.test.tsx b/client/tests/unit/mobile/largeScreenPanes.test.tsx
index bc12e4057..4dc60e1f1 100644
--- a/client/tests/unit/mobile/largeScreenPanes.test.tsx
+++ b/client/tests/unit/mobile/largeScreenPanes.test.tsx
@@ -2,7 +2,7 @@ import userEvent from '@testing-library/user-event';
import { Settings2, Users } from 'lucide-react';
import { afterEach, describe, expect, it, vi } from 'vitest';
-import { MRailButton } from '../../../src/mobile/components/MRail';
+import { MRail, MRailButton } from '../../../src/mobile/components/MRail';
import MSectionNav from '../../../src/mobile/components/MSectionNav';
import MCollListNav from '../../../src/mobile/screens/collections/MCollListNav';
import MJourneyFeed from '../../../src/mobile/screens/journey/MJourneyFeed';
@@ -25,68 +25,62 @@ import { setSizeClass } from '../../helpers/sizeClass';
const echo = (key: string, params?: Record) =>
params ? `${key}:${Object.values(params).join(',')}` : key;
-describe('rail labels that fit', () => {
- // jsdom lays nothing out, so the label measures what these getters say: a word
- // `width` px wide at full size in a 64px box, narrower once it may hyphenate.
- function measureLike(width: number, hyphenated: number) {
- const proto = HTMLSpanElement.prototype;
- vi.spyOn(proto, 'scrollWidth', 'get').mockImplementation(function (this: HTMLElement) {
- const fit = Number(this.style.getPropertyValue('--fit') || 1);
- return (this.style.hyphens === 'auto' ? hyphenated : width) * fit;
+describe('rail labels', () => {
+ // jsdom lays nothing out: a name measures as two lines when its scrollHeight
+ // says so, against the 12px line its computed style reports.
+ function measureLike(twoLines: string[]) {
+ vi.spyOn(HTMLSpanElement.prototype, 'scrollHeight', 'get').mockImplementation(function (this: HTMLElement) {
+ return twoLines.includes(this.textContent ?? '') ? 24 : 12;
+ });
+ const real = window.getComputedStyle;
+ vi.spyOn(window, 'getComputedStyle').mockImplementation((el, pseudo) => {
+ const style = real(el, pseudo);
+ return new Proxy(style, {
+ get: (target, prop) => (prop === 'lineHeight' ? '12px' : Reflect.get(target, prop)),
+ });
});
- vi.spyOn(proto, 'clientWidth', 'get').mockReturnValue(64);
}
afterEach(() => vi.restoreAllMocks());
- function label() {
- return screen.getByText('Einstellungen');
+ function railOf(names: string[]) {
+ return render(
+
+ {names.map((name) => (
+ {}}>
+ x
+
+ ))}
+
+ );
}
+ const list = () => screen.getByText('Atlas').closest('nav')?.lastElementChild as HTMLElement;
- it('FE-MOB-PANES-001: a name that fits keeps its size and its words whole', () => {
- measureLike(60, 60);
- render(
- {}}>
- x
-
- );
- expect(label().style.getPropertyValue('--fit')).toBe('1');
- expect(label().style.hyphens).toBe('manual');
- expect(label().style.overflowWrap).toBe('normal');
+ it('FE-MOB-PANES-001: every name is drawn at the one caption size, none shrunk to fit', () => {
+ measureLike([]);
+ railOf(['Atlas', 'Einstellungen']);
+ for (const name of ['Atlas', 'Einstellungen']) {
+ const label = screen.getByText(name);
+ expect(label.className).toContain('text-[length:calc(10px*var(--fs-scale-caption,1))]');
+ expect(label.style.getPropertyValue('--fit')).toBe('');
+ }
});
- it('FE-MOB-PANES-002: a word a little too wide shrinks the name instead of splitting it', () => {
- measureLike(72, 40);
- render(
- {}}>
- x
-
- );
- const fit = Number(label().style.getPropertyValue('--fit'));
- expect(fit).toBeLessThan(1);
- expect(72 * fit).toBeLessThanOrEqual(64.5);
- expect(label().style.hyphens).toBe('manual');
+ it('FE-MOB-PANES-002: names that all fit on one line keep the rail at one line each', () => {
+ measureLike([]);
+ railOf(['Atlas', 'Vacay', 'Journey']);
+ expect(list().style.getPropertyValue('--m-rail-lines')).toBe('1');
});
- it('FE-MOB-PANES-003: a word too long even when small is hyphenated, and broken only past that', () => {
- measureLike(140, 60);
- const { unmount } = render(
- {}}>
- x
-
- );
- expect(label().style.hyphens).toBe('auto');
- expect(label().style.overflowWrap).toBe('normal');
- unmount();
-
- vi.restoreAllMocks();
- measureLike(140, 140);
- render(
- {}}>
- x
-
- );
- expect(label().style.overflowWrap).toBe('anywhere');
+ it('FE-MOB-PANES-003: one name on two lines gives every entry room for two, so the rhythm holds', () => {
+ measureLike(['Мои поездки']);
+ railOf(['Мои поездки', 'Atlas', 'Vacay']);
+ expect(list().style.getPropertyValue('--m-rail-lines')).toBe('2');
+ // Each name reserves the lines the rail settled on, and wraps balanced, hyphenating only a word too long.
+ const label = screen.getByText('Atlas');
+ expect(label.className).toContain('min-h-[calc(1.2em*var(--m-rail-lines,1))]');
+ expect(label.className).toContain('[text-wrap:balance]');
+ expect(label.className).toContain('[hyphens:auto]');
});
});
@@ -427,7 +421,7 @@ describe('files as tiles and a preview', () => {
expect(onMenu).toHaveBeenCalled();
});
- it('FE-MOB-PANES-016: without the right to edit files the preview only opens', () => {
+ it('FE-MOB-PANES-017: without the right to edit files the preview only opens', () => {
vi.spyOn(fileRepo, 'previewUrl').mockResolvedValue('/signed/1');
const planner = buildPlanner({ can: vi.fn(() => false) } as never);
render(
diff --git a/client/tests/unit/mobile/shellChrome.test.tsx b/client/tests/unit/mobile/shellChrome.test.tsx
new file mode 100644
index 000000000..c7d18e58b
--- /dev/null
+++ b/client/tests/unit/mobile/shellChrome.test.tsx
@@ -0,0 +1,50 @@
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { describe, expect, it } from 'vitest';
+import MGlassBar from '../../../src/mobile/components/MGlassBar';
+import { render, screen } from '../../helpers/render';
+
+// FE-MOB-CHROME-001 onwards: the touch shell's own chrome against what the
+// desktop pages bring along.
+
+const root = resolve(__dirname, '../../..');
+
+describe('desktop chrome inside the touch shell', () => {
+ it('FE-MOB-CHROME-001: a page without a phone screen shows no desktop navbar over the rail, and keeps no room for it', () => {
+ // /plugins/:id, /help and a trip's files still render through PageShell. jsdom
+ // applies no stylesheet, so the rule and the mark it needs are read from source.
+ const css = readFileSync(resolve(root, 'src/mobile/mobile.css'), 'utf8');
+ expect(css).toMatch(/html:has\(\.m-shell\) \{\s*--nav-h: 0px;\s*\}/);
+ expect(css).toMatch(/html:has\(\.m-shell\) \[data-desktop-navbar\] \{\s*display: none;\s*\}/);
+ const navbar = readFileSync(resolve(root, 'src/components/Layout/Navbar.tsx'), 'utf8');
+ expect(navbar).toContain('data-desktop-navbar=""');
+ });
+});
+
+describe('MGlassBar', () => {
+ it('FE-MOB-CHROME-002: a floating bar stands in the content column, padded and capped like it', () => {
+ render(
+
+ bar
+
+ );
+ const bar = screen.getByText('bar').parentElement as HTMLElement;
+ const column = bar.parentElement as HTMLElement;
+ expect(column.className).toContain('px-4');
+ expect(column.className).toContain('wide:px-6');
+ expect(column.className).toContain('wide:max-w-[1280px]');
+ expect(column.parentElement?.className).toContain('m-span-x');
+ // The strip around the bar lets taps through to the page.
+ expect(column.parentElement?.className).toContain('pointer-events-none');
+ expect(bar.className).toContain('pointer-events-auto');
+ });
+
+ it('FE-MOB-CHROME-003: in flow it is the bar alone', () => {
+ const { container } = render(
+
+ bar
+
+ );
+ expect(container.firstElementChild).toBe(screen.getByText('bar').parentElement);
+ });
+});
diff --git a/client/tests/unit/mobile/vacay/MVacay.test.tsx b/client/tests/unit/mobile/vacay/MVacay.test.tsx
index ae7bfe9bb..0fb14fa17 100644
--- a/client/tests/unit/mobile/vacay/MVacay.test.tsx
+++ b/client/tests/unit/mobile/vacay/MVacay.test.tsx
@@ -1,8 +1,10 @@
-// FE-MOB-MVACSCR-001 to FE-MOB-MVACSCR-021
+// FE-MOB-MVACSCR-001 to FE-MOB-MVACSCR-023
import React from 'react';
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { render, screen, fireEvent, within } from '../../../helpers/render';
import MVacay from '../../../../src/mobile/screens/vacay/MVacay';
+import MNavRail from '../../../../src/mobile/components/MNavRail';
+import { setSizeClass } from '../../../helpers/sizeClass';
import type { DayVisualContext } from '../../../../src/mobile/screens/vacay/vacayDayModel';
const mocks = vi.hoisted(() => ({ v: {} as Record }));
@@ -427,4 +429,30 @@ describe('MVacay', () => {
rerender();
expect(container.firstElementChild).toHaveClass('h-dvh');
});
+
+ it('FE-MOB-MVACSCR-022: on a wide window the switch stands at the head of the rail, not over the calendar', () => {
+ setSizeClass('wide');
+ render(
+ <>
+
+
+ >,
+ { initialEntries: ['/vacay'] }
+ );
+ const rail = screen.getByRole('navigation', { name: 'Navigation' });
+ // One switch, and it is the rail's first button.
+ expect(screen.getAllByRole('button', { name: 'Edit calendar' })).toHaveLength(1);
+ const head = within(rail).getAllByRole('button')[0];
+ expect(head).toHaveAccessibleName('Edit calendar');
+ fireEvent.click(head);
+ expect(mocks.v.toggleView).toHaveBeenCalledTimes(1);
+ });
+
+ it('FE-MOB-MVACSCR-023: each month of the year grid names its weekday columns, from the first day of the week', () => {
+ mocks.v = buildV({ weekStart: 0 });
+ render();
+ const grid = screen.getAllByRole('button', { name: 'Jan' })[0].parentElement as HTMLElement;
+ const letters = Array.from(grid.querySelectorAll('[aria-hidden="true"] > span')).map((el) => el.textContent);
+ expect(letters).toEqual(['S', 'M', 'T', 'W', 'T', 'F', 'S']);
+ });
});
diff --git a/shared/src/i18n/ar/mobileNav.ts b/shared/src/i18n/ar/mobileNav.ts
index 2cb6045a5..e1fa4b590 100644
--- a/shared/src/i18n/ar/mobileNav.ts
+++ b/shared/src/i18n/ar/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'الأماكن المحفوظة',
'mobileNav.more': 'المزيد',
'mobileNav.navigation': 'التنقل',
+ 'mobileNav.railSettings': 'الإعدادات',
+ 'mobileNav.railAdmin': 'الإدارة',
+ 'mobileNav.railCollections': 'المجموعات',
};
export default mobileNav;
diff --git a/shared/src/i18n/az/mobileNav.ts b/shared/src/i18n/az/mobileNav.ts
index 0ebaf3a32..678dff199 100644
--- a/shared/src/i18n/az/mobileNav.ts
+++ b/shared/src/i18n/az/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Saxlanılan məkanlar',
'mobileNav.more': 'Daha çox',
'mobileNav.navigation': 'Naviqasiya',
+ 'mobileNav.railSettings': 'Ayarlar',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Kolleksiyalar',
};
export default mobileNav;
diff --git a/shared/src/i18n/br/mobileNav.ts b/shared/src/i18n/br/mobileNav.ts
index 1b9a9400f..ad68d9274 100644
--- a/shared/src/i18n/br/mobileNav.ts
+++ b/shared/src/i18n/br/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Lugares salvos',
'mobileNav.more': 'Mais',
'mobileNav.navigation': 'Navegação',
+ 'mobileNav.railSettings': 'Ajustes',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Coleções',
};
export default mobileNav;
diff --git a/shared/src/i18n/ca/mobileNav.ts b/shared/src/i18n/ca/mobileNav.ts
index 12f52be0e..5ac867402 100644
--- a/shared/src/i18n/ca/mobileNav.ts
+++ b/shared/src/i18n/ca/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Llocs desats',
'mobileNav.more': 'Més',
'mobileNav.navigation': 'Navegació',
+ 'mobileNav.railSettings': 'Configuració',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Col·leccions',
};
export default mobileNav;
diff --git a/shared/src/i18n/cs/mobileNav.ts b/shared/src/i18n/cs/mobileNav.ts
index 50ec8283c..71e200a40 100644
--- a/shared/src/i18n/cs/mobileNav.ts
+++ b/shared/src/i18n/cs/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Uložená místa',
'mobileNav.more': 'Více',
'mobileNav.navigation': 'Navigace',
+ 'mobileNav.railSettings': 'Nastavení',
+ 'mobileNav.railAdmin': 'Administrace',
+ 'mobileNav.railCollections': 'Sbírky',
};
export default mobileNav;
diff --git a/shared/src/i18n/de/mobileNav.ts b/shared/src/i18n/de/mobileNav.ts
index c8f4678d5..d13fe0d55 100644
--- a/shared/src/i18n/de/mobileNav.ts
+++ b/shared/src/i18n/de/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Gespeicherte Orte',
'mobileNav.more': 'Mehr',
'mobileNav.navigation': 'Navigation', // same-as-en
+ 'mobileNav.railSettings': 'Einstellungen',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Sammlungen',
};
export default mobileNav;
diff --git a/shared/src/i18n/en/mobileNav.ts b/shared/src/i18n/en/mobileNav.ts
index 17f9ed7fe..89478ec36 100644
--- a/shared/src/i18n/en/mobileNav.ts
+++ b/shared/src/i18n/en/mobileNav.ts
@@ -5,6 +5,10 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Saved places',
'mobileNav.more': 'More',
'mobileNav.navigation': 'Navigation',
+ // The rail's own words, where a section's full name is too long for its 70px (MNavRail).
+ 'mobileNav.railSettings': 'Settings',
+ 'mobileNav.railAdmin': 'Admin',
+ 'mobileNav.railCollections': 'Collections',
};
export default mobileNav;
diff --git a/shared/src/i18n/es/mobileNav.ts b/shared/src/i18n/es/mobileNav.ts
index 58ed572f0..fb5ba3740 100644
--- a/shared/src/i18n/es/mobileNav.ts
+++ b/shared/src/i18n/es/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Lugares guardados',
'mobileNav.more': 'Más',
'mobileNav.navigation': 'Navegación',
+ 'mobileNav.railSettings': 'Ajustes',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Colecciones',
};
export default mobileNav;
diff --git a/shared/src/i18n/et/mobileNav.ts b/shared/src/i18n/et/mobileNav.ts
index 026729ca3..8ce5f2954 100644
--- a/shared/src/i18n/et/mobileNav.ts
+++ b/shared/src/i18n/et/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Salvestatud kohad',
'mobileNav.more': 'Veel',
'mobileNav.navigation': 'Navigeerimine',
+ 'mobileNav.railSettings': 'Seaded',
+ 'mobileNav.railAdmin': 'Haldus',
+ 'mobileNav.railCollections': 'Kogumikud',
};
export default mobileNav;
diff --git a/shared/src/i18n/fr/mobileNav.ts b/shared/src/i18n/fr/mobileNav.ts
index 3999774d6..1f4f55801 100644
--- a/shared/src/i18n/fr/mobileNav.ts
+++ b/shared/src/i18n/fr/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Lieux enregistrés',
'mobileNav.more': 'Plus',
'mobileNav.navigation': 'Navigation', // same-as-en
+ 'mobileNav.railSettings': 'Paramètres',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Collections', // same-as-en
};
export default mobileNav;
diff --git a/shared/src/i18n/gr/mobileNav.ts b/shared/src/i18n/gr/mobileNav.ts
index 384eac51f..b38efceb1 100644
--- a/shared/src/i18n/gr/mobileNav.ts
+++ b/shared/src/i18n/gr/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Αποθηκευμένες τοποθεσίες',
'mobileNav.more': 'Περισσότερα',
'mobileNav.navigation': 'Πλοήγηση',
+ 'mobileNav.railSettings': 'Ρυθμίσεις',
+ 'mobileNav.railAdmin': 'Διαχείριση',
+ 'mobileNav.railCollections': 'Συλλογές',
};
export default mobileNav;
diff --git a/shared/src/i18n/he/mobileNav.ts b/shared/src/i18n/he/mobileNav.ts
index 5a3bc7916..61fe52986 100644
--- a/shared/src/i18n/he/mobileNav.ts
+++ b/shared/src/i18n/he/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'מקומות שמורים',
'mobileNav.more': 'עוד',
'mobileNav.navigation': 'ניווט',
+ 'mobileNav.railSettings': 'הגדרות',
+ 'mobileNav.railAdmin': 'ניהול',
+ 'mobileNav.railCollections': 'אוספים',
};
export default mobileNav;
diff --git a/shared/src/i18n/hu/mobileNav.ts b/shared/src/i18n/hu/mobileNav.ts
index e9f0fa6e0..66b2a42ba 100644
--- a/shared/src/i18n/hu/mobileNav.ts
+++ b/shared/src/i18n/hu/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Mentett helyek',
'mobileNav.more': 'Több',
'mobileNav.navigation': 'Navigáció',
+ 'mobileNav.railSettings': 'Beállítások',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Gyűjtemény',
};
export default mobileNav;
diff --git a/shared/src/i18n/id/mobileNav.ts b/shared/src/i18n/id/mobileNav.ts
index ffddc96f2..dfcf6cbca 100644
--- a/shared/src/i18n/id/mobileNav.ts
+++ b/shared/src/i18n/id/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Tempat tersimpan',
'mobileNav.more': 'Lainnya',
'mobileNav.navigation': 'Navigasi',
+ 'mobileNav.railSettings': 'Pengaturan',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Koleksi',
};
export default mobileNav;
diff --git a/shared/src/i18n/it/mobileNav.ts b/shared/src/i18n/it/mobileNav.ts
index 17670c7fe..794c66174 100644
--- a/shared/src/i18n/it/mobileNav.ts
+++ b/shared/src/i18n/it/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Luoghi salvati',
'mobileNav.more': 'Altro',
'mobileNav.navigation': 'Navigazione',
+ 'mobileNav.railSettings': 'Impostazioni',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Raccolte',
};
export default mobileNav;
diff --git a/shared/src/i18n/ja/mobileNav.ts b/shared/src/i18n/ja/mobileNav.ts
index 1eb2d14ee..cb9396799 100644
--- a/shared/src/i18n/ja/mobileNav.ts
+++ b/shared/src/i18n/ja/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': '保存した場所',
'mobileNav.more': 'その他',
'mobileNav.navigation': 'ナビゲーション',
+ 'mobileNav.railSettings': '設定',
+ 'mobileNav.railAdmin': '管理',
+ 'mobileNav.railCollections': 'コレクション',
};
export default mobileNav;
diff --git a/shared/src/i18n/ko/mobileNav.ts b/shared/src/i18n/ko/mobileNav.ts
index 7d7297546..f6f4f0886 100644
--- a/shared/src/i18n/ko/mobileNav.ts
+++ b/shared/src/i18n/ko/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': '저장한 장소',
'mobileNav.more': '더 보기',
'mobileNav.navigation': '탐색',
+ 'mobileNav.railSettings': '설정',
+ 'mobileNav.railAdmin': '관리자',
+ 'mobileNav.railCollections': '컬렉션',
};
export default mobileNav;
diff --git a/shared/src/i18n/nl/mobileNav.ts b/shared/src/i18n/nl/mobileNav.ts
index 7e9ba7178..c88348386 100644
--- a/shared/src/i18n/nl/mobileNav.ts
+++ b/shared/src/i18n/nl/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Opgeslagen plaatsen',
'mobileNav.more': 'Meer',
'mobileNav.navigation': 'Navigatie',
+ 'mobileNav.railSettings': 'Instellingen',
+ 'mobileNav.railAdmin': 'Beheer',
+ 'mobileNav.railCollections': 'Collecties',
};
export default mobileNav;
diff --git a/shared/src/i18n/pl/mobileNav.ts b/shared/src/i18n/pl/mobileNav.ts
index 1e9743b90..c5ec4f31a 100644
--- a/shared/src/i18n/pl/mobileNav.ts
+++ b/shared/src/i18n/pl/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Zapisane miejsca',
'mobileNav.more': 'Więcej',
'mobileNav.navigation': 'Nawigacja',
+ 'mobileNav.railSettings': 'Ustawienia',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Kolekcje',
};
export default mobileNav;
diff --git a/shared/src/i18n/ru/mobileNav.ts b/shared/src/i18n/ru/mobileNav.ts
index 42049d903..7d8fdbae5 100644
--- a/shared/src/i18n/ru/mobileNav.ts
+++ b/shared/src/i18n/ru/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Сохранённые места',
'mobileNav.more': 'Ещё',
'mobileNav.navigation': 'Навигация',
+ 'mobileNav.railSettings': 'Настройки',
+ 'mobileNav.railAdmin': 'Админ',
+ 'mobileNav.railCollections': 'Коллекции',
};
export default mobileNav;
diff --git a/shared/src/i18n/sk/mobileNav.ts b/shared/src/i18n/sk/mobileNav.ts
index 662629653..7b87c9d7f 100644
--- a/shared/src/i18n/sk/mobileNav.ts
+++ b/shared/src/i18n/sk/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Uložené miesta',
'mobileNav.more': 'Viac',
'mobileNav.navigation': 'Navigácia',
+ 'mobileNav.railSettings': 'Nastavenia',
+ 'mobileNav.railAdmin': 'Správa',
+ 'mobileNav.railCollections': 'Zbierky',
};
export default mobileNav;
diff --git a/shared/src/i18n/sv/mobileNav.ts b/shared/src/i18n/sv/mobileNav.ts
index 5d4a5b3b8..c1397b63d 100644
--- a/shared/src/i18n/sv/mobileNav.ts
+++ b/shared/src/i18n/sv/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Sparade platser',
'mobileNav.more': 'Mer',
'mobileNav.navigation': 'Navigering',
+ 'mobileNav.railSettings': 'Inställningar',
+ 'mobileNav.railAdmin': 'Admin', // same-as-en
+ 'mobileNav.railCollections': 'Samlingar',
};
export default mobileNav;
diff --git a/shared/src/i18n/th/mobileNav.ts b/shared/src/i18n/th/mobileNav.ts
index 9548a5152..11ca4c18a 100644
--- a/shared/src/i18n/th/mobileNav.ts
+++ b/shared/src/i18n/th/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'สถานที่ที่บันทึกไว้',
'mobileNav.more': 'เพิ่มเติม',
'mobileNav.navigation': 'การนำทาง',
+ 'mobileNav.railSettings': 'การตั้งค่า',
+ 'mobileNav.railAdmin': 'ผู้ดูแลระบบ',
+ 'mobileNav.railCollections': 'คอลเลกชัน',
};
export default mobileNav;
diff --git a/shared/src/i18n/tr/mobileNav.ts b/shared/src/i18n/tr/mobileNav.ts
index 14556301b..594cd8af3 100644
--- a/shared/src/i18n/tr/mobileNav.ts
+++ b/shared/src/i18n/tr/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Kaydedilen yerler',
'mobileNav.more': 'Daha fazla',
'mobileNav.navigation': 'Gezinme',
+ 'mobileNav.railSettings': 'Ayarlar',
+ 'mobileNav.railAdmin': 'Yönetici',
+ 'mobileNav.railCollections': 'Koleksiyonlar',
};
export default mobileNav;
diff --git a/shared/src/i18n/uk/mobileNav.ts b/shared/src/i18n/uk/mobileNav.ts
index b08a77b3f..1c057eec7 100644
--- a/shared/src/i18n/uk/mobileNav.ts
+++ b/shared/src/i18n/uk/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Збережені місця',
'mobileNav.more': 'Більше',
'mobileNav.navigation': 'Навігація',
+ 'mobileNav.railSettings': 'Налаштування',
+ 'mobileNav.railAdmin': 'Адмін',
+ 'mobileNav.railCollections': 'Колекції',
};
export default mobileNav;
diff --git a/shared/src/i18n/vi/mobileNav.ts b/shared/src/i18n/vi/mobileNav.ts
index d76e92ddd..a3bead51e 100644
--- a/shared/src/i18n/vi/mobileNav.ts
+++ b/shared/src/i18n/vi/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': 'Địa điểm đã lưu',
'mobileNav.more': 'Thêm',
'mobileNav.navigation': 'Điều hướng',
+ 'mobileNav.railSettings': 'Cài đặt',
+ 'mobileNav.railAdmin': 'Quản trị',
+ 'mobileNav.railCollections': 'Bộ sưu tập',
};
export default mobileNav;
diff --git a/shared/src/i18n/zh-TW/mobileNav.ts b/shared/src/i18n/zh-TW/mobileNav.ts
index 6873db6ef..a3dc26296 100644
--- a/shared/src/i18n/zh-TW/mobileNav.ts
+++ b/shared/src/i18n/zh-TW/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': '已儲存的地點',
'mobileNav.more': '更多',
'mobileNav.navigation': '導覽',
+ 'mobileNav.railSettings': '設定',
+ 'mobileNav.railAdmin': '管理',
+ 'mobileNav.railCollections': '收藏',
};
export default mobileNav;
diff --git a/shared/src/i18n/zh/mobileNav.ts b/shared/src/i18n/zh/mobileNav.ts
index bb8b9796c..55dbeffc6 100644
--- a/shared/src/i18n/zh/mobileNav.ts
+++ b/shared/src/i18n/zh/mobileNav.ts
@@ -5,6 +5,9 @@ const mobileNav: TranslationStrings = {
'mobileNav.collectionsSub': '已保存的地点',
'mobileNav.more': '更多',
'mobileNav.navigation': '导航',
+ 'mobileNav.railSettings': '设置',
+ 'mobileNav.railAdmin': '管理',
+ 'mobileNav.railCollections': '收藏',
};
export default mobileNav;