diff --git a/src/ui/locales/en.json b/src/ui/locales/en.json index 7a0388277..b3b644f07 100644 --- a/src/ui/locales/en.json +++ b/src/ui/locales/en.json @@ -2108,8 +2108,9 @@ "releaseNotes": "Release notes", "noReleaseNotes": "No notes for this version.", "viewRelease": "View on GitHub", - "showAllReleases": "Show all {{count}}", - "showFewerReleases": "Show fewer", + "showOlderReleases": "Older releases ({{count}})", + "hideOlderReleases": "Hide older releases", + "showMoreChanges": "Show {{count}} more", "videoTitle": "{{name}} video", "changeTypes": { "added": "Added", diff --git a/src/ui/plugins/PluginReleaseNotes.tsx b/src/ui/plugins/PluginReleaseNotes.tsx index 393e313d9..621285462 100644 --- a/src/ui/plugins/PluginReleaseNotes.tsx +++ b/src/ui/plugins/PluginReleaseNotes.tsx @@ -12,7 +12,8 @@ import { type ReleaseRow, } from "./plugin-model"; -const SHOWN = 3; +/** A long release shows this many changes until it is opened up. */ +const MAX_CHANGES = 8; function formatDate(value: string | null): string { if (!value) return ""; @@ -48,7 +49,17 @@ function Release({ installedVersion: string | null; }) { const { t } = useTranslation(); - const groups = groupChanges(row.changes); + const [full, setFull] = useState(false); + const all = groupChanges(row.changes); + const hidden = full ? 0 : Math.max(0, row.changes.length - MAX_CHANGES); + let budget = full ? Infinity : MAX_CHANGES; + const groups = all + .map((group) => { + const items = group.items.slice(0, Math.max(0, budget)); + budget -= items.length; + return { ...group, items }; + }) + .filter((group) => group.items.length > 0); return (
+