Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(feat) What's New shows the release notes (#198)

Chris Laupama5d405d715f2f
diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md
index e39cdd13..5ee55963 100644
--- a/.claude/skills/release/SKILL.md
+++ b/.claude/skills/release/SKILL.md
@@ -11,10 +11,12 @@ Two files describe a release, for two readers:
- **`CHANGELOG.md`** is the raw working log. Entries land under `## [Unreleased]` as work
merges ("what we did, we write"), so it can repeat itself or hold changes that a later
entry undid. At release time it is only promoted to `## [X.Y.Z] — date` and is never
- rewritten. The app's What's New window reads it, and the CI guard requires the section.
+ rewritten. The CI guard requires the section, and What's New falls back to it for a
+ version without curated notes.
- **`release-notes/X.Y.Z.en.md`** and **`release-notes/X.Y.Z.ru.md`** are the curated
text: summarised, deduplicated, checked against the code. **Everything published comes
- from them.** `scripts/release-notes.sh X.Y.Z <target>` renders them for each place:
+ from them**, and the app bundles the EN file for its What's New window, so the notes must
+ be committed on the release branch before the tag is built. `scripts/release-notes.sh X.Y.Z <target>` renders them for each place:
| target | where it goes |
|-----------|-------------------------------------------------|
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e767830..a19df33e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -130,6 +130,12 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
track, or a rack selected, it starts a new track as before; ⌥ + double-click (Alt on
Windows and Linux) always starts a new track.
+### Changed
+- **What's New shows the release notes**: the window now shows each version's curated release
+ notes, the same text as its GitHub release, instead of the raw working log from this file.
+ A version without release notes (older ones, and builds between releases) still shows its
+ changelog section.
+
### Fixed
- **Aurora: every unison voice goes through the filters** (nota-daw/nota#193): with two or
more unison voices and any Spread, the stereo part of the stack used to skip the source
diff --git a/FEATURES.md b/FEATURES.md
index ffbe40b9..ff442db3 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -1046,7 +1046,8 @@ audio effects after it keep running and keep their settings; saved with the proj
frame). **Full screen** — the macOS green button, or View → Toggle Full Screen (F11)
on Windows and Linux — hides the title bar and its separator so the workspace fills the
screen edge to edge; leaving full screen brings the bar back. Maximized keeps the bar.
-- **What's New** — a window showing changelog entries newer than `LastSeenVersion`, once
+- **What's New** — a window showing the release notes (`release-notes/X.Y.Z.en.md`, the GitHub
+ release text; the CHANGELOG section for versions without them) newer than `LastSeenVersion`, once
after the first launch on a new version; any time from Help ▸ What's New or the version
number in the status bar.
- **Self-update** — the start screen's banner announces a newer GitHub release. **Update**
diff --git a/src/managed/Nota.App/AppInfo.cs b/src/managed/Nota.App/AppInfo.cs
index 26b20062..acbfbea7 100644
--- a/src/managed/Nota.App/AppInfo.cs
+++ b/src/managed/Nota.App/AppInfo.cs
@@ -4,8 +4,10 @@
// App-level version + changelog access. The version's single source of truth is
// the repo-root VERSION file, baked into the assembly at build time by
// Directory.Build.props (InformationalVersion). Here we read it back at runtime
-// and parse the embedded CHANGELOG.md so the About / What's New windows can show
-// the human-readable notes. Distinct from the native engine version
+// and parse the embedded notes so the About / What's New windows can show them: a
+// released version shows its curated release notes (release-notes/X.Y.Z.en.md, the
+// same text as the GitHub release), and a version without them falls back to its
+// CHANGELOG.md section. Distinct from the native engine version
// (NotaEngine.Version) — see the About window, which shows both.
using System;
@@ -16,13 +18,6 @@ using Avalonia.Platform;
namespace Nota.App;
-/// <summary>One version's changelog: its number, date and grouped notes.</summary>
-public sealed record ChangelogEntry(string Version, string Date,
- IReadOnlyList<ChangelogSection> Sections);
-
-/// <summary>A category within a changelog entry (Added / Changed / Fixed / Removed).</summary>
-public sealed record ChangelogSection(string Title, IReadOnlyList<string> Items);
-
public static class AppInfo
{
/// <summary>Running app version as semver "MAJOR.MINOR.PATCH" (from the VERSION file
@@ -40,19 +35,50 @@ public static class AppInfo
}
}
- /// <summary>Parsed changelog entries, newest first. Empty if the resource is missing.</summary>
+ /// <summary>Parsed changelog entries, newest first. Empty if the resource is missing.
+ /// A version that shipped curated release notes gets those in place of its raw
+ /// changelog section (the date still comes from the changelog).</summary>
public static IReadOnlyList<ChangelogEntry> Changelog()
{
+ IReadOnlyList<ChangelogEntry> raw;
try
{
- using var s = AssetLoader.Open(new Uri("avares://Nota.App/Assets/CHANGELOG.md"));
- using var r = new StreamReader(s);
- return ChangelogParser.Parse(r.ReadToEnd());
+ raw = ChangelogParser.Parse(ReadAsset("avares://Nota.App/Assets/CHANGELOG.md"));
}
catch
{
return Array.Empty<ChangelogEntry>();
}
+
+ var entries = new List<ChangelogEntry>(raw.Count);
+ foreach (var e in raw)
+ entries.Add(ReleaseNotes(e) ?? e);
+ return entries;
+ }
+
+ // The curated notes for a changelog entry's version, or null when that version
+ // has none (unreleased work, versions from before release-notes/ existed).
+ private static ChangelogEntry? ReleaseNotes(ChangelogEntry e)
+ {
+ if (!SemVer.TryParse(e.Version, out _)) return null;
+ var uri = new Uri($"avares://Nota.App/Assets/ReleaseNotes/{e.Version}.en.md");
+ try
+ {
+ if (!AssetLoader.Exists(uri)) return null;
+ var notes = ReleaseNotesParser.Parse(e.Version, e.Date, ReadAsset(uri.ToString()));
+ return notes.Sections.Count > 0 || notes.Lede.Length > 0 ? notes : null;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private static string ReadAsset(string uri)
+ {
+ using var s = AssetLoader.Open(new Uri(uri));
+ using var r = new StreamReader(s);
+ return r.ReadToEnd();
}
/// <summary>Changelog entries strictly newer than <paramref name="sinceVersion"/>
diff --git a/src/managed/Nota.App/Changelog.cs b/src/managed/Nota.App/Changelog.cs
index d4b18bed..27e0805f 100644
--- a/src/managed/Nota.App/Changelog.cs
+++ b/src/managed/Nota.App/Changelog.cs
@@ -7,12 +7,32 @@
// The "## [Unreleased]" header (where changes accumulate before a release) parses
// into an entry too, but its version isn't a SemVer, so version filtering in
// AppInfo.UnseenSince skips it — unreleased notes never reach the What's New window.
+//
+// ReleaseNotesParser reads the curated notes a release ships (release-notes/X.Y.Z.en.md,
+// format in .claude/skills/release/SKILL.md § P4): a lede, "**N. Title**" sections with
+// a paragraph each, and "**Also**" with "•" bullets. What's New prefers them over the
+// raw changelog section. No Avalonia here: the smoke test compiles this file directly.
using System;
using System.Collections.Generic;
+using System.Text.RegularExpressions;
namespace Nota.App;
+/// <summary>One version's notes: its number, date and grouped notes. <see cref="Lede"/>
+/// is set only for curated release notes (the changelog has no lede).</summary>
+public sealed record ChangelogEntry(string Version, string Date,
+ IReadOnlyList<ChangelogSection> Sections,
+ string Lede = "")
+{
+ public bool IsReleaseNotes => Lede.Length > 0;
+}
+
+/// <summary>A category within a changelog entry (Added / Changed / Fixed / Removed), or a
+/// feature of curated release notes: its title, a paragraph (<see cref="Text"/>) and/or
+/// bullets.</summary>
+public sealed record ChangelogSection(string Title, IReadOnlyList<string> Items, string Text = "");
+
/// <summary>A comparable semantic version (MAJOR.MINOR.PATCH). Pre-release/build
/// metadata is ignored — the app only ships plain X.Y.Z versions.</summary>
public readonly record struct SemVer(int Major, int Minor, int Patch) : IComparable<SemVer>
@@ -122,3 +142,48 @@ public static class ChangelogParser
return (version, date);
}
}
+
+public static class ReleaseNotesParser
+{
+ // "**1. Studio, a new look**" or "**Also**" alone on a line. The number is the
+ // order in a news post; the window keeps the order and drops the number.
+ private static readonly Regex Heading = new(@"^\*\*(?:\d+\.\s*)?(?<title>(?:(?!\*\*).)+)\*\*$");
+
+ public static ChangelogEntry Parse(string version, string date, string markdown)
+ {
+ var lede = new List<string>();
+ var sections = new List<ChangelogSection>();
+ string? title = null;
+ var text = new List<string>();
+ var items = new List<string>();
+
+ void FlushSection()
+ {
+ if (title != null && (text.Count > 0 || items.Count > 0))
+ sections.Add(new ChangelogSection(title, items.ToArray(), string.Join("\n", text)));
+ title = null;
+ text.Clear();
+ items.Clear();
+ }
+
+ foreach (var raw in markdown.Split('\n'))
+ {
+ var t = raw.Trim();
+ if (t.Length == 0 || t.StartsWith("<!--", StringComparison.Ordinal)) continue;
+
+ if (Heading.Match(t) is { Success: true } m)
+ {
+ FlushSection();
+ title = m.Groups["title"].Value.Trim();
+ }
+ else if (t.StartsWith('•') || t.StartsWith("- ", StringComparison.Ordinal))
+ {
+ if (title != null) items.Add(t[1..].Trim());
+ }
+ else if (title == null) lede.Add(t);
+ else text.Add(t);
+ }
+ FlushSection();
+ return new ChangelogEntry(version, date, sections, string.Join("\n", lede));
+ }
+}
diff --git a/src/managed/Nota.App/Nota.App.csproj b/src/managed/Nota.App/Nota.App.csproj
index 530089bd..7b8b55f7 100644
--- a/src/managed/Nota.App/Nota.App.csproj
+++ b/src/managed/Nota.App/Nota.App.csproj
@@ -36,6 +36,10 @@
<!-- Ship the changelog inside the app so the "What's New" window can parse the
entries for the current version at runtime (avares://Nota.App/Assets/CHANGELOG.md). -->
<AvaloniaResource Include="..\..\..\CHANGELOG.md" Link="Assets/CHANGELOG.md" />
+ <!-- The curated release notes (the GitHub release text): What's New shows a released
+ version's notes from here and falls back to its CHANGELOG.md section without them.
+ English only, like the rest of the UI. -->
+ <AvaloniaResource Include="..\..\..\release-notes\*.en.md" Link="Assets/ReleaseNotes/%(Filename)%(Extension)" />
<!-- Geist + Geist Mono (SIL OFL 1.1, LICENSES/OFL-1.1-Geist.txt): the UI and numeric
typefaces, served as avares://Nota.App/Assets/Fonts#Geist and #Geist Mono. -->
<AvaloniaResource Include="..\..\..\assets\fonts\*.ttf" Link="Assets/Fonts/%(Filename)%(Extension)" />
diff --git a/src/managed/Nota.App/WhatsNewWindow.cs b/src/managed/Nota.App/WhatsNewWindow.cs
index 3db6330f..3883f98c 100644
--- a/src/managed/Nota.App/WhatsNewWindow.cs
+++ b/src/managed/Nota.App/WhatsNewWindow.cs
@@ -2,8 +2,9 @@
// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
//
// "What's new" — shown once after the first launch on a newer app version (see
-// MainWindow.OnOpenedWhatsNew). Lists the changelog entries the user hasn't seen
-// yet, newest first. Reachable any time from the Help menu too.
+// MainWindow.OnOpenedWhatsNew). Lists the versions the user hasn't seen yet, newest
+// first: a release's curated notes (the GitHub release text) where it has them,
+// otherwise its changelog section. Reachable any time from the Help menu too.
using System;
using System.Collections.Generic;
@@ -104,20 +105,45 @@ public sealed class WhatsNewWindow : NotaWindow
});
panel.Children.Add(title);
+ if (entry.IsReleaseNotes)
+ panel.Children.Add(Paragraph(entry.Lede, "Brush.TextPrimary"));
+
foreach (var section in entry.Sections)
{
- panel.Children.Add(new TextBlock
- {
- Classes = { "SectionLabel" },
- Text = section.Title,
- Margin = new Thickness(0, 4, 0, 0),
- });
+ panel.Children.Add(entry.IsReleaseNotes
+ ? new TextBlock
+ {
+ Text = section.Title,
+ FontSize = 13,
+ FontWeight = FontWeight.SemiBold,
+ Foreground = Brush("Brush.TextPrimary"),
+ Margin = new Thickness(0, 6, 0, 0),
+ }
+ : new TextBlock
+ {
+ Classes = { "SectionLabel" },
+ Text = section.Title,
+ Margin = new Thickness(0, 4, 0, 0),
+ });
+ if (section.Text.Length > 0)
+ panel.Children.Add(Paragraph(section.Text, "Brush.TextSecondary"));
foreach (var item in section.Items)
panel.Children.Add(Bullet(item));
}
return panel;
}
+ private Control Paragraph(string text, string brush)
+ {
+ var block = new TextBlock
+ {
+ TextWrapping = TextWrapping.Wrap,
+ Foreground = Brush(brush),
+ };
+ AppendInlineMarkdown(block, text);
+ return block;
+ }
+
private Control Bullet(string text)
{
var row = new Grid { ColumnDefinitions = new ColumnDefinitions("14,*") };
@@ -140,7 +166,7 @@ public sealed class WhatsNewWindow : NotaWindow
return row;
}
- // Renders the inline Markdown the changelog uses: **bold**, *italic*,
+ // Renders the inline Markdown the changelog and release notes use: **bold**, *italic*,
// `code` and [links](url) (link text only). Underscores are left alone —
// they show up inside identifiers like `get_rhythm_macros`.
private void AppendInlineMarkdown(TextBlock block, string text)
diff --git a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
index 3430e4c6..555b44b6 100644
--- a/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
+++ b/tests/Nota.SmokeTest/Nota.SmokeTest.csproj
@@ -43,6 +43,8 @@
<ItemGroup>
<PackageReference Include="Avalonia" Version="12.1.4" />
<Compile Include="..\..\src\managed\Nota.App\Input\ShortcutAvaloniaExtensions.cs" Link="ShortcutAvaloniaExtensions.cs" />
+ <!-- What's New's changelog / release-notes parsers (no Avalonia inside). -->
+ <Compile Include="..\..\src\managed\Nota.App\Changelog.cs" Link="Changelog.cs" />
</ItemGroup>
</Project>
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index 5fb6598b..43d954bb 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -228,6 +228,15 @@ if (args.Length >= 1 && args[0] == "--audition")
return failures == 0 ? 0 : 1;
}
+// What's New release notes alone: `--release-notes`. Also part of the full run.
+if (args.Length >= 1 && args[0] == "--release-notes")
+{
+ Console.WriteLine("-- app: What's New release notes --");
+ foreach (var (ok, label) in ReleaseNotesTests.Run()) Check(ok, label);
+ Console.WriteLine(failures == 0 ? "RELEASE NOTES PASSED" : $"RELEASE NOTES FAILED ({failures})");
+ return failures == 0 ? 0 : 1;
+}
+
// Content-addressed bundle alone (fast iteration): `--bundle`. Also part of the full run.
if (args.Length >= 1 && args[0] == "--bundle")
{
@@ -14865,6 +14874,10 @@ foreach (var (ok, label) in BrowserCategoryTests.Run()) Check(ok, label);
Console.WriteLine("-- browser: preset audition --");
foreach (var (ok, label) in AuditionTests.Run()) Check(ok, label);
+// --- app: What's New shows the curated release notes ---
+Console.WriteLine("-- app: What's New release notes --");
+foreach (var (ok, label) in ReleaseNotesTests.Run()) Check(ok, label);
+
// --- project: content-addressed bundle (samples / plugin states named by hash) ---
Console.WriteLine("-- project: content-addressed bundle --");
foreach (var (ok, label) in BundleContentTests.Run()) Check(ok, label);
diff --git a/tests/Nota.SmokeTest/ReleaseNotesTests.cs b/tests/Nota.SmokeTest/ReleaseNotesTests.cs
new file mode 100644
index 00000000..cce7b0ab
--- /dev/null
+++ b/tests/Nota.SmokeTest/ReleaseNotesTests.cs
@@ -0,0 +1,74 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// What's New shows a release's curated notes (release-notes/X.Y.Z.en.md, the GitHub
+// release text) instead of its raw CHANGELOG.md section. Every shipped notes file must
+// parse into a lede and titled sections, and the parser must read the format the release
+// skill writes. Also runnable alone: `dotnet run --project tests/Nota.SmokeTest -- --release-notes`.
+
+using Nota.App;
+
+namespace Nota.SmokeTest;
+
+internal static class ReleaseNotesTests
+{
+ public static IEnumerable<(bool Ok, string Label)> Run()
+ {
+ const string sample = """
+ <!-- SPDX-License-Identifier: AGPL-3.0-only -->
+ Nota 9.9 is a **big** one.
+
+ **1. First feature**
+ What it is and why it matters.
+
+ **2. Second feature**
+ One paragraph.
+ Another line of it.
+
+ **Also**
+ • a small fix with `code`
+ • **bold** start, plain end
+ """;
+ var e = ReleaseNotesParser.Parse("9.9.1", "2026-01-01", sample);
+ yield return (e.IsReleaseNotes && e.Lede == "Nota 9.9 is a **big** one.",
+ "release notes: the lede is the text before the first heading (SPDX line skipped)");
+ yield return (e.Sections.Count == 3
+ && e.Sections[0].Title == "First feature"
+ && e.Sections[1].Title == "Second feature"
+ && e.Sections[2].Title == "Also",
+ $"release notes: \"**N. Title**\" lines become sections, number dropped ({string.Join(" | ", e.Sections.Select(s => s.Title))})");
+ yield return (e.Sections[1].Text == "One paragraph.\nAnother line of it." && e.Sections[1].Items.Count == 0,
+ "release notes: a feature's paragraph is its text");
+ yield return (e.Sections[2].Items.SequenceEqual(new[] { "a small fix with `code`", "**bold** start, plain end" }),
+ "release notes: \"•\" lines become bullets, and a bold-led bullet isn't a heading");
+
+ var root = RepoRoot();
+ yield return (root is not null, "release notes: repo root found");
+ if (root is null) yield break;
+
+ var changelog = ChangelogParser.Parse(File.ReadAllText(Path.Combine(root, "CHANGELOG.md")));
+ var files = Directory.EnumerateFiles(Path.Combine(root, "release-notes"), "*.en.md").OrderBy(f => f).ToList();
+ yield return (files.Count > 0, $"release notes: shipped EN notes found ({files.Count})");
+ foreach (var f in files)
+ {
+ var version = Path.GetFileName(f)[..^".en.md".Length];
+ var notes = ReleaseNotesParser.Parse(version, "", File.ReadAllText(f));
+ yield return (notes.IsReleaseNotes && notes.Sections.Count > 0
+ && notes.Sections.All(s => s.Title.Length > 0 && (s.Text.Length > 0 || s.Items.Count > 0)),
+ $"release notes {version}: parses into a lede and {notes.Sections.Count} titled sections");
+ yield return (changelog.Any(c => c.Version == version),
+ $"release notes {version}: CHANGELOG.md has its section (What's New pairs them by version)");
+ }
+
+ var csproj = File.ReadAllText(Path.Combine(root, "src/managed/Nota.App/Nota.App.csproj"));
+ yield return (csproj.Contains(@"release-notes\*.en.md") && csproj.Contains("Assets/ReleaseNotes/"),
+ "release notes: Nota.App embeds release-notes/*.en.md where AppInfo reads them");
+ }
+
+ private static string? RepoRoot()
+ {
+ var d = new DirectoryInfo(AppContext.BaseDirectory);
+ while (d is not null && !File.Exists(Path.Combine(d.FullName, "Nota.sln"))) d = d.Parent;
+ return d?.FullName;
+ }
+}