Spaces:
Running
Running
fix: filter auto-generated release notes, show fallback message
Browse files- src/pages/Download.jsx +89 -48
src/pages/Download.jsx
CHANGED
|
@@ -88,6 +88,32 @@ function formatDate(dateString) {
|
|
| 88 |
});
|
| 89 |
}
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
// Windows Icon
|
| 92 |
function WindowsIcon({ sx = {} }) {
|
| 93 |
return (
|
|
@@ -728,54 +754,69 @@ export default function Download() {
|
|
| 728 |
)}
|
| 729 |
</Stack>
|
| 730 |
|
| 731 |
-
{
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 779 |
</Box>
|
| 780 |
))}
|
| 781 |
</Stack>
|
|
|
|
| 88 |
});
|
| 89 |
}
|
| 90 |
|
| 91 |
+
// Clean release body - filter out auto-generated GitHub content
|
| 92 |
+
function cleanReleaseBody(body) {
|
| 93 |
+
if (!body) return null;
|
| 94 |
+
|
| 95 |
+
// Filter out lines that are auto-generated or not useful
|
| 96 |
+
const filteredLines = body
|
| 97 |
+
.split('\n')
|
| 98 |
+
.filter(line => {
|
| 99 |
+
const trimmed = line.trim();
|
| 100 |
+
// Skip HTML comments
|
| 101 |
+
if (trimmed.startsWith('<!--') || trimmed.endsWith('-->')) return false;
|
| 102 |
+
// Skip "Full Changelog" links
|
| 103 |
+
if (trimmed.startsWith('**Full Changelog**:')) return false;
|
| 104 |
+
// Skip generic placeholder messages
|
| 105 |
+
if (trimmed === 'See the assets to download this version and install.') return false;
|
| 106 |
+
return true;
|
| 107 |
+
})
|
| 108 |
+
.join('\n')
|
| 109 |
+
.trim();
|
| 110 |
+
|
| 111 |
+
// If nothing meaningful left, return null
|
| 112 |
+
if (!filteredLines || filteredLines.length < 10) return null;
|
| 113 |
+
|
| 114 |
+
return filteredLines;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
// Windows Icon
|
| 118 |
function WindowsIcon({ sx = {} }) {
|
| 119 |
return (
|
|
|
|
| 754 |
)}
|
| 755 |
</Stack>
|
| 756 |
|
| 757 |
+
{(() => {
|
| 758 |
+
const cleanedBody = cleanReleaseBody(release.body);
|
| 759 |
+
if (cleanedBody) {
|
| 760 |
+
return (
|
| 761 |
+
<Typography
|
| 762 |
+
variant="body2"
|
| 763 |
+
sx={{
|
| 764 |
+
color: 'rgba(255,255,255,0.6)',
|
| 765 |
+
whiteSpace: 'pre-line',
|
| 766 |
+
lineHeight: 1.7,
|
| 767 |
+
'& strong, & b': { color: 'rgba(255,255,255,0.8)' },
|
| 768 |
+
}}
|
| 769 |
+
>
|
| 770 |
+
{cleanedBody.split('\n').map((line, i) => {
|
| 771 |
+
// Simple markdown parsing for headers and lists
|
| 772 |
+
if (line.startsWith('### ')) {
|
| 773 |
+
return (
|
| 774 |
+
<Box
|
| 775 |
+
key={i}
|
| 776 |
+
component="span"
|
| 777 |
+
sx={{
|
| 778 |
+
display: 'block',
|
| 779 |
+
fontWeight: 600,
|
| 780 |
+
color: 'rgba(255,255,255,0.8)',
|
| 781 |
+
mt: i > 0 ? 1.5 : 0,
|
| 782 |
+
mb: 0.5,
|
| 783 |
+
}}
|
| 784 |
+
>
|
| 785 |
+
{line.replace('### ', '')}
|
| 786 |
+
</Box>
|
| 787 |
+
);
|
| 788 |
+
}
|
| 789 |
+
if (line.startsWith('- ')) {
|
| 790 |
+
return (
|
| 791 |
+
<Box key={i} component="span" sx={{ display: 'block', pl: 2 }}>
|
| 792 |
+
• {line.replace('- ', '')}
|
| 793 |
+
</Box>
|
| 794 |
+
);
|
| 795 |
+
}
|
| 796 |
+
if (line.trim() === '') return null;
|
| 797 |
+
return <Box key={i} component="span" sx={{ display: 'block' }}>{line}</Box>;
|
| 798 |
+
})}
|
| 799 |
+
</Typography>
|
| 800 |
+
);
|
| 801 |
+
}
|
| 802 |
+
// No meaningful release notes - show link to changelog
|
| 803 |
+
return (
|
| 804 |
+
<Typography
|
| 805 |
+
variant="body2"
|
| 806 |
+
sx={{ color: 'rgba(255,255,255,0.5)' }}
|
| 807 |
+
>
|
| 808 |
+
Bug fixes and improvements.{' '}
|
| 809 |
+
<Box
|
| 810 |
+
component="a"
|
| 811 |
+
href={`https://github.com/pollen-robotics/reachy-mini-desktop-app/compare/${release.tag_name.replace('v', 'v')}...${release.tag_name}`}
|
| 812 |
+
target="_blank"
|
| 813 |
+
sx={{ color: '#FF9500', textDecoration: 'none', '&:hover': { textDecoration: 'underline' } }}
|
| 814 |
+
>
|
| 815 |
+
View changes →
|
| 816 |
+
</Box>
|
| 817 |
+
</Typography>
|
| 818 |
+
);
|
| 819 |
+
})()}
|
| 820 |
</Box>
|
| 821 |
))}
|
| 822 |
</Stack>
|