feat(decks): Tile-Redesign — Tap=Study, Edit-Icon, Explore-Konsistenz

User-Feedback umgesetzt:
- Tap auf Deck-Tile öffnet jetzt direkt den Study-Mode für dieses
  Deck (statt Deck-Detail). DeckRoute-Enum mit .study/.detail-Cases
  + programmatic NavigationPath.
- Edit-Icon (Pencil) unten rechts auf der Tile in Muted-Circle-Badge;
  Tap führt in den Deck-Detail-View (Browse Cards + Bearbeiten).
- Kategorie-Icon oben rechts jetzt in primary-Farbe (war muted) +
  größer (.title2 statt .title3) — visuell prominenter.
- Inbox-Banner ist jetzt als Button → Study-Mode mit dem ersten
  Inbox-Deck.

ExploreView/PublicDeckCard:
- Selbes Tile-Layout wie DeckStackTile (5:7 Aspect-Ratio, CardSurface,
  Kategorie-Icon oben rechts, Footer mit Counts + Owner).
- Featured-Star-Badge oben links statt rechts (damit Kategorie-Icon
  konsistent rechts bleibt).
- Star-Count als ausgefüllter Stern in warning-Farbe.
- Owner-Name unter den Counts, mit verified-Seal wenn vorhanden.

Build 10 → 11. 43 Tests grün.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-05-13 18:03:47 +02:00
parent 33101d703d
commit 90201d7199
4 changed files with 153 additions and 73 deletions

View file

@ -124,57 +124,91 @@ enum MarketplaceRoute: Hashable {
}
/// Public-Deck-Karten-Tile in Featured/Trending-Carousels und Browse-Grid.
/// Selbes Tile-Layout wie DeckStackTile (5:7 Aspect-Ratio,
/// CardSurface, Kategorie-Icon oben rechts), aber für PublicDeckEntry-
/// Daten. Star-Count statt Edit-Button unten rechts.
struct PublicDeckCard: View {
let entry: PublicDeckEntry
var body: some View {
VStack(alignment: .leading, spacing: 8) {
HStack {
Text(entry.title)
.font(.headline)
.foregroundStyle(CardsTheme.foreground)
.lineLimit(2)
Spacer()
ZStack {
CardSurface(size: .md, elevation: .standard, colorAccentHex: nil) {
cardContent
}
}
.aspectRatio(5.0 / 7.0, contentMode: .fit)
.frame(maxWidth: 280)
}
private var cardContent: some View {
VStack(alignment: .leading, spacing: 6) {
HStack(alignment: .top) {
if entry.isFeatured {
Image(systemName: "star.fill")
.font(.caption)
.foregroundStyle(CardsTheme.warning)
}
Spacer()
Image(systemName: categorySymbol)
.font(.title2)
.foregroundStyle(CardsTheme.primary.opacity(0.85))
}
if let description = entry.description, !description.isEmpty {
Text(description)
.font(.caption)
.foregroundStyle(CardsTheme.mutedForeground)
.lineLimit(2)
}
HStack(spacing: 12) {
Label("\(entry.cardCount)", systemImage: "rectangle.stack")
Label("\(entry.starCount)", systemImage: "star")
if entry.isPaid {
Label("\(entry.priceCredits) Credits", systemImage: "creditcard")
.foregroundStyle(CardsTheme.primary)
Spacer(minLength: 0)
VStack(alignment: .leading, spacing: 6) {
Text(entry.title)
.font(.system(size: 17, weight: .semibold))
.foregroundStyle(CardsTheme.foreground)
.lineLimit(3)
if let description = entry.description, !description.isEmpty {
Text(description)
.font(.caption)
.foregroundStyle(CardsTheme.mutedForeground)
.lineLimit(2)
}
}
.font(.caption2)
.foregroundStyle(CardsTheme.mutedForeground)
HStack(spacing: 4) {
Text(entry.owner.displayName)
.font(.caption2)
.foregroundStyle(CardsTheme.mutedForeground)
if entry.owner.verifiedMana {
Image(systemName: "checkmark.seal.fill")
Spacer(minLength: 0)
VStack(alignment: .leading, spacing: 6) {
HStack(spacing: 8) {
Label("\(entry.cardCount)", systemImage: "rectangle.stack")
.font(.caption2)
.foregroundStyle(CardsTheme.primary)
.foregroundStyle(CardsTheme.mutedForeground)
Label("\(entry.starCount)", systemImage: "star.fill")
.font(.caption2)
.foregroundStyle(CardsTheme.warning)
if entry.isPaid {
Label("\(entry.priceCredits)", systemImage: "creditcard")
.font(.caption2.weight(.semibold))
.foregroundStyle(CardsTheme.primary)
}
Spacer()
}
HStack(spacing: 4) {
Text(entry.owner.displayName)
.font(.caption2)
.foregroundStyle(CardsTheme.mutedForeground)
.lineLimit(1)
if entry.owner.verifiedMana {
Image(systemName: "checkmark.seal.fill")
.font(.caption2)
.foregroundStyle(CardsTheme.primary)
}
}
}
}
.padding(12)
.frame(width: 260, alignment: .leading)
.background(CardsTheme.surface, in: RoundedRectangle(cornerRadius: 10))
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(CardsTheme.border, lineWidth: 1)
)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
}
private var categorySymbol: String {
guard let category = entry.category,
let parsed = DeckCategory(rawValue: category)
else {
return "rectangle.stack"
}
return parsed.systemImageName
}
}