ba06db98c5
- CHANGELOG.md (Wurzel): Unveroeffentlicht (bwo + dyv + diese Seite, 8 Punkte) und 1.0.0 – 2026-09-15 (11 Punkte aus den Handbuechern), Alltagssprache, echte Umlaute - next.config.ts liest CHANGELOG.md zur Bauzeit nach env.TESSERA_CHANGELOG_MD; .dockerignore-Ausnahme !CHANGELOG.md und COPY-Zeile im Web-Dockerfile - lib/changelog.ts: filterChangelogForChannel (live ohne Unveroeffentlicht, beta/dev mit "Noch nicht freigegeben (Beta)", leerer Abschnitt ausgeblendet), 10 Tests - Server-Seite /changelog (MDEditor.Markdown + rehype-sanitize, Hinweis auf Beta, Leer-Text), 3 Tests; Versionszeile ist Link mit aria-label, 2 Tests - de/en: sidebar.whatsNew und Namensraum changelog; Web-Suite 49/309, tsc 0 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018N9CD3ebPKm1b32bPpBknY
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
'use client';
|
|
|
|
import { useEffect, useState } from 'react';
|
|
import Link from 'next/link';
|
|
import { useTranslations } from 'next-intl';
|
|
import { type ApiVersionInfo, appVersion, loadApiVersion } from '@/lib/app-version';
|
|
|
|
/**
|
|
* Versionszeile unten in der Seitenleiste: `<Version> · <Kanal>`, z. B.
|
|
* `v1.0.0 · Beta` oder lokal `dev · Entwicklung` (quick-260914-ku1).
|
|
* Der Tooltip nennt den Web-Commit und, sobald geladen, die API-Version
|
|
* samt Kanal. "Commit" und "API" sind in beiden Sprachen gleich.
|
|
* Seit quick-260916-dcz ist die Zeile ein Link zur Seite "Was ist neu"
|
|
* (/changelog); der Tooltip bleibt, der Linkname steht im aria-label.
|
|
*/
|
|
export function AppVersionBadge() {
|
|
const t = useTranslations('sidebar');
|
|
const [api, setApi] = useState<ApiVersionInfo | null>(null);
|
|
|
|
useEffect(() => {
|
|
let active = true;
|
|
loadApiVersion().then((info) => {
|
|
if (active) setApi(info);
|
|
});
|
|
return () => {
|
|
active = false;
|
|
};
|
|
}, []);
|
|
|
|
const parts: string[] = [];
|
|
if (appVersion.commit) parts.push(`Commit ${appVersion.commit}`);
|
|
if (api) parts.push(`API ${api.version} (${api.channel})`);
|
|
const title = parts.length > 0 ? parts.join(' · ') : undefined;
|
|
|
|
return (
|
|
<Link
|
|
href="/changelog"
|
|
data-testid="app-version"
|
|
aria-label={t('whatsNew')}
|
|
title={title}
|
|
className="block truncate text-xs text-muted-foreground transition-colors hover:text-foreground hover:underline"
|
|
>
|
|
{appVersion.version} · {t(`channel.${appVersion.channel}`)}
|
|
</Link>
|
|
);
|
|
}
|