Boards, lanes, and cards all show their frontmatter icon leading the row, tinted through the palette with a secondary fallback; the board scanner now reads icon and iconColor from the same one-file parse as the title. Lane and card lists gain the segmented Manual/Name/Recent control — display-only sorting layered over the rank order, never rewriting what's on disk. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
24 lines
867 B
Swift
24 lines
867 B
Swift
import SwiftUI
|
|
|
|
/// The leading icon a list row renders when its item has one — the symbol name straight from
|
|
/// frontmatter, tinted through the palette with `.secondary` standing in for any name the
|
|
/// palette does not know. Decorative: the row's text is the accessible content.
|
|
struct ItemIconView: View {
|
|
let icon: String?
|
|
let iconColor: String?
|
|
|
|
var body: some View {
|
|
if let icon, !icon.isEmpty {
|
|
Image(systemName: icon)
|
|
.foregroundStyle(tint)
|
|
.accessibilityHidden(true)
|
|
}
|
|
}
|
|
|
|
/// An unrecognized colour name falls back to `.secondary` rather than guessing — the same
|
|
/// leniency `CardPalette.color(named:in:)` documents for itself.
|
|
private var tint: Color {
|
|
iconColor.flatMap { CardPalette.color(named: $0, in: CardPalette.foregrounds) } ?? .secondary
|
|
}
|
|
}
|