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.
This commit is contained in:
Maurice
2026-11-23 21:15:54 +01:00
parent d18a4b2180
commit bcdcd69a64
75 changed files with 1179 additions and 1195 deletions
+3 -1
View File
@@ -15,6 +15,7 @@ describe('isDonationLink', () => {
it('knows the donation pages, their subdomains too', () => {
expect(isDonationLink('https://ko-fi.com/mauriceboe')).toBe(true);
expect(isDonationLink('https://www.BuyMeACoffee.com/mauriceboe')).toBe(true);
expect(isDonationLink('https://www.patreon.com/cw/mauriceboe')).toBe(true);
});
it('is false for anything else, a missing href or one that is no URL', () => {
@@ -41,9 +42,10 @@ describe('in the native app', () => {
});
describe('noticeAsksForDonation', () => {
it('looks at both buttons', () => {
it('looks at all three buttons', () => {
expect(noticeAsksForDonation({ cta: { kind: 'link', href: 'https://ko-fi.com/x' } })).toBe(true);
expect(noticeAsksForDonation({ secondaryCta: { kind: 'link', href: 'https://buymeacoffee.com/x' } })).toBe(true);
expect(noticeAsksForDonation({ tertiaryCta: { kind: 'link', href: 'https://www.patreon.com/x' } })).toBe(true);
expect(noticeAsksForDonation({ cta: { kind: 'nav', href: '/settings' }, secondaryCta: null })).toBe(false);
expect(noticeAsksForDonation({ cta: { kind: 'action' } })).toBe(false);
expect(noticeAsksForDonation({})).toBe(false);
+7 -3
View File
@@ -1,7 +1,7 @@
import { isNativeApp } from '../native/platform';
/** Where the project takes donations. */
const DONATION_HOSTS = ['ko-fi.com', 'buymeacoffee.com'];
const DONATION_HOSTS = ['ko-fi.com', 'buymeacoffee.com', 'patreon.com'];
/** Whether `href` points at one of the project's donation pages. */
export function isDonationLink(href: string | undefined): boolean {
@@ -33,6 +33,10 @@ export function withoutDonationsInApp<T extends { href: string }>(links: T[]): T
type NoticeButton = { kind: string; href?: string } | null | undefined;
/** Whether a system notice asks for a donation through one of its buttons. */
export function noticeAsksForDonation(notice: { cta?: NoticeButton; secondaryCta?: NoticeButton }): boolean {
return isDonationLink(notice.cta?.href) || isDonationLink(notice.secondaryCta?.href);
export function noticeAsksForDonation(notice: {
cta?: NoticeButton;
secondaryCta?: NoticeButton;
tertiaryCta?: NoticeButton;
}): boolean {
return [notice.cta, notice.secondaryCta, notice.tertiaryCta].some((cta) => isDonationLink(cta?.href));
}