Front-page polish: hero lead card + title-cased labels
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:
@@ -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: " ")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user