From bcdcd69a6489d70c47b618c0475b760a3cc23ac8 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 23 Nov 2026 21:15:54 +0100 Subject: [PATCH] feat(notices): 5.2.0 release modal and Patreon for monthly support The release modal now shows 5.2.0: booking mails that land in the trip, live flight status and the new trip PDF, each with its own drawn card, and links the 5.2.0 release notes. The maintainer note and the support block are rewritten, shorter and without the sponsor wording. Patreon joins Buy Me a Coffee and Ko-fi as the monthly way to support TREK: a full-width button in the release and thank-you notices (a new optional tertiaryCta on the notice contract), a tile in About and in the admin GitHub panel on desktop and phone, the README badges and FUNDING.yml. Like the other donation links it stays hidden inside the native apps. --- .github/FUNDING.yml | 1 + README.md | 2 + client/src/components/Admin/GitHubPanel.tsx | 8 + .../src/components/Settings/AboutTab.test.tsx | 5 +- client/src/components/Settings/AboutTab.tsx | 8 + .../SystemNotices/ReleaseNoticeModal.test.tsx | 25 +- .../SystemNotices/ReleaseNoticeModal.tsx | 24 +- .../SystemNotices/ReleaseNoticeVisuals.tsx | 243 ++---- .../SystemNotices/SystemNoticeModal.tsx | 26 +- .../SystemNotices/releaseNotice.css | 2 + .../SystemNotices/releaseNoticeVisuals.css | 789 +++++++----------- client/src/components/shared/PatreonIcon.tsx | 25 + .../screens/admin/MAdminGitHubPanel.tsx | 2 + .../screens/settings/MSettingsAbout.tsx | 6 +- client/src/utils/donations.test.ts | 4 +- client/src/utils/donations.ts | 10 +- server/src/systemNotices/registry.ts | 38 +- server/src/systemNotices/types.ts | 1 + shared/src/i18n/ar/admin.ts | 1 + shared/src/i18n/ar/system_notice.ts | 40 +- shared/src/i18n/az/admin.ts | 1 + shared/src/i18n/az/system_notice.ts | 40 +- shared/src/i18n/br/admin.ts | 1 + shared/src/i18n/br/system_notice.ts | 40 +- shared/src/i18n/ca/admin.ts | 1 + shared/src/i18n/ca/system_notice.ts | 40 +- shared/src/i18n/cs/admin.ts | 1 + shared/src/i18n/cs/system_notice.ts | 40 +- shared/src/i18n/de/admin.ts | 1 + shared/src/i18n/de/system_notice.ts | 44 +- shared/src/i18n/en/admin.ts | 1 + shared/src/i18n/en/system_notice.ts | 44 +- shared/src/i18n/es/admin.ts | 1 + shared/src/i18n/es/system_notice.ts | 40 +- shared/src/i18n/et/admin.ts | 1 + shared/src/i18n/et/system_notice.ts | 40 +- shared/src/i18n/fr/admin.ts | 1 + shared/src/i18n/fr/system_notice.ts | 40 +- shared/src/i18n/gr/admin.ts | 1 + shared/src/i18n/gr/system_notice.ts | 40 +- shared/src/i18n/he/admin.ts | 1 + shared/src/i18n/he/system_notice.ts | 40 +- shared/src/i18n/hu/admin.ts | 1 + shared/src/i18n/hu/system_notice.ts | 40 +- shared/src/i18n/id/admin.ts | 1 + shared/src/i18n/id/system_notice.ts | 40 +- shared/src/i18n/it/admin.ts | 1 + shared/src/i18n/it/system_notice.ts | 40 +- shared/src/i18n/ja/admin.ts | 1 + shared/src/i18n/ja/system_notice.ts | 40 +- shared/src/i18n/ko/admin.ts | 1 + shared/src/i18n/ko/system_notice.ts | 40 +- shared/src/i18n/nl/admin.ts | 1 + shared/src/i18n/nl/system_notice.ts | 40 +- shared/src/i18n/pl/admin.ts | 1 + shared/src/i18n/pl/system_notice.ts | 40 +- shared/src/i18n/ru/admin.ts | 1 + shared/src/i18n/ru/system_notice.ts | 40 +- shared/src/i18n/sk/admin.ts | 1 + shared/src/i18n/sk/system_notice.ts | 40 +- shared/src/i18n/sv/admin.ts | 1 + shared/src/i18n/sv/system_notice.ts | 40 +- shared/src/i18n/th/admin.ts | 1 + shared/src/i18n/th/system_notice.ts | 40 +- shared/src/i18n/tr/admin.ts | 1 + shared/src/i18n/tr/system_notice.ts | 39 +- shared/src/i18n/uk/admin.ts | 1 + shared/src/i18n/uk/system_notice.ts | 40 +- shared/src/i18n/vi/admin.ts | 1 + shared/src/i18n/vi/system_notice.ts | 39 +- shared/src/i18n/zh-TW/admin.ts | 1 + shared/src/i18n/zh-TW/system_notice.ts | 40 +- shared/src/i18n/zh/admin.ts | 1 + shared/src/i18n/zh/system_notice.ts | 40 +- .../src/system-notice/system-notice.schema.ts | 1 + 75 files changed, 1179 insertions(+), 1195 deletions(-) create mode 100644 client/src/components/shared/PatreonIcon.tsx diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8fea44fbc..61253a801 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,3 @@ +patreon: mauriceboe ko_fi: mauriceboe buy_me_a_coffee: mauriceboe diff --git a/README.md b/README.md index ce2e16055..7ac147bba 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ TREK has grown from a travel planner into a whole ecosystem for trips: plan toge   Roadmap   +Patreon +  Ko-fi   BMAC diff --git a/client/src/components/Admin/GitHubPanel.tsx b/client/src/components/Admin/GitHubPanel.tsx index 6bd222ced..a4a1ba2a0 100644 --- a/client/src/components/Admin/GitHubPanel.tsx +++ b/client/src/components/Admin/GitHubPanel.tsx @@ -20,6 +20,7 @@ import { escapeReleaseHtml as escapeHtml, parseReleaseNotes } from '../../utils/ import { fs } from '../shared/DialogShell'; import { SETTINGS_BUTTON, SettingsCard, StatusPill } from '../Settings/settingsKit'; import { useGithubReleases } from './useGithubReleases'; +import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon'; const REPO = 'liketrek/TREK'; @@ -136,6 +137,13 @@ export default function GitHubPanel({ isPrerelease = false }: { isPrerelease?: b }; const supportLinks: SupportLink[] = withoutDonationsInApp([ + { + href: PATREON_URL, + brand: PATREON_COLOR, + icon: PatreonIcon, + title: 'Patreon', + hint: t('admin.github.supportMonthly'), + }, { href: 'https://ko-fi.com/mauriceboe', brand: '#ff5e5b', // theme-lint-disable: Ko-fi brand colour diff --git a/client/src/components/Settings/AboutTab.test.tsx b/client/src/components/Settings/AboutTab.test.tsx index 312429722..c8e59d58c 100644 --- a/client/src/components/Settings/AboutTab.test.tsx +++ b/client/src/components/Settings/AboutTab.test.tsx @@ -60,8 +60,9 @@ describe('AboutTab', () => { it('FE-COMP-ABOUT-009: all external links have rel="noopener noreferrer"', () => { render(); const links = document.querySelectorAll('a'); - // Six tiles, and the sponsor panel: its logo, its button and the name in its title and body. - expect(links).toHaveLength(10); + // Seven tiles, and the sponsor panel: its logo, its button and the name in its title and body. + expect(links).toHaveLength(11); + expect(document.querySelector('a[href="https://www.patreon.com/cw/mauriceboe"]')).not.toBeNull(); links.forEach((link) => { expect(link).toHaveAttribute('rel', 'noopener noreferrer'); }); diff --git a/client/src/components/Settings/AboutTab.tsx b/client/src/components/Settings/AboutTab.tsx index e513120af..59b837956 100644 --- a/client/src/components/Settings/AboutTab.tsx +++ b/client/src/components/Settings/AboutTab.tsx @@ -17,6 +17,7 @@ import { useTranslation } from '../../i18n'; import { useAuthStore } from '../../store/authStore'; import { donationsShown } from '../../utils/donations'; import { fs } from '../shared/DialogShell'; +import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon'; import Section from './Section'; import { StatusPill } from './settingsKit'; @@ -246,6 +247,13 @@ export default function AboutTab({ appVersion }: Props): React.ReactElement { {/* Not in the native apps, whose store rules allow no outside payment links. */} {donationsShown() && ( <> + } + title="Patreon" + hint={t('admin.github.supportMonthly')} + /> = {}): SystemNoticeDT introKey: 'rel.intro', featuresLabelKey: 'rel.features.label', features: [ - { iconName: 'Mountain', visual: 'tours', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' }, - { iconName: 'BookOpen', visual: 'studio', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' }, - { iconName: 'Sparkles', visual: 'assistant', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' }, + { iconName: 'Mail', visual: 'mail', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' }, + { iconName: 'Plane', visual: 'flight', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' }, + { iconName: 'FileText', visual: 'pdf', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' }, ], note: { eyebrowKey: 'rel.note.eyebrow', @@ -85,9 +85,9 @@ describe('ReleaseNoticeModal', () => { 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(); + expect(document.querySelector('.rn-vis-mail')).not.toBeNull(); + expect(document.querySelector('.rn-vis-flight')).not.toBeNull(); + expect(document.querySelector('.rn-vis-pdf')).not.toBeNull(); }); it('FE-RN-004: splits the note body on the blank line into separate paragraphs', () => { @@ -201,20 +201,19 @@ describe('ReleaseNoticeModal', () => { const n = releaseNotice(); n.release!.features = [ ...n.release!.features, - { iconName: 'LifeBuoy', visual: 'help', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' }, + { iconName: 'Search', visual: 'search', 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); - // The help drawing: the help button and two rows of greetings, each written twice to loop. + // The search drawing: the field and its three results, the right place on top. 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(wide.querySelector('.rn-vis-search-field')).not.toBeNull(); + expect(wide.querySelectorAll('.rn-vis-search-row')).toHaveLength(3); + // The mail card ends on the booking it added, with its tick. + expect(cards[0].querySelector('.rn-vis-mail-row-new .rn-vis-mail-check')).not.toBeNull(); }); it('FE-RN-016: the close button belongs to the panel, not the note', () => { diff --git a/client/src/components/SystemNotices/ReleaseNoticeModal.tsx b/client/src/components/SystemNotices/ReleaseNoticeModal.tsx index 47244ce1b..e66d75e3e 100644 --- a/client/src/components/SystemNotices/ReleaseNoticeModal.tsx +++ b/client/src/components/SystemNotices/ReleaseNoticeModal.tsx @@ -2,6 +2,7 @@ import { ArrowRight, Heart, Infinity as InfinityIcon, ShieldCheck, X } from 'luc import React from 'react'; import { useTranslation } from '../../i18n/TranslationContext.js'; import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js'; +import { PATREON_PATH } from '../shared/PatreonIcon'; import { ReleaseFeatureVisual } from './ReleaseNoticeVisuals.js'; import './releaseNotice.css'; @@ -11,6 +12,7 @@ interface Props { onDismiss: () => void; onCTA: () => void; onSecondaryCTA: () => void; + onTertiaryCTA: () => void; } /** Lucide's coffee cup, drawn here so its three steam strokes can drift up in waves. */ @@ -74,7 +76,7 @@ function paragraphs(text: string): string[] { * generic modal's behaviour: the host hook still owns ESC, the scroll lock and * the dismissal, this component only draws. */ -export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA }: Props) { +export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA, onTertiaryCTA }: Props) { const { t } = useTranslation(); const release = notice.release; if (!release) return null; @@ -208,6 +210,26 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond )}
+ {notice.tertiaryCta && ( + + )} {notice.cta && ( )} + {tertiaryCtaLabel && ( + + )}
) : (notice.dismissible || isLastPage) && (