refactor(update-dialog): improve changelog formatting

This commit is contained in:
Bohdan Triapitsyn
2025-12-15 14:32:55 +02:00
parent 17c72a020e
commit db4a4e6314
2 changed files with 17 additions and 3 deletions
+4
View File
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
- Optimized diff view layout with smaller fonts and compact hunk separators
- Improved mobile experience: simplified header, better diff file selector
- Redesigned password-protected session unlock screen
## [1.1.5] - 2025-12-15 ## [1.1.5] - 2025-12-15
+13 -3
View File
@@ -75,9 +75,19 @@ export const UpdateDialog: React.FC<UpdateDialogProps> = ({
> >
<div className="text-sm text-muted-foreground whitespace-pre-wrap pr-3"> <div className="text-sm text-muted-foreground whitespace-pre-wrap pr-3">
{info.body {info.body
.replace(/^## \[(\d+\.\d+\.\d+)\] - \d{4}-\d{2}-\d{2}\s*/gm, '— v$1 —\n') .split(/^## \[(\d+\.\d+\.\d+)\] - \d{4}-\d{2}-\d{2}\s*/gm)
.replace(/^- /gm, '• ') .filter(Boolean)
.trim()} .map((part, index) => {
if (/^\d+\.\d+\.\d+$/.test(part.trim())) {
return (
<span key={index} className="font-semibold text-foreground">
v{part.trim()}
{'\n'}
</span>
);
}
return part.replace(/^- /gm, '• ').trim() + '\n\n';
})}
</div> </div>
</ScrollableOverlay> </ScrollableOverlay>
)} )}