From 0efdc8651fcd51fddcba5d2941c11558a8f42f87 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 21 Oct 2026 22:21:09 -0700 Subject: [PATCH] Stop text wrapping in the Changes tab on iPhone --- mac/Sources/Byre/Changes.swift | 66 ++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/mac/Sources/Byre/Changes.swift b/mac/Sources/Byre/Changes.swift index 5ba575f..3c7d10f 100644 --- a/mac/Sources/Byre/Changes.swift +++ b/mac/Sources/Byre/Changes.swift @@ -242,33 +242,61 @@ private struct ChangesHead: View { @Environment(Overlays.self) private var overlays var body: some View { - HStack(alignment: .center, spacing: 12) { - VStack(alignment: .leading, spacing: 4) { - if let n = model.pinned { - SnapWhere(n: n) - } - summary - .font(Fonts.font(11)) - .foregroundStyle(Palette.muted) - .textSelection(.enabled) + ViewThatFits(in: .horizontal) { + HStack(alignment: .center, spacing: 12) { + info + Spacer(minLength: 0) + controls } - Spacer(minLength: 0) - 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) + VStack(alignment: .leading, spacing: 6) { + info + ViewThatFits(in: .horizontal) { + toggle + ScrollView(.horizontal) { + toggle } - .buttonStyle(WebButtonStyle(primary: true)) - .fixedSize() - .help("Send the line comments to the task's agent as one message") + .fixedSize(horizontal: false, vertical: true) } + send } - toggle } .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) { let sent = drafts.takeLineComments(taskId, ready: lineCommentReady(store.images, taskId)) let keys = sent.map { lineCommentImageKey(taskId, $0.anchor) }