Stop text wrapping in the Changes tab on iPhone
This commit is contained in:
@@ -242,33 +242,61 @@ private struct ChangesHead: View {
|
|||||||
@Environment(Overlays.self) private var overlays
|
@Environment(Overlays.self) private var overlays
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(alignment: .center, spacing: 12) {
|
ViewThatFits(in: .horizontal) {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
HStack(alignment: .center, spacing: 12) {
|
||||||
if let n = model.pinned {
|
info
|
||||||
SnapWhere(n: n)
|
Spacer(minLength: 0)
|
||||||
}
|
controls
|
||||||
summary
|
|
||||||
.font(Fonts.font(11))
|
|
||||||
.foregroundStyle(Palette.muted)
|
|
||||||
.textSelection(.enabled)
|
|
||||||
}
|
}
|
||||||
Spacer(minLength: 0)
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
if let taskId = store.selectedTaskId, let drafts = store.drafts {
|
info
|
||||||
let n = drafts.lineComments(taskId).filter(lineCommentReady(store.images, taskId)).count
|
ViewThatFits(in: .horizontal) {
|
||||||
if n > 0 {
|
toggle
|
||||||
Button("Send \(n) \(n == 1 ? "comment" : "comments")") {
|
ScrollView(.horizontal) {
|
||||||
sendComments(taskId, drafts)
|
toggle
|
||||||
}
|
}
|
||||||
.buttonStyle(WebButtonStyle(primary: true))
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.fixedSize()
|
|
||||||
.help("Send the line comments to the task's agent as one message")
|
|
||||||
}
|
}
|
||||||
|
send
|
||||||
}
|
}
|
||||||
toggle
|
|
||||||
}
|
}
|
||||||
.modifier(HeaderBar())
|
.modifier(HeaderBar())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var info: some View {
|
||||||
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
|
if let n = model.pinned {
|
||||||
|
SnapWhere(n: n)
|
||||||
|
}
|
||||||
|
summary
|
||||||
|
.font(Fonts.font(11))
|
||||||
|
.foregroundStyle(Palette.muted)
|
||||||
|
.textSelection(.enabled)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var controls: some View {
|
||||||
|
HStack(spacing: 12) {
|
||||||
|
send
|
||||||
|
toggle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var send: some View {
|
||||||
|
if let taskId = store.selectedTaskId, let drafts = store.drafts {
|
||||||
|
let n = drafts.lineComments(taskId).filter(lineCommentReady(store.images, taskId)).count
|
||||||
|
if n > 0 {
|
||||||
|
Button("Send \(n) \(n == 1 ? "comment" : "comments")") {
|
||||||
|
sendComments(taskId, drafts)
|
||||||
|
}
|
||||||
|
.buttonStyle(WebButtonStyle(primary: true))
|
||||||
|
.fixedSize()
|
||||||
|
.help("Send the line comments to the task's agent as one message")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func sendComments(_ taskId: String, _ drafts: Drafts) {
|
private func sendComments(_ taskId: String, _ drafts: Drafts) {
|
||||||
let sent = drafts.takeLineComments(taskId, ready: lineCommentReady(store.images, taskId))
|
let sent = drafts.takeLineComments(taskId, ready: lineCommentReady(store.images, taskId))
|
||||||
let keys = sent.map { lineCommentImageKey(taskId, $0.anchor) }
|
let keys = sent.map { lineCommentImageKey(taskId, $0.anchor) }
|
||||||
|
|||||||
Reference in New Issue
Block a user