diff --git a/src/lib/components/WhatsNewModal.svelte b/src/lib/components/WhatsNewModal.svelte index f9e044a..7bc1088 100644 --- a/src/lib/components/WhatsNewModal.svelte +++ b/src/lib/components/WhatsNewModal.svelte @@ -3,6 +3,7 @@ import { Button } from '$lib/components/ui/button'; import { Sparkles, Bug, Zap, CheckCircle, ScrollText } from 'lucide-svelte'; import { compareVersions } from '$lib/utils/version'; + import { releasedEntries } from '$lib/utils/changelog-filter'; import ChangelogText from '$lib/components/ChangelogText.svelte'; interface ChangelogEntry { @@ -10,6 +11,7 @@ date: string; changes: Array<{ type: string; text: string }>; imageTag?: string; + comingSoon?: boolean; } interface Props { @@ -22,9 +24,11 @@ let { open = $bindable(), version, changelog, lastSeenVersion, onDismiss }: Props = $props(); - // Filter to show versions newer than lastSeenVersion, limited to 3 most recent + // Versions newer than lastSeenVersion, 3 most recent. Coming-soon (unreleased) + // entries are excluded: the user is on a released build, so an unreleased version + // must never appear as something they "missed". const missedReleases = $derived( - changelog + releasedEntries(changelog) .filter((r) => { if (!lastSeenVersion) return true; // Show all if first time return compareVersions(r.version, lastSeenVersion.replace(/^v/, '')) > 0; diff --git a/src/lib/utils/changelog-filter.ts b/src/lib/utils/changelog-filter.ts new file mode 100644 index 0000000..c173fcb --- /dev/null +++ b/src/lib/utils/changelog-filter.ts @@ -0,0 +1,13 @@ +// A coming-soon changelog entry (comingSoon: true) is an unreleased placeholder +// used for the webpage's "what's next" section. It must never appear in the app's +// released-version surfaces (About list, What's New, self-update release notes), +// which otherwise render it as the latest shipped version. + +export interface ChangelogEntryLike { + comingSoon?: boolean; +} + +/** Drop unreleased (comingSoon) entries, keeping only shipped releases. */ +export function releasedEntries(entries: T[]): T[] { + return entries.filter((e) => !e.comingSoon); +} diff --git a/src/routes/settings/about/AboutTab.svelte b/src/routes/settings/about/AboutTab.svelte index 32ff1a3..f52dbf8 100644 --- a/src/routes/settings/about/AboutTab.svelte +++ b/src/routes/settings/about/AboutTab.svelte @@ -1,6 +1,7 @@