Front-page polish: hero lead card + title-cased labels
Some checks failed
CI / Build · macos-14 · Debug (push) Has been cancelled
CI / Build · macos-15 · Debug (push) Has been cancelled
CI / Build · macos-14 · Release (push) Has been cancelled
CI / Build · macos-15 · Release (push) Has been cancelled

Render the #1 Top Story as an Apple-News-style hero card (flat surface, 4pt
stripe, 24pt headline, summary, sources, prominent score). Prettify category
labels (slug -> Title Case, with AI/US/Formula 1 special-cases) across rows,
hero, and detail. Per Emil's framework, no row entrance/press motion on a
constantly-scrolled surface — invest in hierarchy and defaults instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Robin Kutesa
2026-06-20 18:42:09 +03:00
parent da43399ead
commit 3f0d8348b9
2 changed files with 63 additions and 9 deletions

View File

@@ -106,11 +106,15 @@ enum Signal {
enum Topic {
static func label(_ slug: String) -> String {
switch slug.lowercased() {
case "finance": return "Finance"
case "tech": return "Tech"
case "politics": return "Politics"
case "africa": return "Africa"
default: return slug.prefix(1).uppercased() + slug.dropFirst()
case "ai", "artificial-intelligence": return "AI"
case "us", "united-states": return "US"
case "formula-1": return "Formula 1"
case "ui-ux", "web-design-and-ui-ux": return "Web Design"
default:
// Slug Title Case, e.g. "cloud-computing" "Cloud Computing".
return slug.split(separator: "-")
.map { $0.prefix(1).uppercased() + $0.dropFirst() }
.joined(separator: " ")
}
}