Files
buzz/mobile/ios/NativeControlTests/CreateChannelAccessibilityTests.swift
klopez4212 a66cb5f7ab Modernize mobile channel and DM creation sheets (#8942)
Modernizes New Channel and New DM with full-height forms and X/Create or
X/checkmark actions. iOS uses UIKit sheets throughout; Android uses the
Flutter fallback. Channel menus default to Ongoing/Public, and native
menu previews lift only the trailing value while labels stay fixed.

Channel names disable automatic capitalization, autocorrect, and
spellcheck; both platforms use descriptive placeholders.

Preserves recipient search and limits, creation error retries, and
navigation after native dismissal.

Validation: 4,154 mobile tests passed (38 skipped), auxiliary suites and
static checks passed; iOS device/simulator and Android builds passed.
Exercised menus, dismissal, DM search and selection in the simulator and
Android form behavior on Pixel; iPhone UI tested and approved by the
author.

| iOS native form (Simulator) | Android Flutter form (Pixel) |
| --- | --- |
| ![Native iOS channel
form](https://github.com/user-attachments/assets/a3ee78c9-510d-488c-979e-64fa3bded686)
| ![Android channel
form](https://github.com/user-attachments/assets/a2d65f1c-752c-4cef-b659-2b396cbbbcc9)
|

Native menu with the left label fixed:

![Native value-only menu
preview](https://github.com/user-attachments/assets/c4fe8659-e46c-409f-b866-c9568b26ccc1)

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-03 18:11:15 +00:00

31 lines
1.4 KiB
Swift

import Flutter
import UIKit
@main
struct CreateChannelAccessibilityTests {
@MainActor static func main() {
let controller = NativeCreateChannelViewController(configuration: [:])
controller.loadViewIfNeeded()
controller.tableView.frame = CGRect(x: 0, y: 0, width: 390, height: 844)
controller.tableView.reloadData()
controller.tableView.layoutIfNeeded()
for section in 0..<2 {
let header = controller.tableView.headerView(forSection: section)!
precondition(header.accessibilityElementsHidden, "Field heading must not add a VoiceOver stop")
precondition(!header.isAccessibilityElement)
precondition(header.textLabel?.isAccessibilityElement == false)
let cell = controller.tableView.cellForRow(at: IndexPath(row: 0, section: section))!
let field = cell.contentView.subviews.first { $0 is UITextField || $0 is UITextView }!
precondition(field.accessibilityLabel == (section == 0 ? "Channel name" : "Description, optional"))
precondition(!field.accessibilityElementsHidden)
}
controller.showError("Try again")
controller.tableView.reloadData()
controller.tableView.layoutIfNeeded()
for section in 0..<2 {
precondition(controller.tableView.headerView(forSection: section)!.accessibilityElementsHidden)
}
print("Create-channel accessibility passed: fields own labels before and after retry")
}
}