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 | HStack { |
172 | HStack { |
| 173 | TextField("Comment", text: $commentText, axis: .vertical) |
173 | TextField("Comment", text: $commentText, axis: .vertical) |
| 174 | .lineLimit(1...5) |
174 | .lineLimit(1...5) |
| |
175 | .accessibilityIdentifier("issue-comment-field") |
| 175 | Picker("Format", selection: $commentFormat) { |
176 | Picker("Format", selection: $commentFormat) { |
| 176 | Text("Markdown").tag("md") |
177 | Text("Markdown").tag("md") |
| 177 | Text("Org").tag("org") |
178 | Text("Org").tag("org") |
| @@ -190,6 +191,10 @@ struct IssueView: View { |
| 190 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
191 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
| 191 | || model.working) |
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 | .pickerStyle(.segmented) |
132 | .pickerStyle(.segmented) |
| 133 | .accessibilityIdentifier("mr-format") |
133 | .accessibilityIdentifier("mr-format") |
| |
134 | MarkupPreview(text: bodyText, format: format, identifier: "mr-create-preview") |
| 134 | } |
135 | } |
| 135 | Section { |
136 | Section { |
| 136 | Toggle("Draft", isOn: Bindable(model).draft) |
137 | Toggle("Draft", isOn: Bindable(model).draft) |
gitbay/Views/MRs/MRView.swift
+5
| @@ -537,6 +537,7 @@ struct MRView: View { |
| 537 | HStack { |
537 | HStack { |
| 538 | TextField("Comment", text: $commentText, axis: .vertical) |
538 | TextField("Comment", text: $commentText, axis: .vertical) |
| 539 | .lineLimit(1...5) |
539 | .lineLimit(1...5) |
| |
540 | .accessibilityIdentifier("mr-comment-field") |
| 540 | Picker("Format", selection: $commentFormat) { |
541 | Picker("Format", selection: $commentFormat) { |
| 541 | Text("Markdown").tag("md") |
542 | Text("Markdown").tag("md") |
| 542 | Text("Org").tag("org") |
543 | Text("Org").tag("org") |
| @@ -555,6 +556,10 @@ struct MRView: View { |
| 555 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
556 | .disabled(commentText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty |
| 556 | || model.working) |
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 | TextEditor(text: $notes) |
108 | TextEditor(text: $notes) |
| 109 | .frame(minHeight: 140) |
109 | .frame(minHeight: 140) |
| 110 | .autocorrectionDisabled() |
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 | if let error = model.createError { |
115 | if let error = model.createError { |
| 113 | Section { |
116 | Section { |
gitbay/Views/Repos/FileEditSheet.swift
+5
| @@ -28,6 +28,11 @@ struct FileEditSheet: View { |
| 28 | } footer: { |
28 | } footer: { |
| 29 | Text("Commits to \(branch) as an unsigned commit.") |
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 | Section("Message") { |
36 | Section("Message") { |
| 32 | TextField("edit \(model.fileName)", text: $message) |
37 | TextField("edit \(model.fileName)", text: $message) |
| 33 | .autocorrectionDisabled() |
38 | .autocorrectionDisabled() |
gitbay/Views/Shared/ComposeSheet.swift
+1
| @@ -73,6 +73,7 @@ struct ComposeSheet: View { |
| 73 | .pickerStyle(.segmented) |
73 | .pickerStyle(.segmented) |
| 74 | .accessibilityIdentifier("compose-format") |
74 | .accessibilityIdentifier("compose-format") |
| 75 | } |
75 | } |
| |
76 | MarkupPreview(text: bodyText, format: format, identifier: "compose-preview") |
| 76 | } |
77 | } |
| 77 | if let errorMessage { |
78 | if let errorMessage { |
| 78 | Section { |
79 | Section { |