Fix accessibility of logos in main menubar#11066
Merged
Merged
Conversation
… menuitem when interactive
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request improves the accessibility of logos in the main header bar by replacing non-interactive text spans with interactive Button components when the logo should link to the home page, and by properly managing aria-hidden attributes for decorative elements.
Changes:
- Converted text-based logos to use the Button component when they are interactive (linking to home)
- Changed organization logo from
role="presentation"toaria-hidden="true"for better accessibility - Added conditional logic to determine when logo elements are interactive and should be exposed to assistive technologies
- Updated CSS styling to accommodate buttons within logo containers
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| webapp/src/headerbar.tsx | Replaces text spans with Button components for interactive text logos, adds aria attributes, and updates the isInteractive logic |
| theme/common.less | Adds CSS rules for button elements within logo containers to override default button margins |
Comments suppressed due to low confidence (1)
webapp/src/headerbar.tsx:149
- When the logo is an image (not text), the container div has role="menuitem" and an onClick handler when shouldLinkHome is true, but lacks an accessible label. Screen readers will announce this as an unlabeled menuitem. Consider adding an aria-label to the container div that includes the board name and purpose, similar to how it's done for text logos. For example:
aria-label={shouldLinkHome ? lf("MakeCode {0} Logo, return to home page", targetTheme.boardName) : undefined}
return <div aria-hidden={!isInteractive} role={role} className={`ui item logo brand ${view !== "sandbox" && view !== "home" ? "mobile hide" : ""}`} onClick={onClickHandler}>
{targetTheme.useTextLogo
? (shouldLinkHome
? [<Button className="name menu-button" key="org-name"
onClick={this.brandIconClick}
title={lf("MakeCode {0} Logo, return to home page", targetTheme.boardName)}
ariaLabel={lf("MakeCode {0} Logo, return to home page", targetTheme.boardName)}
label={targetTheme.organizationText} />,
<Button className="name-short menu-button" key="org-name-short"
onClick={this.brandIconClick}
title={lf("MakeCode {0} Logo, return to home page", targetTheme.boardName)}
ariaLabel={lf("MakeCode {0} Logo, return to home page", targetTheme.boardName)}
label={targetTheme.organizationShortText || targetTheme.organizationText} />]
: [ <span className="name" key="org-name">{targetTheme.organizationText}</span>,
<span className="name-short" key="org-name-short">{targetTheme.organizationShortText || targetTheme.organizationText}</span> ])
: (targetTheme.logo || targetTheme.portraitLogo
? <img className={`ui ${targetTheme.logoWide ? "small" : ""} logo`} src={targetTheme.logo || targetTheme.portraitLogo} alt={lf("{0} Logo", targetTheme.boardName)} />
: <span className="name">{targetTheme.boardName}</span>)}
</div>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jwunderl
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes microsoft/pxt-arcade#7148
These are pretty much the same changes from #11037, just applied to the main header bar rather than just the skillmap one.