Skip to content

Commit 7ace161

Browse files
committed
Add a11y annotations to various things
Not perfect, but makes VoiceOver navigation less confusing. Could set things in AppKit side more often with setAccessibilityLabel:. Also does annoyingly touch files with IB for noisy diffs.
1 parent 8d0dfec commit 7ace161

File tree

10 files changed

+64
-38
lines changed

10 files changed

+64
-38
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Doing so isn't fatal (it's not a secret), but it is annoying for other contribut
3737
* All tracks on the server can be shown in a new view.
3838
* This can be accessed by Go - By Tracks (Cmd+3).
3939
* More metadata is returned for albums, artists, and tracks.
40+
* Add some accessibility annotations to various tables and labels.
4041
* Fix accessibility (i.e. VoiceOver) with the album list.
4142
* Track ratings are shown with stars and can be set from the inspector.
4243
* Fix ratings getting reset when fetching from the server.

Submariner/Database.xib

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
66
<capability name="Search Toolbar Item" minToolsVersion="12.0" minSystemVersion="11.0"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
@@ -135,6 +135,7 @@
135135
</connections>
136136
</tableColumn>
137137
</tableColumns>
138+
<accessibility description="Source list"/>
138139
<connections>
139140
<outlet property="dataSource" destination="-2" id="21"/>
140141
<outlet property="delegate" destination="-2" id="22"/>
@@ -887,15 +888,15 @@ DQ
887888
<image name="chevron.forward" catalog="system" width="10" height="14"/>
888889
<image name="forward" catalog="system" width="20" height="12"/>
889890
<image name="info.circle" catalog="system" width="15" height="15"/>
890-
<image name="music.note.list" catalog="system" width="17" height="15"/>
891-
<image name="pause" catalog="system" width="10" height="13"/>
891+
<image name="music.note.list" catalog="system" width="16" height="15"/>
892+
<image name="pause" catalog="system" width="9" height="13"/>
892893
<image name="person.wave.2" width="15" height="14"/>
893894
<image name="play" catalog="system" width="12" height="13"/>
894-
<image name="repeat" catalog="system" width="18" height="14"/>
895-
<image name="shuffle" catalog="system" width="19" height="14"/>
896-
<image name="sidebar.left" catalog="system" width="19" height="14"/>
897-
<image name="speaker" catalog="system" width="13" height="14"/>
895+
<image name="repeat" catalog="system" width="17" height="14"/>
896+
<image name="shuffle" catalog="system" width="18" height="14"/>
897+
<image name="sidebar.left" catalog="system" width="18" height="14"/>
898+
<image name="speaker" catalog="system" width="14" height="14"/>
898899
<image name="speaker.wave.2" catalog="system" width="19" height="14"/>
899-
<image name="stop" catalog="system" width="15" height="13"/>
900+
<image name="stop" catalog="system" width="14" height="13"/>
900901
</resources>
901902
</document>

Submariner/Music.xib

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -22,7 +22,7 @@
2222
</customObject>
2323
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
2424
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
25-
<customView id="1">
25+
<customView id="1">
2626
<rect key="frame" x="0.0" y="0.0" width="619" height="398"/>
2727
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2828
<subviews>
@@ -46,6 +46,7 @@
4646
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
4747
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
4848
</searchFieldCell>
49+
<accessibility description="Artist search"/>
4950
<connections>
5051
<action selector="filterArtist:" target="-2" id="92"/>
5152
</connections>
@@ -99,6 +100,7 @@
99100
</connections>
100101
</tableColumn>
101102
</tableColumns>
103+
<accessibility description="Artists"/>
102104
<connections>
103105
<outlet property="delegate" destination="-2" id="76"/>
104106
<outlet property="menu" destination="cMH-9b-JVT" id="WZF-Cz-F1U"/>
@@ -146,6 +148,7 @@
146148
<size key="itemSize" width="220" height="230"/>
147149
</collectionViewFlowLayout>
148150
<color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
151+
<accessibility description="Albums for artist"/>
149152
<connections>
150153
<outlet property="dataSource" destination="-2" id="Mnk-Dr-fjF"/>
151154
<outlet property="delegate" destination="-2" id="ZMs-7M-RR5"/>
@@ -174,11 +177,11 @@
174177
<rect key="frame" x="-1" y="41" width="446" height="199"/>
175178
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
176179
<clipView key="contentView" id="oeS-uH-lBG">
177-
<rect key="frame" x="0.0" y="0.0" width="446" height="199"/>
180+
<rect key="frame" x="0.0" y="0.0" width="446" height="184"/>
178181
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
179182
<subviews>
180183
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveName="LocalMusicTable" headerView="36" id="38" customClass="SBTableView">
181-
<rect key="frame" x="0.0" y="0.0" width="692" height="171"/>
184+
<rect key="frame" x="0.0" y="0.0" width="692" height="156"/>
182185
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
183186
<size key="intercellSpacing" width="3" height="2"/>
184187
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -318,6 +321,7 @@
318321
</connections>
319322
</tableColumn>
320323
</tableColumns>
324+
<accessibility description="Tracks for album"/>
321325
<connections>
322326
<action trigger="doubleAction" selector="trackDoubleClick:" target="-2" id="OuI-2q-24t"/>
323327
<outlet property="dataSource" destination="-2" id="88"/>
@@ -328,7 +332,7 @@
328332
</subviews>
329333
</clipView>
330334
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="37">
331-
<rect key="frame" x="0.0" y="183" width="446" height="16"/>
335+
<rect key="frame" x="0.0" y="184" width="446" height="15"/>
332336
<autoresizingMask key="autoresizingMask"/>
333337
</scroller>
334338
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="35">
@@ -348,6 +352,7 @@
348352
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
349353
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
350354
</textFieldCell>
355+
<accessibility description="Album length"/>
351356
<connections>
352357
<binding destination="68" name="value" keyPath="arrangedObjects" id="oTo-Ds-FSw">
353358
<dictionary key="options">
@@ -406,7 +411,7 @@
406411
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
407412
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
408413
<rect key="contentRect" x="196" y="240" width="404" height="120"/>
409-
<rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
414+
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1175"/>
410415
<view key="contentView" id="97">
411416
<rect key="frame" x="0.0" y="0.0" width="404" height="120"/>
412417
<autoresizingMask key="autoresizingMask"/>
@@ -416,7 +421,7 @@
416421
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
417422
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="101">
418423
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
419-
<font key="font" metaFont="menu"/>
424+
<font key="font" metaFont="message"/>
420425
<menu key="menu" title="OtherViews" id="102"/>
421426
</popUpButtonCell>
422427
</popUpButton>
@@ -570,6 +575,6 @@
570575
</menu>
571576
</objects>
572577
<resources>
573-
<image name="heart.fill" catalog="system" width="17" height="14"/>
578+
<image name="heart.fill" catalog="system" width="16" height="14"/>
574579
</resources>
575580
</document>

Submariner/MusicSearch.xib

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -152,6 +152,7 @@
152152
</connections>
153153
</tableColumn>
154154
</tableColumns>
155+
<accessibility description="Search results"/>
155156
<connections>
156157
<outlet property="dataSource" destination="-2" id="Brw-rd-I86"/>
157158
<outlet property="delegate" destination="-2" id="5ah-F5-s5C"/>
@@ -181,6 +182,7 @@
181182
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
182183
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
183184
</textFieldCell>
185+
<accessibility description="Search result length"/>
184186
<connections>
185187
<binding destination="25" name="value" keyPath="arrangedObjects" id="OPK-9W-KHO">
186188
<dictionary key="options">

Submariner/Playlist.xib

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -173,6 +173,7 @@
173173
</connections>
174174
</tableColumn>
175175
</tableColumns>
176+
<accessibility description="Playlist"/>
176177
<connections>
177178
<action trigger="doubleAction" selector="trackDoubleClick:" target="-2" id="z6H-q9-bHp"/>
178179
<outlet property="dataSource" destination="-2" id="67"/>
@@ -203,6 +204,7 @@
203204
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
204205
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
205206
</textFieldCell>
207+
<accessibility description="Playlist length"/>
206208
<connections>
207209
<binding destination="33" name="value" keyPath="arrangedObjects" id="WD6-EK-xHm">
208210
<dictionary key="options">

Submariner/SBInspectorController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ extension NSNotification.Name {
7878
)
7979
.padding(.top, 20)
8080
.padding(.horizontal, 20)
81-
.quickLookPreview($coverUrl)
81+
.accessibilityLabel("Album cover")
82+
.accessibilityHint("Quick look album cover") .quickLookPreview($coverUrl)
8283
} else {
8384
Image(systemName: "questionmark.square.dashed")
8485
.resizable()
8586
.scaledToFit()
8687
.aspectRatio(contentMode: .fit)
8788
.padding()
8889
.foregroundColor(.secondary)
90+
.accessibilityLabel("Blank album cover")
8991
}
9092
}
9193
}
@@ -180,6 +182,7 @@ extension NSNotification.Name {
180182
$0.frame(maxHeight: .infinity)
181183
}
182184
}
185+
.accessibilityLabel("Track properties")
183186
}
184187
}
185188
}
@@ -230,6 +233,7 @@ extension NSNotification.Name {
230233
$0.frame(maxHeight: .infinity)
231234
}
232235
}
236+
.accessibilityLabel("Playlist properties")
233237
}
234238
}
235239
}

0 commit comments

Comments
 (0)