From 903868c08ceeb9e685eaf6160fa190cfaf861f72 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 25 Nov 2026 13:32:18 +0100 Subject: [PATCH] feat(release): show the iOS and Android apps in the 5.2.1 notice, the account settings and the user menu The release notice moves to 5.2.1 and gets a tile across the release column with the App Store and Google Play cards, each with a QR code that opens the store page. The headliner, intro, footnote and note texts are shorter so the tile fits, in every locale. Settings > Account shows the same store cards in its right column, except inside the native app itself. The user menu footer adds round links to Patreon, Ko-fi and Buy Me a Coffee beside Discord, left out on managed installs and in the native apps like every donation link. --- client/src/components/Layout/Navbar.test.tsx | 4 +- client/src/components/Layout/Navbar.tsx | 21 +-- .../components/Layout/UserMenuFooter.test.tsx | 44 +++++++ .../src/components/Layout/UserMenuFooter.tsx | 100 ++++++++++++++ .../Settings/AccountTab.apps.test.tsx | 41 ++++++ client/src/components/Settings/AccountTab.tsx | 11 +- .../SystemNotices/ReleaseNoticeModal.test.tsx | 21 ++- .../SystemNotices/ReleaseNoticeModal.tsx | 11 ++ .../SystemNotices/releaseNotice.css | 25 ++++ .../components/shared/AppStoreCards.test.tsx | 39 ++++++ .../src/components/shared/AppStoreCards.tsx | 65 +++++++++ .../src/components/shared/appStoreCards.css | 124 ++++++++++++++++++ server/src/systemNotices/registry.ts | 7 +- server/src/systemNotices/types.ts | 2 + shared/src/i18n/ar/settings.ts | 6 + shared/src/i18n/ar/system_notice.ts | 16 +-- shared/src/i18n/az/settings.ts | 6 + shared/src/i18n/az/system_notice.ts | 15 +-- shared/src/i18n/br/settings.ts | 6 + shared/src/i18n/br/system_notice.ts | 14 +- shared/src/i18n/ca/settings.ts | 6 + shared/src/i18n/ca/system_notice.ts | 14 +- shared/src/i18n/cs/settings.ts | 6 + shared/src/i18n/cs/system_notice.ts | 16 +-- shared/src/i18n/de/settings.ts | 6 + shared/src/i18n/de/system_notice.ts | 14 +- shared/src/i18n/en/settings.ts | 6 + shared/src/i18n/en/system_notice.ts | 16 +-- shared/src/i18n/es/settings.ts | 6 + shared/src/i18n/es/system_notice.ts | 15 +-- shared/src/i18n/et/settings.ts | 6 + shared/src/i18n/et/system_notice.ts | 15 +-- shared/src/i18n/fr/settings.ts | 6 + shared/src/i18n/fr/system_notice.ts | 14 +- shared/src/i18n/gr/settings.ts | 6 + shared/src/i18n/gr/system_notice.ts | 13 +- shared/src/i18n/he/settings.ts | 6 + shared/src/i18n/he/system_notice.ts | 17 +-- shared/src/i18n/hu/settings.ts | 6 + shared/src/i18n/hu/system_notice.ts | 14 +- shared/src/i18n/id/settings.ts | 6 + shared/src/i18n/id/system_notice.ts | 15 +-- shared/src/i18n/it/settings.ts | 6 + shared/src/i18n/it/system_notice.ts | 14 +- shared/src/i18n/ja/settings.ts | 6 + shared/src/i18n/ja/system_notice.ts | 16 +-- shared/src/i18n/ko/settings.ts | 6 + shared/src/i18n/ko/system_notice.ts | 16 +-- shared/src/i18n/nl/settings.ts | 6 + shared/src/i18n/nl/system_notice.ts | 14 +- shared/src/i18n/pl/settings.ts | 6 + shared/src/i18n/pl/system_notice.ts | 14 +- shared/src/i18n/ru/settings.ts | 6 + shared/src/i18n/ru/system_notice.ts | 15 +-- shared/src/i18n/sk/settings.ts | 6 + shared/src/i18n/sk/system_notice.ts | 16 +-- shared/src/i18n/sv/settings.ts | 6 + shared/src/i18n/sv/system_notice.ts | 15 +-- shared/src/i18n/th/settings.ts | 6 + shared/src/i18n/th/system_notice.ts | 17 +-- shared/src/i18n/tr/settings.ts | 6 + shared/src/i18n/tr/system_notice.ts | 15 +-- shared/src/i18n/uk/settings.ts | 6 + shared/src/i18n/uk/system_notice.ts | 15 +-- shared/src/i18n/vi/settings.ts | 6 + shared/src/i18n/vi/system_notice.ts | 15 +-- shared/src/i18n/zh-TW/settings.ts | 6 + shared/src/i18n/zh-TW/system_notice.ts | 17 +-- shared/src/i18n/zh/settings.ts | 6 + shared/src/i18n/zh/system_notice.ts | 17 +-- .../src/system-notice/system-notice.schema.ts | 2 + 71 files changed, 857 insertions(+), 252 deletions(-) create mode 100644 client/src/components/Layout/UserMenuFooter.test.tsx create mode 100644 client/src/components/Layout/UserMenuFooter.tsx create mode 100644 client/src/components/Settings/AccountTab.apps.test.tsx create mode 100644 client/src/components/shared/AppStoreCards.test.tsx create mode 100644 client/src/components/shared/AppStoreCards.tsx create mode 100644 client/src/components/shared/appStoreCards.css diff --git a/client/src/components/Layout/Navbar.test.tsx b/client/src/components/Layout/Navbar.test.tsx index 4557bfdb2..083f1bbc6 100644 --- a/client/src/components/Layout/Navbar.test.tsx +++ b/client/src/components/Layout/Navbar.test.tsx @@ -544,9 +544,9 @@ describe('Navbar styling and menu details', () => { const discord = screen.getByTitle('Discord'); fireEvent.mouseEnter(discord); - expect(discord.style.background).toBe('rgba(88, 101, 242, 0.125)'); + expect(discord.style.background).toBe('rgba(88, 101, 242, 0.15)'); fireEvent.mouseLeave(discord); - expect(discord.style.background).toBe('var(--bg-tertiary)'); + expect(discord.style.background).toBe(''); expect(document.querySelector('img[src="/text-light.svg"]')).not.toBeNull(); }); diff --git a/client/src/components/Layout/Navbar.tsx b/client/src/components/Layout/Navbar.tsx index 7670c83a5..1e703a7cb 100644 --- a/client/src/components/Layout/Navbar.tsx +++ b/client/src/components/Layout/Navbar.tsx @@ -17,6 +17,7 @@ import { useCollapseOnOverflow } from '../../hooks/useCollapseOnOverflow' import { openMailInbox } from '../MailIngest/mailInboxOpener' import { useMailInboxShell } from '../MailIngest/useMailInboxShell' import MailInboxDialog from '../MailIngest/MailInboxDialog' +import UserMenuFooter from './UserMenuFooter' const ADDON_ICONS: Record = { CalendarDays, Briefcase, Globe, Compass, Bookmark } @@ -311,7 +312,7 @@ export default function Navbar({ tripTitle, tripId, onBack, showBack, onSettings {userMenuOpen && createPortal( <>
setUserMenuOpen(false)} /> -
+

{user.username}

{user.email}

@@ -368,23 +369,7 @@ export default function Navbar({ tripTitle, tripId, onBack, showBack, onSettings {t('nav.logout')} - {appVersion && ( - - )} + {appVersion && }
, diff --git a/client/src/components/Layout/UserMenuFooter.test.tsx b/client/src/components/Layout/UserMenuFooter.test.tsx new file mode 100644 index 000000000..72695226a --- /dev/null +++ b/client/src/components/Layout/UserMenuFooter.test.tsx @@ -0,0 +1,44 @@ +// FE-MENUFOOT-001 to FE-MENUFOOT-004 +import { describe, expect, it, vi } from 'vitest'; +import { fireEvent, render, screen } from '../../../tests/helpers/render'; +import { isNativeApp } from '../../native/platform'; +import UserMenuFooter from './UserMenuFooter'; + +vi.mock('../../native/platform', () => ({ isNativeApp: vi.fn(() => false) })); + +function titles(): string[] { + return [...document.querySelectorAll('a[title]')].map((a) => a.getAttribute('title') ?? ''); +} + +describe('UserMenuFooter', () => { + it('FE-MENUFOOT-001: shows the version and the three support links beside Discord', () => { + render(); + expect(screen.getByText('v5.2.1')).toBeInTheDocument(); + expect(document.querySelector('img[src="/text-dark.svg"]')).not.toBeNull(); + expect(titles()).toEqual(['Patreon', 'Ko-fi', 'Buy Me a Coffee', 'Discord']); + expect(screen.getByTitle('Ko-fi')).toHaveAttribute('href', 'https://ko-fi.com/mauriceboe'); + expect(screen.getByTitle('Buy Me a Coffee')).toHaveAttribute('href', 'https://buymeacoffee.com/mauriceboe'); + expect(screen.getByTitle('Patreon')).toHaveAttribute('href', 'https://www.patreon.com/cw/mauriceboe'); + }); + + it('FE-MENUFOOT-002: a managed install keeps only Discord', () => { + render(); + expect(titles()).toEqual(['Discord']); + expect(document.querySelector('img[src="/text-light.svg"]')).not.toBeNull(); + }); + + it('FE-MENUFOOT-003: the native app shows no donation link', () => { + vi.mocked(isNativeApp).mockReturnValueOnce(true); + render(); + expect(titles()).toEqual(['Discord']); + }); + + it('FE-MENUFOOT-004: hovering a link washes it in its brand colour and leaving clears it', () => { + render(); + const kofi = screen.getByTitle('Ko-fi'); + fireEvent.mouseEnter(kofi); + expect(kofi.style.background).toBe('rgba(255, 94, 91, 0.15)'); + fireEvent.mouseLeave(kofi); + expect(kofi.style.background).toBe(''); + }); +}); diff --git a/client/src/components/Layout/UserMenuFooter.tsx b/client/src/components/Layout/UserMenuFooter.tsx new file mode 100644 index 000000000..4f2e591a3 --- /dev/null +++ b/client/src/components/Layout/UserMenuFooter.tsx @@ -0,0 +1,100 @@ +import { Coffee, Heart } from 'lucide-react'; +import React from 'react'; +import { donationsShown } from '../../utils/donations'; +import { PATREON_PATH, PATREON_URL } from '../shared/PatreonIcon'; + +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'; + +interface FooterLink { + title: string; + href: string; + /** The brand's colour, as a faint wash behind the icon on hover. */ + tint: string; + icon: React.ReactNode; +} + +function brandSvg(path: string): React.ReactNode { + return ( + + ); +} + +const DISCORD: FooterLink = { + title: 'Discord', + href: 'https://discord.gg/NhZBDSd4qW', + tint: '#5865F2', // Discord's brand colour + icon: brandSvg(DISCORD_PATH), +}; + +const SUPPORT: FooterLink[] = [ + { + title: 'Patreon', + href: PATREON_URL, + tint: '#ff424d', // Patreon's brand colour + icon: brandSvg(PATREON_PATH), + }, + { + title: 'Ko-fi', + href: 'https://ko-fi.com/mauriceboe', + tint: '#ff5e5b', // Ko-fi's brand colour + icon: