feat(admin): link version numbers in sidebar to GitHub release notes (#566)

Closes #566.

The admin sidebar showed the running frontend + backend versions as
plain text. Wraps each version (and the "update available" indicator)
in an anchor pointing at the corresponding GitHub release tag, opening
in a new tab so the admin session isn't disrupted.

A small githubReleaseUrl helper (extracted to its own module for
testability) does the version → URL mapping. Because release-please
tags every release as `vX.Y.Z[-beta.N]`, the version string already
carries the channel suffix and a pure template covers both stable and
beta without branching.

Three unit tests pin the URL template — stable, beta-with-suffix, and
a defensive check that the leading `v` isn't double-prefixed if a
caller accidentally passes a tag-shaped value.
This commit is contained in:
Paul Nothaft
2026-05-29 10:25:12 +02:00
parent 3ceeccd85a
commit d231623c59
3 changed files with 79 additions and 6 deletions
+14
View File
@@ -0,0 +1,14 @@
/**
* Build the GitHub release page URL for a given version string.
*
* Version strings already carry their channel suffix (e.g. `3.55.0`
* for stable, `3.55.0-beta.0` for beta). release-please tags every
* release as `vX.Y.Z[-beta.N]`, so a pure string template covers
* both channels without branching on the suffix.
*
* Used by the admin sidebar version display to deep-link to release
* notes for the running version (#566) and by the update-available
* indicator to link to the upgrade target's notes.
*/
export const githubReleaseUrl = (version: string): string =>
`https://github.com/the-luap/picpeak/releases/tag/v${version}`;