fix(macos): make channel/user/chat/activity views reachable by VoiceOver
Setting accessibilityLabel on the NSScrollView wrappers turned them into leaf elements, so VoiceOver never descended into the document views (NSOutlineView/NSTableView/NSTextView) inside. Tab still worked because the key-view loop is independent of the accessibility tree. Also removed the redundant setAccessibilityRole calls on the document views — they already default to those roles, and re-setting the same role can interfere with the view's custom a11y implementation. Matches the pattern already used in ConnectWindowController, whose server table VoiceOver reaches correctly.
This commit is contained in:
@@ -190,13 +190,11 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
channelOutlineView.doubleAction = #selector(channelDoubleClicked)
|
||||
channelOutlineView.target = self
|
||||
channelOutlineView.setAccessibilityLabel("Channel list")
|
||||
channelOutlineView.setAccessibilityRole(.outline)
|
||||
|
||||
let sv = NSScrollView()
|
||||
sv.documentView = channelOutlineView
|
||||
sv.hasVerticalScroller = true
|
||||
sv.borderType = .noBorder
|
||||
sv.setAccessibilityLabel("Channel list")
|
||||
|
||||
let menu = NSMenu()
|
||||
menu.delegate = self
|
||||
@@ -214,7 +212,6 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
userTableView.doubleAction = #selector(userDoubleClicked)
|
||||
userTableView.target = self
|
||||
userTableView.setAccessibilityLabel("Users in current channel")
|
||||
userTableView.setAccessibilityRole(.table)
|
||||
|
||||
let menu = NSMenu()
|
||||
menu.delegate = self
|
||||
@@ -224,13 +221,11 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
sv.documentView = userTableView
|
||||
sv.hasVerticalScroller = true
|
||||
sv.borderType = .noBorder
|
||||
sv.setAccessibilityLabel("Users in current channel")
|
||||
return sv
|
||||
}
|
||||
|
||||
private func buildChatPanel() -> NSView {
|
||||
chatTextView.setAccessibilityLabel("Chat messages")
|
||||
chatTextView.setAccessibilityRole(.textArea)
|
||||
chatTextView.textContainerInset = NSSize(width: 4, height: 4)
|
||||
chatTextView.isAutomaticQuoteSubstitutionEnabled = false
|
||||
|
||||
@@ -238,7 +233,6 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
sv.documentView = chatTextView
|
||||
sv.hasVerticalScroller = true
|
||||
sv.borderType = .noBorder
|
||||
sv.setAccessibilityLabel("Chat messages")
|
||||
return sv
|
||||
}
|
||||
|
||||
@@ -249,13 +243,11 @@ final class MainWindowController: NSWindowController, NSWindowDelegate {
|
||||
activityTableView.dataSource = self
|
||||
activityTableView.delegate = self
|
||||
activityTableView.setAccessibilityLabel("Activity log")
|
||||
activityTableView.setAccessibilityRole(.table)
|
||||
|
||||
let sv = NSScrollView()
|
||||
sv.documentView = activityTableView
|
||||
sv.hasVerticalScroller = true
|
||||
sv.borderType = .noBorder
|
||||
sv.setAccessibilityLabel("Activity log")
|
||||
return sv
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user