Skip to content

Commit d4a50df

Browse files
voidcraft-devclaude
andcommitted
fix: logo unique gradient IDs, release notes markdown formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2a45120 commit d4a50df

2 files changed

Lines changed: 35 additions & 3 deletions

File tree

src/app/routes/about.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ function openUrl(url: string) {
1313
});
1414
}
1515

16+
function formatReleaseNotes(raw: string): React.ReactNode[] {
17+
const lines = raw
18+
.replace(/\r\n/g, "\n")
19+
.split("\n")
20+
.filter((line) => {
21+
const trimmed = line.trim();
22+
if (trimmed.startsWith("|") && (trimmed.includes("---") || trimmed.includes("平台") || trimmed.includes("Platform"))) return false;
23+
if (trimmed.match(/^\|.*\|$/)) return false;
24+
if (trimmed === "") return false;
25+
return true;
26+
});
27+
28+
return lines.map((line, i) => {
29+
const trimmed = line.trim();
30+
if (trimmed.startsWith("## ")) {
31+
return <h4 key={i} className="text-sm font-semibold text-foreground pt-1">{trimmed.replace(/^##\s+/, "")}</h4>;
32+
}
33+
if (trimmed.startsWith("### ")) {
34+
return <h5 key={i} className="text-xs font-semibold text-foreground/80">{trimmed.replace(/^###\s+/, "")}</h5>;
35+
}
36+
if (trimmed.startsWith("- ") || trimmed.startsWith("* ")) {
37+
return <p key={i} className="pl-3 before:content-['•'] before:mr-1.5 before:text-amber-400/60">{trimmed.replace(/^[-*]\s+/, "")}</p>;
38+
}
39+
return <p key={i}>{trimmed}</p>;
40+
});
41+
}
42+
1643
export default function AboutPage() {
1744
const { t, snapshot } = useDesktop();
1845
const [updateInfo, setUpdateInfo] = useState<UpdateInfo | null>(null);
@@ -111,7 +138,9 @@ export default function AboutPage() {
111138
{updateInfo.releaseNotes && (
112139
<details className="mt-3">
113140
<summary className="cursor-pointer text-xs font-medium text-quiet hover:text-foreground">{t("releaseNotes")}</summary>
114-
<pre className="mt-2 max-h-40 overflow-y-auto whitespace-pre-wrap rounded-xl border border-border/50 bg-background/50 p-3 text-xs leading-relaxed text-quiet">{updateInfo.releaseNotes}</pre>
141+
<div className="mt-2 max-h-48 overflow-y-auto rounded-xl border border-border/50 bg-background/50 p-4 text-xs leading-relaxed text-quiet space-y-2">
142+
{formatReleaseNotes(updateInfo.releaseNotes)}
143+
</div>
115144
</details>
116145
)}
117146
</div>

src/components/logo.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { useId } from "react"
12
import { cn } from "@/lib/utils"
23

34
export function AppLogo({ className }: { className?: string }) {
5+
const id = useId()
6+
const gradId = `logo-fg-${id}`
47
const isDark = document.documentElement.style.colorScheme !== "light"
58
const bgColor = isDark ? "#1C1917" : "#F5F0EB"
69
const gradientFrom = isDark ? "#F97316" : "#EA580C"
@@ -13,7 +16,7 @@ export function AppLogo({ className }: { className?: string }) {
1316
aria-hidden="true"
1417
>
1518
<defs>
16-
<radialGradient id="logo-fg" cx="42%" cy="38%">
19+
<radialGradient id={gradId} cx="42%" cy="38%">
1720
<stop offset="0%" stopColor={gradientFrom} />
1821
<stop offset="100%" stopColor={gradientTo} />
1922
</radialGradient>
@@ -22,7 +25,7 @@ export function AppLogo({ className }: { className?: string }) {
2225
<path
2326
fillRule="evenodd"
2427
d="M 72,184 C 72,120 120,72 184,72 L 328,72 C 392,72 440,120 440,184 L 440,328 C 440,392 392,440 328,440 L 184,440 C 120,440 72,392 72,328 Z M 156,380 L 156,164 L 256,316 L 356,164 L 356,380 L 308,380 L 308,224 L 256,344 L 204,224 L 204,380 Z"
25-
fill="url(#logo-fg)"
28+
fill={`url(#${gradId})`}
2629
/>
2730
</svg>
2831
)

0 commit comments

Comments
 (0)