What's new stays short as releases pile up

- Admin → About shows the running version's release notes, with a link
  to all releases.
- The What's new page keeps the running version (and any newer) open and
  folds each older release to one line, grouped by month: its version
  and a count of its changes, fixes and notes for administrators.
- CHANGELOG.md itself is unchanged and reads the same on GitHub; the
  app splits it into releases when shown (Changelog).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-15 13:38:45 -05:00
1 parent e4bc3a5b7b
commit e8b0cd030e
10 files changed
+218 -3

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
require "test_helper"
# What's new: the running version's notes on About, and the history with
# older releases folded to one line each, by month.
class ChangelogPageTest < ActionDispatch::IntegrationTest
test "the history opens this version and folds older releases, grouped by month" do
log = Changelog.load
version = SystemInfo.new.version
sign_in create_user
get help_page_path("changelog")
assert_response :success
assert_select "details.release", log.releases.size
assert_select "details.release[open]##{log.release(version).anchor}" do
assert_select "summary .badge-blue", text: "This version"
end
older = log.releases.drop(log.releases.index { _1.version == version } + 1)
older.each { |r| assert_select "details.release:not([open])##{r.anchor} summary", text: /#{Regexp.escape(r.version)}.*(change|fix|for administrators|note)/m }
assert_select "h2", text: "November 2026"
end
test "About shows what's new in the running version, linking to all releases" do
version = SystemInfo.new.version
sign_in create_user("admin@example.com", admin: true)
get admin_about_path
assert_select "#whats-new" do
assert_select "h2", text: "What's new in #{version}"
assert_select "a[href='#{help_page_path('changelog')}']", text: "All releases"
assert_select "h3", minimum: 1 # its sections (Changes, Fixes, ...)
end
end
end
+1 -1
View File
@@ -19,7 +19,7 @@ class VersioningTest < ActionDispatch::IntegrationTest
get help_page_path("changelog")
assert_response :success
assert_select "h1", text: /What.s new/
assert_select "h2", text: version # the current version has release notes
assert_select "details[open] summary h3", text: version # the current version has release notes
end
test "each recorded software build remembers its version" do
+62
View File
@@ -0,0 +1,62 @@
require "test_helper"
class ChangelogTest < ActiveSupport::TestCase
SAMPLE = <<~MD
# What's new
The newest release is first.
## 2026.12.0
### Changes
- One
- Two
- (a nested point, not counted)
### Fixes
- A fix
## 2026.11.1
### For administrators
- Set `TZ`
## 2026.11.0
### Flying
- First
- Second
MD
setup { @log = Changelog.new(SAMPLE) }
test "splits the file into its title, intro and releases, newest first" do
assert_equal "What's new", @log.title
assert_equal "The newest release is first.", @log.intro
assert_equal %w[2026.12.0 2026.11.1 2026.11.0], @log.releases.map(&:version)
assert_equal Date.new(2026, 11, 1), @log.release("2026.11.1").month_start
assert_equal "v2026-11-1", @log.release("2026.11.1").anchor
end
test "counts the top-level items under each section" do
assert_equal({ changes: 2, fixes: 1 }, @log.release("2026.12.0").counts)
assert_equal({ administrators: 1 }, @log.release("2026.11.1").counts)
assert_equal({ notes: 2 }, @log.release("2026.11.0").counts) # other headings
end
test "the running version and newer are open; the newest when the running one has no notes" do
assert_equal [ true, true, false ], @log.releases.map { @log.open?(_1, running: "2026.11.1") }
assert_equal [ true, false, false ], @log.releases.map { @log.open?(_1, running: "unreleased") }
end
test "the real CHANGELOG.md parses, with notes for the current version" do
log = Changelog.load
assert log.releases.size >= 1
assert log.release(SystemInfo.new.version), "CHANGELOG.md has no section for VERSION"
log.releases.each { assert_predicate _1.counts.values.sum, :positive?, "#{_1.version} has no counted items" }
end
end