Add draft indicator, filter drafts, show issue count

This commit is contained in:
Christoph Hagen
2025-01-07 14:03:07 +01:00
parent 9d95e7d210
commit 508483071a
10 changed files with 124 additions and 32 deletions

View File

@ -0,0 +1,15 @@
import SwiftUI
struct DraftIndicator: View {
var body: some View {
Text("Draft")
.foregroundStyle(.white)
.padding(.vertical, 2)
.padding(.horizontal, 5)
.background(
RoundedRectangle(cornerRadius: 5, style: .circular)
.foregroundStyle(Color.gray)
)
}
}

View File

@ -31,7 +31,13 @@ struct PageListView: View {
.textFieldStyle(.roundedBorder)
.padding(.horizontal, 8)
List(filteredPages, selection: $selectedPage) { page in
Text(page.localized(in: language).title).tag(page)
HStack {
Text(page.title(in: language))
Spacer()
if page.isDraft {
DraftIndicator()
}
}.tag(page)
}
}
.onAppear {

View File

@ -31,7 +31,13 @@ struct PostListView: View {
.textFieldStyle(.roundedBorder)
.padding(.horizontal, 8)
List(filteredPosts, selection: $selectedPost) { post in
Text(post.title(in: language)).tag(post)
HStack {
Text(post.title(in: language))
Spacer()
if post.isDraft {
DraftIndicator()
}
}.tag(post)
}
}.onAppear {
if selectedPost == nil {

View File

@ -61,56 +61,56 @@ struct GenerationContentView: View {
Text("\(content.results.requiredFiles.count) files")
}
List {
Section("Empty pages") {
ForEach(content.results.emptyPages.sorted()) { id in
Text("\(id.pageId) (\(id.language))")
}
}
Section("Inaccessible files") {
Section("Inaccessible files (\(content.results.inaccessibleFiles.count))") {
ForEach(content.results.inaccessibleFiles.sorted()) { file in
Text(file.id)
}
}
Section("Unparsable files") {
Section("Unparsable files (\(content.results.unparsableFiles.count))") {
ForEach(content.results.unparsableFiles.sorted()) { file in
Text(file.id)
}
}
Section("Missing files") {
Section("Missing files (\(content.results.missingFiles.count))") {
ForEach(content.results.missingFiles.sorted(), id: \.self) { file in
Text(file)
}
}
Section("Missing tags") {
Section("Missing tags (\(content.results.missingTags.count))") {
ForEach(content.results.missingTags.sorted(), id: \.self) { tag in
Text(tag)
}
}
Section("Missing pages") {
Section("Missing pages (\(content.results.missingPages.count))") {
ForEach(content.results.missingPages.sorted(), id: \.self) { page in
Text(page)
}
}
Section("Invalid commands") {
Section("Invalid commands (\(content.results.invalidCommands.count))") {
ForEach(content.results.invalidCommands.sorted(), id: \.self) { markdown in
Text(markdown)
}
}
Section("Invalid blocks") {
Section("Invalid blocks (\(content.results.invalidBlocks.count))") {
ForEach(content.results.invalidBlocks.sorted(), id: \.self) { markdown in
Text(markdown)
}
}
Section("Warnings") {
Section("Warnings (\(content.results.warnings.count))") {
ForEach(content.results.warnings.sorted(), id: \.self) { warning in
Text(warning)
}
}
Section("Unsaved output files") {
Section("Unsaved output files (\(content.results.unsavedOutputFiles.count))") {
ForEach(content.results.unsavedOutputFiles.sorted(), id: \.self) { file in
Text(file)
}
}
Section("Empty pages (\(content.results.emptyPages.count))") {
ForEach(content.results.emptyPages.sorted()) { id in
Text("\(id.pageId) (\(id.language))")
}
}
}
}.padding()
}