release notes: the 5.1.0 popup, and dataforest cloud in Settings > About

The release popup now shows 5.1.0: place search, shared place details
and faster routing as three cards side by side, each with its own
drawing. The support band is set as a card like the promise above it
(optional supportLabelKey; a release without it keeps the plain line),
and the two support buttons get the same glass look in their colours.

Settings > About gets a full-width panel for dataforest cloud, who
sponsor the servers behind place search, address search and routing.
Both logos ship in client/public/brands, so opening Settings reaches no
third party. Wherever a line names dataforest cloud it links to
https://cloud.dataforest.net/?mtm_campaign=trek, the link dataforest
gave us; the README moves to it too.

All 28 locales carry the new copy, and the old 5.0 card keys are gone.
This commit is contained in:
Maurice
2026-10-31 11:04:19 +01:00
parent f4e524f3c3
commit def8b8a24d
71 changed files with 1636 additions and 692 deletions
@@ -60,7 +60,8 @@ describe('AboutTab', () => {
it('FE-COMP-ABOUT-009: all external links have rel="noopener noreferrer"', () => {
render(<AboutTab appVersion="2.9.10" />);
const links = document.querySelectorAll('a');
expect(links).toHaveLength(6);
// Six tiles, and the sponsor panel: its logo, its button and the name in its title and body.
expect(links).toHaveLength(10);
links.forEach((link) => {
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
});
@@ -130,4 +131,24 @@ describe('AboutTab', () => {
expect(link.style.borderColor).toBe('');
expect(link.style.boxShadow).toBe('');
});
it('FE-COMP-ABOUT-018: the sponsor panel links dataforest cloud wherever it is named, with both logos bundled', () => {
render(<AboutTab appVersion="1.0.0" />);
const links = document.querySelectorAll('a[href="https://cloud.dataforest.net/?mtm_campaign=trek"]');
// The logo tile, the call to action, and the brand name in the title and in the body.
expect(links).toHaveLength(4);
for (const link of links) {
expect(link).toHaveAttribute('target', '_blank');
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
}
const logos = [...document.querySelectorAll('img')].map((img) => img.getAttribute('src'));
expect(logos).toEqual(
expect.arrayContaining(['/brands/dataforest-cloud.svg', '/brands/dataforest-cloud-dark.svg'])
);
// Served by TREK itself: opening Settings must not reach a third party.
expect(logos.every((src) => src?.startsWith('/'))).toBe(true);
expect(screen.getByText('Place search')).toBeInTheDocument();
expect(screen.getByText('Address search')).toBeInTheDocument();
expect(screen.getByText('Routing')).toBeInTheDocument();
});
});
+150 -11
View File
@@ -1,16 +1,30 @@
import { BookOpen, Bug, Coffee, ExternalLink, Github, Heart, Info, Lightbulb } from 'lucide-react';
import {
ArrowUpRight,
BookOpen,
Bug,
Coffee,
ExternalLink,
Github,
Heart,
Info,
Lightbulb,
MapPin,
Route,
Search,
} from 'lucide-react';
import React, { type CSSProperties, type ReactNode } from 'react';
import { useTranslation } from '../../i18n';
import { useAuthStore } from '../../store/authStore';
import { fs } from '../shared/DialogShell';
import Section from './Section';
import { StatusPill } from './settingsKit';
import { fs } from '../shared/DialogShell';
import { useAuthStore } from '../../store/authStore';
interface Props {
appVersion: string;
}
const DISCORD_PATH = 'M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z';
const DISCORD_PATH =
'M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z';
// The services' own colours: each tile takes its brand on hover and in its icon square.
const BRAND = {
@@ -27,7 +41,8 @@ const SIGNAL = {
} as const;
/** Tile chrome that reads the tile's colour from `--tile`: the border and a faint ring on hover. */
const TILE_HOVER = 'hover:border-[color:var(--tile)] hover:shadow-[0_0_0_1px_color-mix(in_srgb,var(--tile)_14%,transparent)]';
const TILE_HOVER =
'hover:border-[color:var(--tile)] hover:shadow-[0_0_0_1px_color-mix(in_srgb,var(--tile)_14%,transparent)]';
/** The icon square in the tile's colour. */
const TILE_ICON = 'bg-[color-mix(in_srgb,var(--tile)_12%,transparent)] text-[color:var(--tile)]';
@@ -36,7 +51,13 @@ const TILE_ICON = 'bg-[color-mix(in_srgb,var(--tile)_12%,transparent)] text-[col
* external-link mark on the right. The border picks up the tile's colour while
* the pointer is on it.
*/
function LinkTile({ href, color, icon, title, hint }: {
function LinkTile({
href,
color,
icon,
title,
hint,
}: {
href: string;
/** A brand colour or a theme token, handed to the classes as `--tile`. */
color?: string;
@@ -53,19 +74,133 @@ function LinkTile({ href, color, icon, title, hint }: {
style={color ? ({ '--tile': color } as CSSProperties) : undefined}
>
{icon && (
<span className={`grid h-10 w-10 flex-none place-items-center rounded-[12px] ${color ? TILE_ICON : 'bg-surface-tertiary text-content-secondary'}`}>
<span
className={`grid h-10 w-10 flex-none place-items-center rounded-[12px] ${color ? TILE_ICON : 'bg-surface-tertiary text-content-secondary'}`}
>
{icon}
</span>
)}
<div className="min-w-0 flex-1">
<div className="truncate font-semibold text-content" style={fs(13, 'body')}>{title}</div>
<div className="truncate text-content-faint" style={fs(11.5)}>{hint}</div>
<div className="truncate font-semibold text-content" style={fs(13, 'body')}>
{title}
</div>
<div className="truncate text-content-faint" style={fs(11.5)}>
{hint}
</div>
</div>
<ExternalLink size={14} className="flex-none text-content-faint" />
</a>
);
}
const DATAFOREST_HREF = 'https://cloud.dataforest.net/?mtm_campaign=trek';
const DATAFOREST_NAME = 'dataforest cloud';
const DATAFOREST = '#02C382'; // theme-lint-disable: brand colour (dataforest cloud)
/** The sponsor's name, linked wherever a line names it: it is a brand and reads the same in every language. */
function withDataforestLink(text: string): ReactNode {
const parts = text.split(DATAFOREST_NAME);
if (parts.length === 1) return text;
return parts.flatMap((part, i) =>
i === 0
? [part]
: [
<a
key={i}
href={DATAFOREST_HREF}
target="_blank"
rel="noopener noreferrer"
className="text-[color:var(--df)] no-underline hover:underline"
>
{DATAFOREST_NAME}
</a>,
part,
]
);
}
/**
* The sponsor of TREK's own servers, across the whole section: what runs there
* and a way to visit them. The logo ships with TREK, so opening Settings sends
* nothing to a third party.
*/
function DataforestBanner() {
const { t } = useTranslation();
const services = [
{ icon: <MapPin size={12} />, label: t('settings.about.sponsor.search') },
{ icon: <Search size={12} />, label: t('settings.about.sponsor.address') },
{ icon: <Route size={12} />, label: t('settings.about.sponsor.routing') },
];
return (
<div
className="relative overflow-hidden rounded-[18px] border border-[color:color-mix(in_srgb,var(--df)_28%,var(--border-primary))] bg-surface-card shadow-sm"
style={{ '--df': DATAFOREST } as CSSProperties}
>
{/* The glow and the faint grid: a server room seen from far away, in the sponsor's green. */}
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 bg-[radial-gradient(70%_120%_at_0%_0%,color-mix(in_srgb,var(--df)_16%,transparent)_0%,transparent_60%),radial-gradient(50%_90%_at_100%_100%,color-mix(in_srgb,var(--df)_10%,transparent)_0%,transparent_70%)]"
/>
<div
aria-hidden="true"
className="pointer-events-none absolute inset-0 opacity-[0.35] [background-image:radial-gradient(color-mix(in_srgb,var(--df)_35%,transparent)_1px,transparent_1px)] [background-size:16px_16px] [mask-image:linear-gradient(90deg,transparent_0%,#000_55%,#000_100%)]"
/>
<div className="relative flex flex-col gap-5 p-5 md:flex-row md:items-center">
{/* The sponsor's own logo, one for each theme, served from TREK itself. */}
<a
href={DATAFOREST_HREF}
target="_blank"
rel="noopener noreferrer"
aria-label={DATAFOREST_NAME}
className="flex h-[76px] w-full flex-none items-center justify-center rounded-[16px] bg-[color-mix(in_srgb,var(--df)_7%,var(--bg-card))] px-5 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--df)_26%,transparent)] transition-shadow duration-200 hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--df)_55%,transparent)] md:w-[220px]"
>
<img src="/brands/dataforest-cloud.svg" alt="" className="h-7 w-auto dark:hidden" />
<img src="/brands/dataforest-cloud-dark.svg" alt="" className="hidden h-7 w-auto dark:block" />
</a>
<div className="min-w-0 flex-1">
<div className="font-bold uppercase tracking-[.12em] text-[color:var(--df)]" style={fs(10.5)}>
{t('settings.about.sponsor.eyebrow')}
</div>
<div className="mt-1 font-semibold text-content" style={fs(16, 'subtitle')}>
{withDataforestLink(t('settings.about.sponsor.title'))}
</div>
<p className="m-0 mt-1 leading-relaxed text-content-secondary" style={fs(12.5, 'body')}>
{withDataforestLink(t('settings.about.sponsor.body'))}
</p>
<div className="mt-3 flex flex-wrap gap-2">
{services.map((s) => (
<span
key={s.label}
className="inline-flex items-center gap-1.5 rounded-full border border-edge bg-surface-secondary px-2.5 py-1 font-medium text-content-secondary"
style={fs(11.5)}
>
<span className="text-[color:var(--df)]">{s.icon}</span>
{s.label}
</span>
))}
</div>
</div>
<a
href={DATAFOREST_HREF}
target="_blank"
rel="noopener noreferrer"
className="group inline-flex flex-none items-center gap-2 self-start rounded-full bg-[color:var(--df)] px-4 py-2.5 font-semibold text-[#04150e] no-underline shadow-[0_8px_20px_-10px_var(--df)] transition-[filter,transform] duration-200 hover:-translate-y-px hover:brightness-105 md:self-center" // theme-lint-disable: ink on the sponsor's green
style={fs(13, 'body')}
>
{t('settings.about.sponsor.cta')}
<ArrowUpRight
size={15}
className="transition-transform duration-200 group-hover:-translate-y-px group-hover:translate-x-px"
/>
</a>
</div>
</div>
);
}
export default function AboutTab({ appVersion }: Props): React.ReactElement {
const { t } = useTranslation();
const managed = useAuthStore((s) => s.managed);
@@ -124,11 +259,11 @@ export default function AboutTab({ appVersion }: Props): React.ReactElement {
<LinkTile
href="https://discord.gg/NhZBDSd4qW"
color={BRAND.discord}
icon={(
icon={
<svg width="19" height="19" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d={DISCORD_PATH} />
</svg>
)}
}
title="Discord"
hint="Join the community"
/>
@@ -156,6 +291,10 @@ export default function AboutTab({ appVersion }: Props): React.ReactElement {
</div>
)}
{/* TREK's own servers, and who sponsors them. It asks nothing of the reader, so
a hosted instance shows it too. */}
<DataforestBanner />
{/* What replaces the grids above. AGPL §13 asks for the source to be
offered prominently to whoever uses the software over a network, and a
customer of a hosted instance is exactly that reader. The support and
@@ -1,9 +1,9 @@
// FE-RN-001 to FE-RN-016
import { describe, it, expect, vi } from 'vitest'
import { render, screen } from '../../../tests/helpers/render'
import userEvent from '@testing-library/user-event'
import { ReleaseNoticeModal } from './ReleaseNoticeModal'
import type { SystemNoticeDTO } from '../../store/systemNoticeStore'
// FE-RN-001 to FE-RN-020
import userEvent from '@testing-library/user-event';
import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '../../../tests/helpers/render';
import type { SystemNoticeDTO } from '../../store/systemNoticeStore';
import { ReleaseNoticeModal } from './ReleaseNoticeModal';
/** A notice shaped like the release-notes registry entry, with the pieces a test needs to vary. */
function releaseNotice(overrides: Partial<SystemNoticeDTO> = {}): SystemNoticeDTO {
@@ -42,182 +42,239 @@ function releaseNotice(overrides: Partial<SystemNoticeDTO> = {}): SystemNoticeDT
supportTextKey: 'rel.support',
},
...overrides,
} as SystemNoticeDTO
} as SystemNoticeDTO;
}
function renderModal(notice = releaseNotice(), handlers: Partial<{
onDismiss: () => void; onCTA: () => void; onSecondaryCTA: () => void
}> = {}) {
const onDismiss = handlers.onDismiss ?? vi.fn()
const onCTA = handlers.onCTA ?? vi.fn()
const onSecondaryCTA = handlers.onSecondaryCTA ?? vi.fn()
function renderModal(
notice = releaseNotice(),
handlers: Partial<{
onDismiss: () => void;
onCTA: () => void;
onSecondaryCTA: () => void;
}> = {}
) {
const onDismiss = handlers.onDismiss ?? vi.fn();
const onCTA = handlers.onCTA ?? vi.fn();
const onSecondaryCTA = handlers.onSecondaryCTA ?? vi.fn();
const view = render(
<ReleaseNoticeModal
notice={notice}
visible
onDismiss={onDismiss}
onCTA={onCTA}
onSecondaryCTA={onSecondaryCTA}
/>
)
return { ...view, onDismiss, onCTA, onSecondaryCTA }
<ReleaseNoticeModal notice={notice} visible onDismiss={onDismiss} onCTA={onCTA} onSecondaryCTA={onSecondaryCTA} />
);
return { ...view, onDismiss, onCTA, onSecondaryCTA };
}
describe('ReleaseNoticeModal', () => {
it('FE-RN-001: renders nothing for a notice without a release block', () => {
const { container } = renderModal(releaseNotice({ release: undefined }))
expect(container.querySelector('.rn-overlay')).toBeNull()
})
const { container } = renderModal(releaseNotice({ release: undefined }));
expect(container.querySelector('.rn-overlay')).toBeNull();
});
it('FE-RN-002: shows the version as a plain figure, not a translation key', () => {
renderModal()
expect(screen.getByText('4.3.0')).toBeInTheDocument()
})
renderModal();
expect(screen.getByText('4.3.0')).toBeInTheDocument();
});
it('FE-RN-003: renders one card per feature, each with its drawing', () => {
renderModal()
expect(screen.getByText('rel.f1.title')).toBeInTheDocument()
expect(document.querySelectorAll('.rn-feature')).toHaveLength(3)
expect(document.querySelector('.rn-vis-tours')).not.toBeNull()
expect(document.querySelector('.rn-vis-studio')).not.toBeNull()
expect(document.querySelector('.rn-vis-assist')).not.toBeNull()
})
renderModal();
expect(screen.getByText('rel.f1.title')).toBeInTheDocument();
expect(document.querySelectorAll('.rn-feature')).toHaveLength(3);
expect(document.querySelector('.rn-vis-tours')).not.toBeNull();
expect(document.querySelector('.rn-vis-studio')).not.toBeNull();
expect(document.querySelector('.rn-vis-assist')).not.toBeNull();
});
it('FE-RN-004: splits the note body on the blank line into separate paragraphs', () => {
const n = releaseNotice()
const n = releaseNotice();
// The translation stub echoes the key, so drive the split through a real value.
n.release!.note.bodyKey = 'first paragraph\n\nsecond paragraph'
renderModal(n)
expect(screen.getByText('first paragraph')).toBeInTheDocument()
expect(screen.getByText('second paragraph')).toBeInTheDocument()
})
n.release!.note.bodyKey = 'first paragraph\n\nsecond paragraph';
renderModal(n);
expect(screen.getByText('first paragraph')).toBeInTheDocument();
expect(screen.getByText('second paragraph')).toBeInTheDocument();
});
it('FE-RN-005: omits the foot when the release has neither a footnote nor notes', () => {
renderModal()
expect(document.querySelector('.rn-release-foot')).toBeNull()
})
renderModal();
expect(document.querySelector('.rn-release-foot')).toBeNull();
});
it('FE-RN-006: shows the footnote and the notes link when both are present', () => {
const n = releaseNotice()
n.release!.footnoteKey = 'rel.footnote'
n.release!.notes = { labelKey: 'rel.notes', href: 'https://example.test/notes' }
renderModal(n)
expect(screen.getByText('rel.footnote')).toBeInTheDocument()
const link = screen.getByRole('link', { name: /rel\.notes/ })
expect(link).toHaveAttribute('href', 'https://example.test/notes')
expect(link).toHaveAttribute('target', '_blank')
expect(link).toHaveAttribute('rel', 'noopener noreferrer')
})
const n = releaseNotice();
n.release!.footnoteKey = 'rel.footnote';
n.release!.notes = { labelKey: 'rel.notes', href: 'https://example.test/notes' };
renderModal(n);
expect(screen.getByText('rel.footnote')).toBeInTheDocument();
const link = screen.getByRole('link', { name: /rel\.notes/ });
expect(link).toHaveAttribute('href', 'https://example.test/notes');
expect(link).toHaveAttribute('target', '_blank');
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
});
it('FE-RN-007: dismisses from the close button and from the backdrop', async () => {
const user = userEvent.setup()
const onDismiss = vi.fn()
renderModal(releaseNotice(), { onDismiss })
const user = userEvent.setup();
const onDismiss = vi.fn();
renderModal(releaseNotice(), { onDismiss });
await user.click(screen.getByRole('button', { name: 'Close' }))
expect(onDismiss).toHaveBeenCalledTimes(1)
await user.click(screen.getByRole('button', { name: 'Close' }));
expect(onDismiss).toHaveBeenCalledTimes(1);
await user.click(document.querySelector('.rn-overlay')!)
expect(onDismiss).toHaveBeenCalledTimes(2)
})
await user.click(document.querySelector('.rn-overlay')!);
expect(onDismiss).toHaveBeenCalledTimes(2);
});
it('FE-RN-008: a click inside the panel does not dismiss', async () => {
const user = userEvent.setup()
const onDismiss = vi.fn()
renderModal(releaseNotice(), { onDismiss })
await user.click(screen.getByText('rel.note.title'))
expect(onDismiss).not.toHaveBeenCalled()
})
const user = userEvent.setup();
const onDismiss = vi.fn();
renderModal(releaseNotice(), { onDismiss });
await user.click(screen.getByText('rel.note.title'));
expect(onDismiss).not.toHaveBeenCalled();
});
it('FE-RN-009: a non-dismissible notice has no close button and an inert backdrop', async () => {
const user = userEvent.setup()
const onDismiss = vi.fn()
renderModal(releaseNotice({ dismissible: false }), { onDismiss })
expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
await user.click(document.querySelector('.rn-overlay')!)
expect(onDismiss).not.toHaveBeenCalled()
})
const user = userEvent.setup();
const onDismiss = vi.fn();
renderModal(releaseNotice({ dismissible: false }), { onDismiss });
expect(screen.queryByRole('button', { name: 'Close' })).toBeNull();
await user.click(document.querySelector('.rn-overlay')!);
expect(onDismiss).not.toHaveBeenCalled();
});
it('FE-RN-010: wires each support button to its own handler', async () => {
const user = userEvent.setup()
const onCTA = vi.fn()
const onSecondaryCTA = vi.fn()
renderModal(releaseNotice(), { onCTA, onSecondaryCTA })
const user = userEvent.setup();
const onCTA = vi.fn();
const onSecondaryCTA = vi.fn();
renderModal(releaseNotice(), { onCTA, onSecondaryCTA });
await user.click(screen.getByRole('button', { name: /rel\.bmc/ }))
expect(onCTA).toHaveBeenCalledTimes(1)
expect(onSecondaryCTA).not.toHaveBeenCalled()
await user.click(screen.getByRole('button', { name: /rel\.bmc/ }));
expect(onCTA).toHaveBeenCalledTimes(1);
expect(onSecondaryCTA).not.toHaveBeenCalled();
await user.click(screen.getByRole('button', { name: /rel\.kofi/ }))
expect(onSecondaryCTA).toHaveBeenCalledTimes(1)
})
await user.click(screen.getByRole('button', { name: /rel\.kofi/ }));
expect(onSecondaryCTA).toHaveBeenCalledTimes(1);
});
it('FE-RN-011: labels the dialog with the headline and describes it with the intro', () => {
renderModal()
const dialog = screen.getByRole('dialog')
expect(dialog).toHaveAttribute('aria-modal', 'true')
expect(dialog).toHaveAttribute('aria-labelledby', 'notice-title-release-notes')
expect(dialog).toHaveAttribute('aria-describedby', 'notice-body-release-notes')
expect(document.getElementById('notice-title-release-notes')).toHaveTextContent('rel.headline')
expect(document.getElementById('notice-body-release-notes')).toHaveTextContent('rel.intro')
})
renderModal();
const dialog = screen.getByRole('dialog');
expect(dialog).toHaveAttribute('aria-modal', 'true');
expect(dialog).toHaveAttribute('aria-labelledby', 'notice-title-release-notes');
expect(dialog).toHaveAttribute('aria-describedby', 'notice-body-release-notes');
expect(document.getElementById('notice-title-release-notes')).toHaveTextContent('rel.headline');
expect(document.getElementById('notice-body-release-notes')).toHaveTextContent('rel.intro');
});
it('FE-RN-012: sets the promise and the support text with a bold lead', () => {
renderModal()
expect(screen.getByText('rel.promise.lead').tagName).toBe('B')
expect(screen.getByText('rel.support.lead').tagName).toBe('B')
expect(screen.getByText('rel.promise.text')).toBeInTheDocument()
})
renderModal();
expect(screen.getByText('rel.promise.lead').tagName).toBe('B');
expect(screen.getByText('rel.support.lead').tagName).toBe('B');
expect(screen.getByText('rel.promise.text')).toBeInTheDocument();
});
it('FE-RN-013: the features aside is optional', () => {
renderModal()
expect(document.querySelector('.rn-features-aside')).toBeNull()
renderModal();
expect(document.querySelector('.rn-features-aside')).toBeNull();
const n = releaseNotice()
n.release!.featuresAsideKey = 'rel.features.aside'
renderModal(n)
expect(screen.getByText('rel.features.aside')).toBeInTheDocument()
})
const n = releaseNotice();
n.release!.featuresAsideKey = 'rel.features.aside';
renderModal(n);
expect(screen.getByText('rel.features.aside')).toBeInTheDocument();
});
it('FE-RN-014: a card whose drawing this client does not know falls back to its icon', () => {
const n = releaseNotice()
const n = releaseNotice();
n.release!.features = [
{ iconName: 'Route', visual: 'from-a-newer-server', titleKey: 'rel.x.title', bodyKey: 'rel.x.body' },
{ iconName: 'NoSuchIcon', titleKey: 'rel.y.title', bodyKey: 'rel.y.body' },
]
renderModal(n)
expect(document.querySelectorAll('.rn-vis-icon')).toHaveLength(2)
expect(document.querySelectorAll('.rn-vis-icon svg')).toHaveLength(2)
})
];
renderModal(n);
expect(document.querySelectorAll('.rn-vis-icon')).toHaveLength(2);
expect(document.querySelectorAll('.rn-vis-icon svg')).toHaveLength(2);
});
it('FE-RN-015: a wide card spans the row with its drawing beside the text, the others stay upright', () => {
const n = releaseNotice()
const n = releaseNotice();
n.release!.features = [
...n.release!.features,
{ iconName: 'LifeBuoy', visual: 'help', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' },
]
renderModal(n)
const cards = document.querySelectorAll('.rn-feature')
expect(cards).toHaveLength(4)
expect(cards[3].classList.contains('rn-feature-wide')).toBe(true)
expect([...cards].slice(0, 3).some(c => c.classList.contains('rn-feature-wide'))).toBe(false)
];
renderModal(n);
const cards = document.querySelectorAll('.rn-feature');
expect(cards).toHaveLength(4);
expect(cards[3].classList.contains('rn-feature-wide')).toBe(true);
expect([...cards].slice(0, 3).some((c) => c.classList.contains('rn-feature-wide'))).toBe(false);
// The help drawing: the help button and two rows of greetings, each written twice to loop.
const wide = cards[3]
expect(wide.querySelector('.rn-vis-help-q')).not.toBeNull()
expect(wide.querySelectorAll('.rn-vis-hello-row')).toHaveLength(2)
expect(wide.querySelectorAll('.rn-vis-hello').length % 2).toBe(0)
const wide = cards[3];
expect(wide.querySelector('.rn-vis-help-q')).not.toBeNull();
expect(wide.querySelectorAll('.rn-vis-hello-row')).toHaveLength(2);
expect(wide.querySelectorAll('.rn-vis-hello').length % 2).toBe(0);
// The tours card lists the kinds of tour along its foot.
expect(cards[0].querySelectorAll('.rn-vis-tours-kind')).toHaveLength(5)
})
expect(cards[0].querySelectorAll('.rn-vis-tours-kind')).toHaveLength(5);
});
it('FE-RN-016: the close button belongs to the panel, not the note', () => {
// Below 1080px the panel scrolls and the note is its second screen, so the
// stylesheet sticks the button to the panel's own top edge. That only works
// while it is a child of .rn-panel; put it back in the note and it scrolls a
// whole release half out of reach with every CSS assertion still green.
renderModal(releaseNotice())
const close = screen.getByRole('button', { name: 'Close' })
expect(close.parentElement?.classList.contains('rn-panel')).toBe(true)
expect(close.closest('.rn-note')).toBeNull()
})
})
renderModal(releaseNotice());
const close = screen.getByRole('button', { name: 'Close' });
expect(close.parentElement?.classList.contains('rn-panel')).toBe(true);
expect(close.closest('.rn-note')).toBeNull();
});
it('FE-RN-017: links the sponsor wherever a line names it, and leaves other lines plain', () => {
const n = releaseNotice();
// The translation stub echoes the key, so the lines carry the brand name as their value.
n.release!.introKey = 'Our servers, sponsored by dataforest cloud, and more.';
n.release!.supportTextKey = 'Thanks to dataforest cloud today.';
renderModal(n);
const links = screen.getAllByRole('link', { name: 'dataforest cloud' });
expect(links).toHaveLength(2);
for (const link of links) {
expect(link).toHaveAttribute('href', 'https://cloud.dataforest.net/?mtm_campaign=trek');
expect(link).toHaveAttribute('target', '_blank');
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
}
expect(document.getElementById('notice-body-release-notes')).toHaveTextContent(
'Our servers, sponsored by dataforest cloud, and more.'
);
expect(screen.getByText('rel.promise.text').querySelector('a')).toBeNull();
});
it('FE-RN-018: with a support label the ask is set as a card like the promise', () => {
const n = releaseNotice();
n.release!.supportLabelKey = 'rel.support.label';
renderModal(n);
const card = document.querySelector('.rn-support .rn-support-card');
expect(card).not.toBeNull();
expect(card!.classList.contains('rn-promise')).toBe(true);
expect(card!.querySelector('.rn-promise-label')).toHaveTextContent('rel.support.label');
expect(screen.getByText('rel.support.lead').tagName).toBe('B');
expect(document.querySelector('.rn-support-text')).toBeNull();
});
it('FE-RN-019: without a support label the ask stays a plain line', () => {
renderModal();
expect(document.querySelector('.rn-support-card')).toBeNull();
expect(document.querySelector('.rn-support-text')).toHaveTextContent('rel.support.lead');
});
it('FE-RN-020: draws the search, sharing and routing cards', () => {
const n = releaseNotice();
n.release!.features = [
{ iconName: 'Search', visual: 'search', titleKey: 'rel.s.title', bodyKey: 'rel.s.body' },
{ iconName: 'Share2', visual: 'share', titleKey: 'rel.sh.title', bodyKey: 'rel.sh.body' },
{ iconName: 'Route', visual: 'routing', titleKey: 'rel.r.title', bodyKey: 'rel.r.body' },
];
renderModal(n);
expect(document.querySelectorAll('.rn-vis-icon')).toHaveLength(0);
// The right place on top: the first result is the highlighted one.
const rows = document.querySelectorAll('.rn-vis-search-row');
expect(rows).toHaveLength(3);
expect(rows[0].classList.contains('rn-vis-search-row-top')).toBe(true);
// One place's details going out to three other TREKs.
expect(document.querySelectorAll('.rn-vis-share-field')).toHaveLength(4);
expect(document.querySelectorAll('.rn-vis-share-node')).toHaveLength(3);
// A day's five stops on one drawn route.
expect(document.querySelectorAll('.rn-vis-route-stop')).toHaveLength(5);
expect(document.querySelector('.rn-vis-route-line')).not.toBeNull();
});
});
@@ -1,5 +1,5 @@
import { ArrowRight, Heart, Infinity as InfinityIcon, ShieldCheck, X } from 'lucide-react';
import React from 'react';
import { ArrowRight, Heart, Infinity as InfinityIcon, X } from 'lucide-react';
import { useTranslation } from '../../i18n/TranslationContext.js';
import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js';
import { ReleaseFeatureVisual } from './ReleaseNoticeVisuals.js';
@@ -16,8 +16,18 @@ interface Props {
/** Lucide's coffee cup, drawn here so its three steam strokes can drift up in waves. */
function SteamingCoffee() {
return (
<svg className="rn-coffee" width={18} height={18} viewBox="0 0 24 24" fill="none" stroke="currentColor"
strokeWidth={2.1} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<svg
className="rn-coffee"
width={18}
height={18}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2.1}
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d="M17 8h1a4 4 0 1 1 0 8h-1" />
<path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z" />
<path className="rn-steam" d="M6 5.5c-1.2-.9 1.2-1.7 0-2.6s1.2-1.7 0-2.6 1.2-1.7 0-2.6" />
@@ -27,9 +37,31 @@ function SteamingCoffee() {
);
}
const SPONSOR = 'dataforest cloud';
const SPONSOR_HREF = 'https://cloud.dataforest.net/?mtm_campaign=trek';
/** The sponsor's name is a brand and reads the same in every language, so wherever a line names it, it links. */
function withSponsorLink(text: string): React.ReactNode {
const parts = text.split(SPONSOR);
if (parts.length === 1) return text;
return parts.flatMap((part, i) =>
i === 0
? [part]
: [
<a key={i} className="rn-sponsor" href={SPONSOR_HREF} target="_blank" rel="noopener noreferrer">
{SPONSOR}
</a>,
part,
]
);
}
/** Splits a translated block into paragraphs the way the notice bodies are written. */
function paragraphs(text: string): string[] {
return text.split('\n\n').map(p => p.trim()).filter(Boolean);
return text
.split('\n\n')
.map((p) => p.trim())
.filter(Boolean);
}
/**
@@ -55,15 +87,15 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
className="rn-overlay"
role="presentation"
style={{ opacity: visible ? 1 : 0, transition: 'opacity 260ms ease' }}
onClick={notice.dismissible ? e => { if (e.target === e.currentTarget) onDismiss() } : undefined}
onClick={
notice.dismissible
? (e) => {
if (e.target === e.currentTarget) onDismiss();
}
: undefined
}
>
<div
role="dialog"
aria-modal="true"
aria-labelledby={titleId}
aria-describedby={bodyId}
className="rn-panel"
>
<div role="dialog" aria-modal="true" aria-labelledby={titleId} aria-describedby={bodyId} className="rn-panel">
{/* A child of the panel, not the note: stacked, the panel scrolls and the
note is its second screen, so the button sticks to the panel's edge. */}
{notice.dismissible && (
@@ -86,19 +118,21 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
<div className="rn-version">{release.version}</div>
<h2 id={titleId} className="rn-headline">{t(release.headlineKey)}</h2>
<p id={bodyId} className="rn-intro">{t(release.introKey)}</p>
<h2 id={titleId} className="rn-headline">
{t(release.headlineKey)}
</h2>
<p id={bodyId} className="rn-intro">
{withSponsorLink(t(release.introKey))}
</p>
<div className="rn-features-head">
<span className="rn-features-label">{t(release.featuresLabelKey)}</span>
<span className="rn-features-rule" aria-hidden="true" />
{release.featuresAsideKey && (
<span className="rn-features-aside">{t(release.featuresAsideKey)}</span>
)}
{release.featuresAsideKey && <span className="rn-features-aside">{t(release.featuresAsideKey)}</span>}
</div>
<div className="rn-features">
{release.features.map(f => (
{release.features.map((f) => (
<div key={f.titleKey} className={f.layout === 'wide' ? 'rn-feature rn-feature-wide' : 'rn-feature'}>
<div className="rn-feature-shine" aria-hidden="true" />
<div className="rn-feature-visual" aria-hidden="true">
@@ -116,12 +150,7 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
<div className="rn-release-foot">
<div className="rn-footnote">{release.footnoteKey ? t(release.footnoteKey) : null}</div>
{release.notes && (
<a
className="rn-notes"
href={release.notes.href}
target="_blank"
rel="noopener noreferrer"
>
<a className="rn-notes" href={release.notes.href} target="_blank" rel="noopener noreferrer">
{t(release.notes.labelKey)}
<span className="rn-notes-arrow">
<ArrowRight size={16} strokeWidth={2.4} aria-hidden="true" />
@@ -139,7 +168,9 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
<div className="rn-note-eyebrow">{t(release.note.eyebrowKey)}</div>
<h3 className="rn-note-title">{t(release.note.titleKey)}</h3>
{paragraphs(t(release.note.bodyKey)).map((p, i) => <p key={i}>{p}</p>)}
{paragraphs(t(release.note.bodyKey)).map((p, i) => (
<p key={i}>{p}</p>
))}
<div className="rn-promise">
<div className="rn-promise-label">
@@ -147,23 +178,39 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
{t(release.note.promiseLabelKey)}
</div>
<div className="rn-promise-text">
<b>{t(release.note.promiseLeadKey)}</b>{' '}
<span>{t(release.note.promiseTextKey)}</span>
<b>{t(release.note.promiseLeadKey)}</b> <span>{t(release.note.promiseTextKey)}</span>
</div>
</div>
{paragraphs(t(release.note.bodyAfterKey)).map((p, i) => <p key={i}>{p}</p>)}
{paragraphs(t(release.note.bodyAfterKey)).map((p, i) => (
<p key={i}>{p}</p>
))}
<div className="rn-closing">{t(release.note.closingKey)}</div>
</div>
<div className="rn-support">
<div className="rn-support-text">
<b>{t(release.supportLeadKey)}</b> {t(release.supportTextKey)}
</div>
{release.supportLabelKey ? (
// Set like the promise above it, so the ask reads as the same kind of statement.
<div className="rn-promise rn-support-card">
<div className="rn-promise-label">
<ShieldCheck size={14} strokeWidth={2.1} aria-hidden="true" />
{t(release.supportLabelKey)}
</div>
<div className="rn-promise-text">
<b>{withSponsorLink(t(release.supportLeadKey))}</b>{' '}
<span>{withSponsorLink(t(release.supportTextKey))}</span>
</div>
</div>
) : (
<div className="rn-support-text">
<b>{withSponsorLink(t(release.supportLeadKey))}</b> {withSponsorLink(t(release.supportTextKey))}
</div>
)}
<div className="rn-support-buttons">
{notice.cta && (
<button type="button"
<button
type="button"
id={`notice-cta-${notice.id}`}
className="rn-support-btn rn-support-bmc"
onClick={onCTA}
@@ -173,7 +220,8 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
</button>
)}
{notice.secondaryCta && (
<button type="button"
<button
type="button"
id={`notice-cta2-${notice.id}`}
className="rn-support-btn rn-support-kofi"
onClick={onSecondaryCTA}
@@ -1,6 +1,25 @@
import React from 'react';
import * as LucideIcons from 'lucide-react';
import { Bike, Check, Footprints, Landmark, Plane, Sailboat, Snowflake, Sparkles, Star, TrendingUp } from 'lucide-react';
import {
Bike,
Check,
Clock,
Coffee,
Footprints,
Globe,
Image as ImageIcon,
Landmark,
MapPin,
Phone,
Plane,
Sailboat,
Search,
Snowflake,
Sparkles,
Star,
TrendingUp,
Zap,
} from 'lucide-react';
import React from 'react';
import './releaseNoticeVisuals.css';
/*
@@ -127,8 +146,35 @@ function AssistantVisual() {
// ── Help on every screen, in 27 languages: hello in each of them, drifting by ──
const HELLO_A = ['Hallo', 'Bonjour', 'Hola', 'Ciao', 'Olá', 'Hej', 'Ahoj', 'Cześć', 'Szia', 'Tere', 'Salam', 'Bon dia', 'Halo'];
const HELLO_B = ['Привіт', 'Привет', 'Γεια σου', 'مرحبا', 'こんにちは', '안녕하세요', '你好', '哈囉', 'สวัสดี', 'Xin chào', 'Merhaba', 'Dobrý deň'];
const HELLO_A = [
'Hallo',
'Bonjour',
'Hola',
'Ciao',
'Olá',
'Hej',
'Ahoj',
'Cześć',
'Szia',
'Tere',
'Salam',
'Bon dia',
'Halo',
];
const HELLO_B = [
'Привіт',
'Привет',
'Γεια σου',
'مرحبا',
'こんにちは',
'안녕하세요',
'你好',
'哈囉',
'สวัสดี',
'Xin chào',
'Merhaba',
'Dobrý deň',
];
function HelloRow({ words, reverse }: { words: string[]; reverse?: boolean }) {
// Written twice, so the row can slide by half its width and start over without a seam.
@@ -156,19 +202,133 @@ function HelpVisual() {
);
}
// ── Place search: a query typed into the search field, the right place on top ──
const RESULTS: Array<{ name: string; Kind: React.ElementType; tone: string }> = [
{ name: 'Kölner Dom', Kind: Landmark, tone: 'sight' },
{ name: 'CGN', Kind: Plane, tone: 'air' },
{ name: 'Café Reichard', Kind: Coffee, tone: 'food' },
];
function SearchVisual() {
return (
<div className="rn-vis rn-vis-search">
<div className="rn-vis-search-field">
<Search size={10} strokeWidth={2.6} />
<span className="rn-vis-search-query">Kölner Dom</span>
<span className="rn-vis-search-caret" />
</div>
<div className="rn-vis-search-list">
{RESULTS.map(({ name, Kind, tone }, i) => (
<div
key={name}
className={i === 0 ? 'rn-vis-search-row rn-vis-search-row-top' : 'rn-vis-search-row'}
style={{ animationDelay: `${1.3 + i * 0.16}s` }}
>
<span className={`rn-vis-search-pin rn-vis-search-pin-${tone}`}>
<Kind size={8} strokeWidth={2.6} />
</span>
<span className="rn-vis-search-name">{name}</span>
</div>
))}
</div>
</div>
);
}
// ── Place details, shared: one place's details travelling out to other TREKs ──
const DETAILS = [Globe, Clock, Phone, ImageIcon];
function ShareVisual() {
return (
<div className="rn-vis rn-vis-share">
<svg className="rn-vis-share-links" viewBox="0 0 200 112" preserveAspectRatio="none" aria-hidden="true">
<path d="M82 56 C 110 56, 120 24, 156 22" />
<path d="M82 56 C 112 56, 126 56, 160 56" />
<path d="M82 56 C 110 56, 120 88, 156 90" />
</svg>
<div className="rn-vis-share-card">
<span className="rn-vis-share-pin">
<MapPin size={11} strokeWidth={2.4} />
</span>
<div className="rn-vis-share-fields">
{DETAILS.map((Detail, i) => (
<span key={i} className="rn-vis-share-field" style={{ animationDelay: `${0.5 + i * 0.18}s` }}>
<Detail size={8} strokeWidth={2.4} />
<i />
</span>
))}
</div>
</div>
{['top', 'mid', 'bottom'].map((at, i) => (
<span
key={at}
className={`rn-vis-share-node rn-vis-share-node-${at}`}
style={{ animationDelay: `${1.5 + i * 0.2}s` }}
>
<img src="/icons/icon-white.svg" alt="" />
</span>
))}
</div>
);
}
// ── Routing: a day's stops joined in one go ──
const DAY_ROUTE = 'M16 92 C 34 78, 42 84, 56 70 S 76 40, 96 48 S 120 78, 138 62 S 160 26, 184 22';
const DAY_STOPS: Array<[number, number]> = [
[16, 92],
[56, 70],
[96, 48],
[138, 62],
[184, 22],
];
function RoutingVisual() {
return (
<div className="rn-vis rn-vis-route">
<svg className="rn-vis-route-map" viewBox="0 0 200 112" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
<path
className="rn-vis-route-street"
d="M0 30 L200 44 M0 76 L200 64 M40 0 L64 112 M118 0 L104 112 M168 0 L176 112"
/>
<path className="rn-vis-route-water" d="M0 104 C 50 96, 90 112, 140 102 S 190 98, 200 100 V112 H0 Z" />
<path className="rn-vis-route-line" d={DAY_ROUTE} pathLength={1} />
{DAY_STOPS.map(([cx, cy], i) => (
<circle
key={i}
className="rn-vis-route-stop"
cx={cx}
cy={cy}
r="4.2"
style={{ animationDelay: `${0.3 + i * 0.22}s` }}
/>
))}
</svg>
<span className="rn-vis-route-badge">
<Zap size={9} strokeWidth={2.6} />
20
</span>
</div>
);
}
const VISUALS: Record<string, () => React.ReactElement> = {
tours: ToursVisual,
studio: StudioVisual,
assistant: AssistantVisual,
help: HelpVisual,
search: SearchVisual,
share: ShareVisual,
routing: RoutingVisual,
};
/** The card's picture, or its icon when the release names no drawing this client knows. */
export function ReleaseFeatureVisual({ visual, iconName }: { visual?: string; iconName: string }) {
const Drawing = visual ? VISUALS[visual] : undefined;
if (Drawing) return <Drawing />;
const Icon: React.ElementType =
((LucideIcons as Record<string, unknown>)[iconName] as React.ElementType) ?? Sparkles;
const Icon: React.ElementType = ((LucideIcons as Record<string, unknown>)[iconName] as React.ElementType) ?? Sparkles;
return (
<div className="rn-vis rn-vis-icon">
<Icon size={30} strokeWidth={1.6} aria-hidden="true" />
@@ -258,7 +258,7 @@
/* Keeps the foot clear of the cards when the column has no height to spare. */
margin-bottom: 18px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 14px;
}
@@ -528,6 +528,8 @@
background: var(--bg-hover);
}
.rn-support .rn-support-card { margin-top: 0; }
.rn-support-text {
font-size: 15.5px;
line-height: 1.62;
@@ -555,13 +557,42 @@
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
box-shadow: 0 2px 6px oklch(0 0 0 / 0.1);
cursor: pointer;
border: 0;
transition: filter 0.15s ease;
/* Glass like the promise card, tinted with each platform's colour (set below). */
position: relative;
isolation: isolate;
overflow: hidden;
background: linear-gradient(160deg,
color-mix(in oklch, var(--rn-btn) 96%, white) 0%,
color-mix(in oklch, var(--rn-btn) 82%, transparent) 100%);
border: 1px solid color-mix(in oklch, var(--rn-btn) 70%, white);
backdrop-filter: blur(16px) saturate(1.3);
-webkit-backdrop-filter: blur(16px) saturate(1.3);
box-shadow:
inset 0 1px 0 oklch(1 0 0 / 0.45),
0 12px 26px -14px color-mix(in oklch, var(--rn-btn) 80%, black);
transition: filter 0.15s ease, transform 0.15s ease;
}
.rn-support-btn:hover { filter: brightness(0.96); }
/* The light along the top edge and the sheen in the corner, as on the promise card. */
.rn-support-btn::before {
content: '';
position: absolute;
top: 0;
inset-inline: 0;
height: 1px;
background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.75), transparent);
}
.rn-support-btn::after {
content: '';
position: absolute;
inset: 0;
z-index: -1;
background: radial-gradient(120% 140% at 0% 0%, oklch(1 0 0 / 0.32) 0%, transparent 55%);
pointer-events: none;
}
.rn-support-btn:hover { filter: brightness(1.04) saturate(1.05); transform: translateY(-1px); }
/* The steam lifts off the cup in turn, and the heart beats. */
.rn-coffee { overflow: visible; }
@@ -593,11 +624,24 @@
[data-reduce-motion='true'] .rn-heart { animation: none; }
/* Brand colours: Buy Me a Coffee and Ko-fi own these. */
.rn-support-bmc { background: #ffdd00; color: #101013; } /* theme-lint-disable */
.rn-support-kofi { background: #ff5e5b; color: #ffffff; } /* theme-lint-disable */
.rn-support-bmc { --rn-btn: #ffdd00; color: #101013; } /* theme-lint-disable */
.rn-support-kofi { --rn-btn: #ff5e5b; color: #ffffff; } /* theme-lint-disable */
/* Narrow viewports: keep the proportions, drop the outer padding. */
@media (max-width: 900px) {
.rn-overlay { padding: 0; }
.rn-panel { border-radius: 0; border: 0; max-height: 100%; }
}
/* The sponsor's name, linked wherever a line names it; it takes the colour of the line it sits in. */
.rn-sponsor {
color: inherit;
font-weight: 600;
text-decoration: underline;
text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
text-underline-offset: 3px;
transition: text-decoration-color 160ms ease;
}
.rn-sponsor:hover {
text-decoration-color: currentColor;
}
@@ -536,6 +536,264 @@
white-space: nowrap;
}
/* Place search: the query typed into the field, the right place on top. */
.rn-vis-search {
display: flex;
flex-direction: column;
gap: 6px;
padding: 10px 11px;
background:
radial-gradient(110% 80% at 100% 0%, oklch(0.62 0.15 200 / 0.32) 0%, transparent 62%),
linear-gradient(165deg, #172025 0%, #11171b 100%);
}
.rn-vis-search-field {
display: flex;
align-items: center;
gap: 5px;
padding: 4px 8px;
border-radius: 99px;
background: #f5f5f7;
color: #101013;
font-size: 9.5px;
font-weight: 600;
box-shadow: 0 4px 12px oklch(0 0 0 / 0.4);
}
.rn-vis-search-query {
display: inline-block;
overflow: hidden;
white-space: nowrap;
max-width: 0;
animation: rn-type 0.9s steps(10, end) 0.3s both;
}
.rn-vis-search-caret {
width: 1.5px;
height: 10px;
background: #0ea5e9;
animation: rn-caret 0.9s step-end infinite;
}
.rn-vis-search-list {
display: flex;
flex-direction: column;
gap: 3px;
}
.rn-vis-search-row {
display: flex;
align-items: center;
gap: 6px;
padding: 3px 7px;
border-radius: 7px;
font-size: 9.5px;
line-height: 1.3;
animation: rn-rise 0.34s ease both;
}
.rn-vis-search-row-top {
background: oklch(1 0 0 / 0.1);
border: 1px solid oklch(1 0 0 / 0.16);
font-weight: 700;
}
.rn-vis-search-pin {
flex: none;
display: grid;
place-items: center;
width: 14px;
height: 14px;
border-radius: 50%;
color: #ffffff;
}
.rn-vis-search-pin-sight {
background: #f59e0b;
}
.rn-vis-search-pin-air {
background: #3b82f6;
}
.rn-vis-search-pin-food {
background: #ef4444;
}
.rn-vis-search-name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Place details, shared: one place's card, its details travelling out to other TREKs. */
.rn-vis-share {
background:
radial-gradient(90% 90% at 25% 50%, oklch(0.66 0.16 160 / 0.3) 0%, transparent 65%),
linear-gradient(165deg, #16211c 0%, #101814 100%);
}
.rn-vis-share-links {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.rn-vis-share-links path {
fill: none;
stroke: oklch(0.8 0.14 160 / 0.6);
stroke-width: 1.4;
stroke-dasharray: 3 4;
animation: rn-flow 1.4s linear infinite;
}
.rn-vis-share-card {
position: absolute;
top: 50%;
inset-inline-start: 12px;
display: flex;
gap: 6px;
padding: 6px;
border-radius: 9px;
background: #f5f5f7;
color: #101013;
transform: translateY(-50%);
box-shadow: 0 6px 16px oklch(0 0 0 / 0.45);
}
.rn-vis-share-pin {
display: grid;
place-items: center;
width: 20px;
height: 20px;
border-radius: 6px;
background: #10b981;
color: #ffffff;
}
.rn-vis-share-fields {
display: flex;
flex-direction: column;
gap: 3px;
}
.rn-vis-share-field {
display: flex;
align-items: center;
gap: 4px;
color: #059669;
animation: rn-rise 0.3s ease both;
}
.rn-vis-share-field i {
width: 22px;
height: 3px;
border-radius: 2px;
background: oklch(0.4 0.02 160 / 0.35);
}
.rn-vis-share-node {
position: absolute;
inset-inline-end: 12px;
display: grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 7px;
background: #101013;
border: 1px solid oklch(1 0 0 / 0.22);
box-shadow: 0 3px 10px oklch(0 0 0 / 0.45);
animation: rn-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rn-vis-share-node img {
width: 12px;
height: 12px;
}
.rn-vis-share-node-top {
top: 10%;
}
.rn-vis-share-node-mid {
top: 50%;
margin-top: -11px;
inset-inline-end: 8px;
}
.rn-vis-share-node-bottom {
bottom: 10%;
}
/* Routing: a day's stops joined in one go. */
.rn-vis-route {
background: linear-gradient(165deg, #1b1d22 0%, #131418 100%);
}
.rn-vis-route-map {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.rn-vis-route-street {
fill: none;
stroke: oklch(1 0 0 / 0.08);
stroke-width: 3;
}
.rn-vis-route-water {
fill: oklch(0.55 0.1 240 / 0.28);
}
.rn-vis-route-line {
fill: none;
stroke: #3b82f6;
stroke-width: 3;
stroke-linecap: round;
stroke-dasharray: 1;
stroke-dashoffset: 1;
filter: drop-shadow(0 0 4px oklch(0.62 0.19 255 / 0.7));
animation: rn-draw 1.3s cubic-bezier(0.6, 0, 0.3, 1) 0.3s forwards;
}
.rn-vis-route-stop {
fill: #f5f5f7;
stroke: #131418;
stroke-width: 2;
transform-box: fill-box;
transform-origin: center;
animation: rn-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rn-vis-route-badge {
position: absolute;
top: 8px;
inset-inline-start: 9px;
display: flex;
align-items: center;
gap: 3px;
padding: 2px 7px;
border-radius: 99px;
background: #facc15;
color: #1a1400;
font-size: 9.5px;
font-weight: 800;
font-variant-numeric: tabular-nums;
animation: rn-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s both;
}
@keyframes rn-type {
to {
max-width: 80px;
}
}
@keyframes rn-caret {
50% {
opacity: 0;
}
}
@keyframes rn-flow {
to {
stroke-dashoffset: -14;
}
}
@media (prefers-reduced-motion: reduce) {
.rn-vis-tours-trail,
.rn-vis-tours-flag,
@@ -544,9 +802,24 @@
.rn-vis-assist-typing i,
.rn-vis-assist-row,
.rn-vis-assist-apply,
.rn-vis-hello-row {
.rn-vis-hello-row,
.rn-vis-search-query,
.rn-vis-search-caret,
.rn-vis-search-row,
.rn-vis-share-links path,
.rn-vis-share-field,
.rn-vis-share-node,
.rn-vis-route-line,
.rn-vis-route-stop,
.rn-vis-route-badge {
animation: none;
}
.rn-vis-search-query {
max-width: 80px;
}
.rn-vis-route-line {
stroke-dashoffset: 0;
}
.rn-vis-tours-trail {
stroke-dashoffset: 0;
}
@@ -565,10 +838,27 @@
[data-reduce-motion='true'] .rn-vis-assist-typing i,
[data-reduce-motion='true'] .rn-vis-assist-row,
[data-reduce-motion='true'] .rn-vis-assist-apply,
[data-reduce-motion='true'] .rn-vis-hello-row {
[data-reduce-motion='true'] .rn-vis-hello-row,
[data-reduce-motion='true'] .rn-vis-search-query,
[data-reduce-motion='true'] .rn-vis-search-caret,
[data-reduce-motion='true'] .rn-vis-search-row,
[data-reduce-motion='true'] .rn-vis-share-links path,
[data-reduce-motion='true'] .rn-vis-share-field,
[data-reduce-motion='true'] .rn-vis-share-node,
[data-reduce-motion='true'] .rn-vis-route-line,
[data-reduce-motion='true'] .rn-vis-route-stop,
[data-reduce-motion='true'] .rn-vis-route-badge {
animation: none;
}
[data-reduce-motion='true'] .rn-vis-search-query {
max-width: 80px;
}
[data-reduce-motion='true'] .rn-vis-route-line {
stroke-dashoffset: 0;
}
[data-reduce-motion='true'] .rn-vis-tours-trail {
stroke-dashoffset: 0;
}