From c111032d9940ea59f678a03cbefa2e0aa86e8e25 Mon Sep 17 00:00:00 2001 From: LyAhn Date: Mon, 29 Jun 2026 17:23:35 +0100 Subject: [PATCH] fix(changelog): strip build suffixes before version lookup UI-lab builds append a suffix to the version string (e.g. "0.1.1-ui") which caused getChangelogForVersion to find no match and fall back to the "not available in-app" message. A regex now strips any hyphen-and-letter suffix before the lookup so the What's New modal renders correctly in all build modes. --- src/changelog.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/changelog.ts b/src/changelog.ts index 1e3a112..35a76d9 100644 --- a/src/changelog.ts +++ b/src/changelog.ts @@ -105,7 +105,9 @@ const ENTRIES = parseChangelog(changelogRaw); export function getChangelogForVersion(version: string | null | undefined): ChangelogEntry | null { if (!version) return null; - const normalized = version.replace(/^v/, ""); + // Strip leading "v" and any build suffix (e.g. "-ui", "-dev", "-beta.1") so + // dev/UI-lab builds still resolve to the correct changelog entry. + const normalized = version.replace(/^v/, "").replace(/-[a-z].*/i, ""); // Never surface the in-progress [Unreleased] section to users. if (normalized.toLowerCase() === "unreleased") return null; return ENTRIES.find((e) => e.version.replace(/^v/, "") === normalized) ?? null;