Stemify iOS 1.1 and WebUI updates, repo restructure into desktop/ios/server/web
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
894dd5a695
commit
df5d847169
157 files changed
+3935
-742
No files matched your search
@@ -87,6 +87,7 @@ struct AlbumGrid<Badge: View>: View {
|
||||
var showArtist = true
|
||||
var subtitle: ((Album) -> String?)?
|
||||
var menu: ((Album) -> [SheetAction])?
|
||||
var columns = 2
|
||||
let open: (Album) -> Void
|
||||
@ViewBuilder var badge: (Album) -> Badge
|
||||
|
||||
@@ -94,7 +95,9 @@ struct AlbumGrid<Badge: View>: View {
|
||||
|
||||
var body: some View {
|
||||
let cov = AppGraph.shared.coverage.albums
|
||||
LazyVGrid(columns: [GridItem(.flexible(), spacing: 16, alignment: .top), GridItem(.flexible(), spacing: 16, alignment: .top)], spacing: 18) {
|
||||
let small = columns >= 4
|
||||
let gap: CGFloat = columns > 2 ? 10 : 16
|
||||
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: gap, alignment: .top), count: columns), spacing: small ? 12 : 18) {
|
||||
ForEach(albums) { a in
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
GeometryReader { geo in
|
||||
@@ -103,12 +106,12 @@ struct AlbumGrid<Badge: View>: View {
|
||||
}
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
HStack(spacing: 6) {
|
||||
Text(a.title).font(.subheadline.weight(.medium)).foregroundStyle(p.label).lineLimit(1)
|
||||
Text(a.title).font((small ? Font.caption : .subheadline).weight(.medium)).foregroundStyle(p.label).lineLimit(1)
|
||||
StemFlag(cov: cov[a.ratingKey])
|
||||
}
|
||||
.padding(.top, 6)
|
||||
let sub = subtitle?(a) ?? (showArtist ? a.artist : a.year.map(String.init) ?? "")
|
||||
if !sub.isEmpty { Text(sub).font(.subheadline).foregroundStyle(p.label2).lineLimit(1) }
|
||||
if !sub.isEmpty { Text(sub).font(small ? .caption : .subheadline).foregroundStyle(p.label2).lineLimit(1) }
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture { open(a) }
|
||||
@@ -120,8 +123,8 @@ struct AlbumGrid<Badge: View>: View {
|
||||
}
|
||||
|
||||
extension AlbumGrid where Badge == EmptyView {
|
||||
init(albums: [Album], showArtist: Bool = true, subtitle: ((Album) -> String?)? = nil, menu: ((Album) -> [SheetAction])? = nil, open: @escaping (Album) -> Void) {
|
||||
self.init(albums: albums, showArtist: showArtist, subtitle: subtitle, menu: menu, open: open) { _ in EmptyView() }
|
||||
init(albums: [Album], showArtist: Bool = true, subtitle: ((Album) -> String?)? = nil, menu: ((Album) -> [SheetAction])? = nil, columns: Int = 2, open: @escaping (Album) -> Void) {
|
||||
self.init(albums: albums, showArtist: showArtist, subtitle: subtitle, menu: menu, columns: columns, open: open) { _ in EmptyView() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user