feat(sidebar): link the version row to the public changelog

ha-relevant: maybe
This commit is contained in:
Pouzor
2026-08-15 02:32:40 +02:00
parent 824aa5d044
commit fafbaeffcd
2 changed files with 26 additions and 8 deletions
+19 -8
View File
@@ -388,14 +388,25 @@ function VersionBadge() {
return (
<div className="px-3 py-2 border-t border-border flex flex-col gap-1">
<a
href={`https://github.com/Pouzor/homelable/releases/tag/v${current}`}
target="_blank"
rel="noopener noreferrer"
className="font-mono text-[11px] text-muted-foreground hover:text-foreground transition-colors"
>
v{current}
</a>
<div className="flex items-center gap-1.5">
<a
href={`https://github.com/Pouzor/homelable/releases/tag/v${current}`}
target="_blank"
rel="noopener noreferrer"
className="font-mono text-[11px] text-muted-foreground hover:text-foreground transition-colors"
>
v{current}
</a>
<span className="text-[11px] text-muted-foreground">-</span>
<a
href="https://homelable.net/changelog/"
target="_blank"
rel="noopener noreferrer"
className="text-[11px] text-[#00d4ff] hover:text-[#00d4ff]/80 transition-colors"
>
Changelog
</a>
</div>
{hasUpdate && latest && (
<a
href={latest.url.startsWith('https://') ? latest.url : '#'}
@@ -83,6 +83,13 @@ describe('VersionBadge', () => {
expect(link).toHaveAttribute('target', '_blank')
})
it('links to the public changelog next to the version', () => {
renderSidebar()
const link = screen.getByText('Changelog').closest('a')
expect(link).toHaveAttribute('href', 'https://homelable.net/changelog/')
expect(link).toHaveAttribute('target', '_blank')
})
it('does not show update badge when on latest version', () => {
renderSidebar()
expect(screen.queryByText(/available/)).not.toBeInTheDocument()