Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(notices): let the 4.0.0 release modal cover the whole 4.x line

Maurice2572132117b3
diff --git a/server/src/systemNotices/registry.ts b/server/src/systemNotices/registry.ts
index faf2f8198..20e901348 100644
--- a/server/src/systemNotices/registry.ts
+++ b/server/src/systemNotices/registry.ts
@@ -36,10 +36,13 @@ export const RETIRED_NOTICE_IDS = [
export const SYSTEM_NOTICES: SystemNotice[] = [
// ── 4.0.0 release — what shipped, and a note from the maintainer ────────────
// Carries `release`, so it renders as the two-column release modal rather than
- // the generic notice body. Shown once, not per-version: the copy is about this
- // release. The next one gets its own entry with its own id.
+ // the generic notice body. 4.0.0 was big enough that the whole 4.x line should
+ // carry it, so `recurring: 'per-version'` brings it back on each upgrade inside
+ // the window rather than the default one-time dismissal, which retired it for
+ // everyone who closed it once on 4.0.0. A 5.x release gets its own entry.
{
id: 'release-4-0-0',
+ recurring: 'per-version',
display: 'modal',
severity: 'info',
titleKey: 'system_notice.release_400.headline',
diff --git a/server/tests/unit/systemNotices/registry.test.ts b/server/tests/unit/systemNotices/registry.test.ts
index 0d7a4d6c7..aab20dc0e 100644
--- a/server/tests/unit/systemNotices/registry.test.ts
+++ b/server/tests/unit/systemNotices/registry.test.ts
@@ -82,6 +82,14 @@ describe('registry integrity', () => {
expect(isNoticeVersionActive(release!, '5.0.0')).toBe(false);
});
+ it('the 4.0.0 release notice comes back on each upgrade inside that line', () => {
+ const release = SYSTEM_NOTICES.find(n => n.id === 'release-4-0-0')!;
+ // The version window above is only half of "covers the whole 4.x line". Without
+ // this, the default one-time dismissal retired the notice for everyone who
+ // closed it on 4.0.0, so none of them saw it again on 4.1, 4.2 or later.
+ expect(release.recurring).toBe('per-version');
+ });
+
it('the thank-you notice hands over to the release modal at 4.0.0', () => {
const thankYou = SYSTEM_NOTICES.find(n => n.id === 'thank-you-support');
expect(thankYou).toBeDefined();