From 2419a2ba3cd604ade26c4f2c3c752d27fa7855c4 Mon Sep 17 00:00:00 2001 From: ykisana Date: Wed, 18 Nov 2026 07:33:25 -0600 Subject: [PATCH] fix: stack the group card's timed unblock and button rows at large text sizes At accessibility text sizes the group card's timed unblock row broke "Block Now" and the countdown mid-word, and a partly blocked group's Block All / Unblock All buttons broke letter by letter. Both rows now use AdaptiveStack, like the card's header, so they stack at accessibility sizes and look the same as before at standard sizes. --- Normal/Views/Groups/GroupListCardView.swift | 16 ++++++------ NormalUITests/BlockingUITests.swift | 27 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Normal/Views/Groups/GroupListCardView.swift b/Normal/Views/Groups/GroupListCardView.swift index 063946e..4d62a94 100644 --- a/Normal/Views/Groups/GroupListCardView.swift +++ b/Normal/Views/Groups/GroupListCardView.swift @@ -194,12 +194,14 @@ struct GroupListCardView: View { } private func timedUnblockRow(endDate: Date) -> some View { - HStack(spacing: DS.Spacing.sm) { - Image(systemName: "timer").foregroundStyle(.orange) - Text(timerInterval: .now ... endDate, countsDown: true) - .font(.subheadline.monospacedDigit()) - .foregroundStyle(.secondary) - Spacer() + AdaptiveStack(spacing: DS.Spacing.sm) { + HStack(spacing: DS.Spacing.sm) { + Image(systemName: "timer").foregroundStyle(.orange) + Text(timerInterval: .now ... endDate, countsDown: true) + .font(.subheadline.monospacedDigit()) + .foregroundStyle(.secondary) + } + .frame(maxWidth: .infinity, alignment: .leading) Button { requestAction(.tighten(blockGroup)) } label: { @@ -211,7 +213,7 @@ struct GroupListCardView: View { } private var actionRow: some View { - HStack(spacing: DS.Spacing.md - 2) { + AdaptiveStack(spacing: DS.Spacing.md - 2) { if blockStatus != .all { blockButton } diff --git a/NormalUITests/BlockingUITests.swift b/NormalUITests/BlockingUITests.swift index e58d24a..04a0f13 100644 --- a/NormalUITests/BlockingUITests.swift +++ b/NormalUITests/BlockingUITests.swift @@ -245,6 +245,33 @@ final class BlockingUITests: XCTestCase { XCTAssertTrue(group.contains { $0.contains("Unblocked") }, "\"Unblocked\" should stay one word: \(group)") } + func testGroupTimedUnblockRowKeepsWholeWordsAtTheLargestTextSize() throws { + let app = launch([ + "-uiTestSeedGroupKey", + "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryAccessibilityXXXL", + ]) + app.mainTab("Groups").tap() + + let blockButton = app.buttons["group.blockButton"] + require(blockButton, "Group block button should render") + blockButton.tap() + app.buttons["keySelect.blockWithoutKey"].tap() + confirmBypass(app) + + let unblockButton = app.buttons["group.unblockButton"] + require(unblockButton, "Group unblock button should render after blocking") + unblockButton.tap() + app.buttons["keySelect.row.QR"].tap() + let duration = app.buttons["timedUnblock.duration.900"] + require(duration, "Group unblock duration sheet should appear after key scan") + duration.tap() + app.buttons["timedUnblock.confirm"].tap() + + require(app.buttons["Block Now"], "The group card should show the timed unblock") + let lines = try screenLines() + XCTAssertTrue(lines.contains { $0.contains("Block Now") }, "\"Block Now\" should stay on one line: \(lines)") + } + private func screenLines() throws -> [String] { sleep(1) guard let image = XCUIScreen.main.screenshot().image.cgImage else { return [] }