@@ -253,6 +253,8 @@ const GUIComponent = props => {
253253 />
254254 ) : null }
255255 { ! menuBarHidden && < MenuBar
256+ ariaRole = "banner"
257+ ariaLabel = "Menu topbar"
256258 accountNavOpen = { accountNavOpen }
257259 authorId = { authorId }
258260 authorThumbnailUrl = { authorThumbnailUrl }
@@ -288,27 +290,34 @@ const GUIComponent = props => {
288290 username = { username }
289291 accountMenuOptions = { accountMenuOptions }
290292 /> }
291- < Box className = { boxStyles } >
292- < Box className = { styles . flexWrapper } >
293- < Box className = { styles . editorWrapper } >
294- < Tabs
295- forceRenderTabPanel
296- className = { tabClassNames . tabs }
297- selectedIndex = { activeTabIndex }
298- selectedTabClassName = { tabClassNames . tabSelected }
299- selectedTabPanelClassName = { tabClassNames . tabPanelSelected }
300- onSelect = { onActivateTab }
293+ < Box className = { classNames ( boxStyles , styles . flexWrapper ) } >
294+ < Box
295+ role = "main"
296+ aria-label = "Editor"
297+ className = { styles . editorWrapper }
298+ >
299+ < Tabs
300+ forceRenderTabPanel
301+ className = { tabClassNames . tabs }
302+ selectedIndex = { activeTabIndex }
303+ selectedTabClassName = { tabClassNames . tabSelected }
304+ selectedTabPanelClassName = { tabClassNames . tabPanelSelected }
305+ onSelect = { onActivateTab }
301306
302- // TODO: focusTabOnClick should be true for accessibility, but currently conflicts
303- // with nudge operations in the paint editor. We'll likely need to manage focus
304- // differently within the paint editor before we can turn this back on.
305- // Repro steps:
306- // 1. Click the Costumes tab
307- // 2. Select something in the paint editor (say, the cat's face)
308- // 3. Press the left or right arrow key
309- // Desired behavior: the face should nudge left or right
310- // Actual behavior: the Code or Sounds tab is now focused
311- focusTabOnClick = { false }
307+ // TODO: focusTabOnClick should be true for accessibility, but currently conflicts
308+ // with nudge operations in the paint editor. We'll likely need to manage focus
309+ // differently within the paint editor before we can turn this back on.
310+ // Repro steps:
311+ // 1. Click the Costumes tab
312+ // 2. Select something in the paint editor (say, the cat's face)
313+ // 3. Press the left or right arrow key
314+ // Desired behavior: the face should nudge left or right
315+ // Actual behavior: the Code or Sounds tab is now focused
316+ focusTabOnClick = { false }
317+ >
318+ < Box
319+ role = "region"
320+ aria-label = "Tab List"
312321 >
313322 < TabList className = { tabClassNames . tabList } >
314323 < Tab className = { tabClassNames . tab } >
@@ -359,66 +368,91 @@ const GUIComponent = props => {
359368 />
360369 </ Tab >
361370 </ TabList >
362- < TabPanel className = { tabClassNames . tabPanel } >
363- < Box className = { styles . blocksWrapper } >
364- < Blocks
365- key = { `${ blocksId } /${ theme } ` }
366- canUseCloud = { canUseCloud }
367- grow = { 1 }
368- isVisible = { blocksTabVisible }
369- options = { {
370- media : `${ basePath } static/${ themeMap [ theme ] . blocksMediaFolder } /`
371- } }
372- stageSize = { stageSize }
373- theme = { theme }
374- vm = { vm }
375- showNewFeatureCallouts = { showNewFeatureCallouts }
376- username = { username }
377- />
378- </ Box >
379- < ExtensionsButton
380- activeTabIndex = { activeTabIndex }
381- intl = { intl }
371+ </ Box >
372+ < TabPanel className = { tabClassNames . tabPanel } >
373+ < Box
374+ className = { styles . blocksWrapper }
375+ role = "region"
376+ aria-label = "Code Editor Panel"
377+ >
378+ < Blocks
379+ key = { `${ blocksId } /${ theme } ` }
380+ canUseCloud = { canUseCloud }
381+ grow = { 1 }
382+ isVisible = { blocksTabVisible }
383+ options = { {
384+ media : `${ basePath } static/${ themeMap [ theme ] . blocksMediaFolder } /`
385+ } }
386+ stageSize = { stageSize }
387+ theme = { theme }
388+ vm = { vm }
382389 showNewFeatureCallouts = { showNewFeatureCallouts }
383- onExtensionButtonClick = { onExtensionButtonClick }
384390 username = { username }
385391 />
386- < Box className = { styles . watermark } >
387- < Watermark />
388- </ Box >
389- </ TabPanel >
390- < TabPanel className = { tabClassNames . tabPanel } >
391- { costumesTabVisible ? < CostumeTab
392+ </ Box >
393+ < ExtensionsButton
394+ activeTabIndex = { activeTabIndex }
395+ intl = { intl }
396+ showNewFeatureCallouts = { showNewFeatureCallouts }
397+ onExtensionButtonClick = { onExtensionButtonClick }
398+ username = { username }
399+ />
400+ < Box className = { styles . watermark } >
401+ < Watermark />
402+ </ Box >
403+ </ TabPanel >
404+ < TabPanel className = { tabClassNames . tabPanel } >
405+ { costumesTabVisible ? < CostumeTab
406+ ariaLabel = { targetIsStage ? 'Backdrops Editor Panel' : 'Costumes Editor Panel' }
407+ ariaRole = "region"
408+ vm = { vm }
409+ onNewLibraryBackdropClick = { onNewLibraryBackdropClick }
410+ onNewLibraryCostumeClick = { onNewLibraryCostumeClick }
411+ /> : null }
412+ </ TabPanel >
413+ < TabPanel className = { tabClassNames . tabPanel } >
414+ { soundsTabVisible ?
415+ < SoundTab
416+ ariaLabel = "Sounds Editor Panel"
417+ ariaRole = "region"
392418 vm = { vm }
393- onNewLibraryBackdropClick = { onNewLibraryBackdropClick }
394- onNewLibraryCostumeClick = { onNewLibraryCostumeClick }
395419 /> : null }
396- </ TabPanel >
397- < TabPanel className = { tabClassNames . tabPanel } >
398- { soundsTabVisible ? < SoundTab vm = { vm } /> : null }
399- </ TabPanel >
400- </ Tabs >
401- { backpackVisible ? (
402- < Backpack host = { backpackHost } />
403- ) : null }
404- </ Box >
420+ </ TabPanel >
421+ </ Tabs >
422+ { backpackVisible ? (
423+ < Backpack
424+ host = { backpackHost }
425+ ariaRole = "region"
426+ ariaLabel = "Backpack"
427+ />
428+ ) : null }
429+ </ Box >
405430
406- < Box className = { classNames ( styles . stageAndTargetWrapper , styles [ stageSize ] ) } >
407- < StageWrapper
408- isFullScreen = { isFullScreen }
409- isRendererSupported = { isRendererSupported }
410- isRtl = { isRtl }
431+ < Box
432+ role = "complementary"
433+ aria-label = "Stage and Target"
434+ className = { classNames ( styles . stageAndTargetWrapper , styles [ stageSize ] ) }
435+ >
436+ < StageWrapper
437+ isFullScreen = { isFullScreen }
438+ isRendererSupported = { isRendererSupported }
439+ isRtl = { isRtl }
440+ stageSize = { stageSize }
441+ vm = { vm }
442+ ariaRole = "region"
443+ ariaLabel = "Stage"
444+ />
445+ < Box
446+ className = { styles . targetWrapper }
447+ role = "region"
448+ aria-label = "Target Pane"
449+ >
450+ < TargetPane
411451 stageSize = { stageSize }
412452 vm = { vm }
453+ onNewSpriteClick = { onNewSpriteClick }
454+ onNewBackdropClick = { onNewLibraryBackdropClick }
413455 />
414- < Box className = { styles . targetWrapper } >
415- < TargetPane
416- stageSize = { stageSize }
417- vm = { vm }
418- onNewSpriteClick = { onNewSpriteClick }
419- onNewBackdropClick = { onNewLibraryBackdropClick }
420- />
421- </ Box >
422456 </ Box >
423457 </ Box >
424458 </ Box >
0 commit comments