Commit ddda8823b7
ddda8823b7d845f90fc5ef7f7350a9ef70f797c5
parent: 596d6a1f7d
Verified · cmc
cmc <hello@cleberg.net> · 2026-09-22 22:06 UTC
Preview under every markup editor
Issue and MR bodies on create and edit, their comments, release notes,
and a .md, .markdown or .org file in the file editor.
Layout: unified · split
gitbay/Views/Issues/IssueView.swift
+5
| @@ -172,6 +172,7 @@ struct IssueView: View { |
| 172 | 172 | HStack { |
| 173 | 173 | TextField("Comment", text: $commentText, axis: .vertical) |
| 174 | 174 | .lineLimit(1...5) |
| 175 | .accessibilityIdentifier("issue-comment-field") |
| 175 | 176 | Picker("Format", selection: $commentFormat) { |
| 176 | 177 | Text("Markdown").tag("md") |
| 177 | 178 | Text("Org").tag("org") |
| @@ -190,6 +191,10 @@ struct IssueView: View { |
| 190 | 191 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
| 191 | 192 | || model.working) |
| 192 | 193 | } |
| 194 | if !commentText.isEmpty { |
| 195 | MarkupPreview(text: commentText, format: commentFormat, |
| 196 | identifier: "issue-comment-preview") |
| 197 | } |
| 193 | 198 | } |
| 194 | 199 | } |
| 195 | 200 | |
gitbay/Views/MRs/MRListView.swift
+1
| @@ -131,6 +131,7 @@ private struct MRCreateSheet: View { |
| 131 | 131 | } |
| 132 | 132 | .pickerStyle(.segmented) |
| 133 | 133 | .accessibilityIdentifier("mr-format") |
| 134 | MarkupPreview(text: bodyText, format: format, identifier: "mr-create-preview") |
| 134 | 135 | } |
| 135 | 136 | Section { |
| 136 | 137 | Toggle("Draft", isOn: Bindable(model).draft) |
gitbay/Views/MRs/MRView.swift
+5
| @@ -537,6 +537,7 @@ struct MRView: View { |
| 537 | 537 | HStack { |
| 538 | 538 | TextField("Comment", text: $commentText, axis: .vertical) |
| 539 | 539 | .lineLimit(1...5) |
| 540 | .accessibilityIdentifier("mr-comment-field") |
| 540 | 541 | Picker("Format", selection: $commentFormat) { |
| 541 | 542 | Text("Markdown").tag("md") |
| 542 | 543 | Text("Org").tag("org") |
| @@ -555,6 +556,10 @@ struct MRView: View { |
| 555 | 556 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
| 556 | 557 | || model.working) |
| 557 | 558 | } |
| 559 | if !commentText.isEmpty { |
| 560 | MarkupPreview(text: commentText, format: commentFormat, |
| 561 | identifier: "mr-comment-preview") |
| 562 | } |
| 558 | 563 | } |
| 559 | 564 | } |
| 560 | 565 | |
gitbay/Views/Releases/ReleaseListView.swift
+3
| @@ -108,6 +108,9 @@ private struct ReleaseCreateSheet: View { |
| 108 | 108 | TextEditor(text: $notes) |
| 109 | 109 | .frame(minHeight: 140) |
| 110 | 110 | .autocorrectionDisabled() |
| 111 | // release create sends no --format, and release notes |
| 112 | // render as markdown. |
| 113 | MarkupPreview(text: notes, format: "md", identifier: "release-notes-preview") |
| 111 | 114 | } |
| 112 | 115 | if let error = model.createError { |
| 113 | 116 | Section { |
gitbay/Views/Repos/FileEditSheet.swift
+5
| @@ -28,6 +28,11 @@ struct FileEditSheet: View { |
| 28 | 28 | } footer: { |
| 29 | 29 | Text("Commits to \(branch) as an unsigned commit.") |
| 30 | 30 | } |
| 31 | if let format = MarkupPreview.format(forFile: model.fileName) { |
| 32 | Section { |
| 33 | MarkupPreview(text: content, format: format, identifier: "file-edit-preview") |
| 34 | } |
| 35 | } |
| 31 | 36 | Section("Message") { |
| 32 | 37 | TextField("edit \(model.fileName)", text: $message) |
| 33 | 38 | .autocorrectionDisabled() |
gitbay/Views/Shared/ComposeSheet.swift
+1
| @@ -73,6 +73,7 @@ struct ComposeSheet: View { |
| 73 | 73 | .pickerStyle(.segmented) |
| 74 | 74 | .accessibilityIdentifier("compose-format") |
| 75 | 75 | } |
| 76 | MarkupPreview(text: bodyText, format: format, identifier: "compose-preview") |
| 76 | 77 | } |
| 77 | 78 | if let errorMessage { |
| 78 | 79 | Section { |