mirror of
https://github.com/block/buzz.git
synced 2026-11-04 16:31:38 +00:00
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 menu with the left label fixed:  --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
31 lines
1.4 KiB
Swift
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")
|
|
}
|
|
}
|