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 {
172172 HStack {
173173 TextField("Comment", text: $commentText, axis: .vertical)
174174 .lineLimit(1...5)
175 .accessibilityIdentifier("issue-comment-field")
175176 Picker("Format", selection: $commentFormat) {
176177 Text("Markdown").tag("md")
177178 Text("Org").tag("org")
@@ -190,6 +191,10 @@ struct IssueView: View {
190191 .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
191192 || model.working)
192193 }
194 if !commentText.isEmpty {
195 MarkupPreview(text: commentText, format: commentFormat,
196 identifier: "issue-comment-preview")
197 }
193198 }
194199 }
195200
gitbay/Views/MRs/MRListView.swift +1
@@ -131,6 +131,7 @@ private struct MRCreateSheet: View {
131131 }
132132 .pickerStyle(.segmented)
133133 .accessibilityIdentifier("mr-format")
134 MarkupPreview(text: bodyText, format: format, identifier: "mr-create-preview")
134135 }
135136 Section {
136137 Toggle("Draft", isOn: Bindable(model).draft)
gitbay/Views/MRs/MRView.swift +5
@@ -537,6 +537,7 @@ struct MRView: View {
537537 HStack {
538538 TextField("Comment", text: $commentText, axis: .vertical)
539539 .lineLimit(1...5)
540 .accessibilityIdentifier("mr-comment-field")
540541 Picker("Format", selection: $commentFormat) {
541542 Text("Markdown").tag("md")
542543 Text("Org").tag("org")
@@ -555,6 +556,10 @@ struct MRView: View {
555556 .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
556557 || model.working)
557558 }
559 if !commentText.isEmpty {
560 MarkupPreview(text: commentText, format: commentFormat,
561 identifier: "mr-comment-preview")
562 }
558563 }
559564 }
560565
gitbay/Views/Releases/ReleaseListView.swift +3
@@ -108,6 +108,9 @@ private struct ReleaseCreateSheet: View {
108108 TextEditor(text: $notes)
109109 .frame(minHeight: 140)
110110 .autocorrectionDisabled()
111 // release create sends no --format, and release notes
112 // render as markdown.
113 MarkupPreview(text: notes, format: "md", identifier: "release-notes-preview")
111114 }
112115 if let error = model.createError {
113116 Section {
gitbay/Views/Repos/FileEditSheet.swift +5
@@ -28,6 +28,11 @@ struct FileEditSheet: View {
2828 } footer: {
2929 Text("Commits to \(branch) as an unsigned commit.")
3030 }
31 if let format = MarkupPreview.format(forFile: model.fileName) {
32 Section {
33 MarkupPreview(text: content, format: format, identifier: "file-edit-preview")
34 }
35 }
3136 Section("Message") {
3237 TextField("edit \(model.fileName)", text: $message)
3338 .autocorrectionDisabled()
gitbay/Views/Shared/ComposeSheet.swift +1
@@ -73,6 +73,7 @@ struct ComposeSheet: View {
7373 .pickerStyle(.segmented)
7474 .accessibilityIdentifier("compose-format")
7575 }
76 MarkupPreview(text: bodyText, format: format, identifier: "compose-preview")
7677 }
7778 if let errorMessage {
7879 Section {