Skip to content

Commit

Permalink
[Maintenance] Adding Aria labels for accessibility (#2025)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikesGlitch authored Dec 4, 2023
1 parent 6bfd958 commit 5f52801
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/desktop-client/src/components/NotesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export default function NotesButton({
>
<Button
type="bare"
aria-label="View notes"
className={!hasNotes && !tooltipOpen ? 'hover-visible' : ''}
style={{
color: defaultColor,
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function Notification({
{sticky && (
<Button
type="bare"
aria-label="Close"
style={{ flexShrink: 0, color: 'currentColor' }}
onClick={onRemove}
>
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/components/ThemeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function ThemeSelector({ style }: ThemeSelectorProps) {
return isNarrowWidth ? null : (
<Button
type="bare"
aria-label="Switch theme"
onClick={() => {
saveGlobalPrefs({
theme: theme === 'dark' ? 'light' : 'dark',
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-client/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ function PrivacyButton({ style }) {
return (
<Button
type="bare"
aria-label={`${isPrivacyEnabled ? 'Disable' : 'Enable'} privacy mode`}
onClick={() => savePrefs({ isPrivacyEnabled: !isPrivacyEnabled })}
style={style}
>
Expand Down Expand Up @@ -227,6 +228,7 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) {

<Button
type="bare"
aria-label="Sync"
style={
isMobile
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default function UpdateNotification() {
)
<Button
type="bare"
aria-label="Close"
style={{ display: 'inline', padding: '1px 7px 2px 7px' }}
onClick={() => closeNotification(setAppState)}
>
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/src/components/accounts/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export function AccountHeader({
)}
<Button
type="bare"
aria-label="Edit account name"
className="hover-visible"
onClick={() => onExposeName(true)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const BudgetTotals = memo(function BudgetTotals({
<View style={{ flexGrow: '1' }}>Category</View>
<Button
type="bare"
aria-label="Menu"
onClick={() => {
setMenuOpen(true);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ const ExpenseCategory = memo(function ExpenseCategory({
<>
<Button
type="bare"
aria-label="Menu"
style={{ padding: 10 }}
{...tooltip.getOpenEvents()}
>
Expand Down Expand Up @@ -633,6 +634,7 @@ const ExpenseGroupTotals = memo(function ExpenseGroupTotals({
<>
<Button
type="bare"
aria-label="Menu"
style={{ padding: 10 }}
{...tooltip.getOpenEvents()}
>
Expand Down Expand Up @@ -887,6 +889,7 @@ const IncomeGroupTotals = memo(function IncomeGroupTotals({
<>
<Button
type="bare"
aria-label="Menu"
style={{ padding: 10 }}
{...tooltip.getOpenEvents()}
>
Expand Down Expand Up @@ -1091,6 +1094,7 @@ const IncomeCategory = memo(function IncomeCategory({
<>
<Button
type="bare"
aria-label="Menu"
style={{ padding: 10 }}
{...tooltip.getOpenEvents()}
>
Expand Down Expand Up @@ -2107,6 +2111,7 @@ function BudgetHeader({
<>
<Button
type="bare"
aria-label="Menu"
hoveredStyle={{
color: theme.mobileHeaderText,
background: theme.mobileHeaderTextHover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default function BudgetSummary({ month }: BudgetSummaryProps) {
>
<Button
type="bare"
aria-label={`${collapsed ? 'Expand' : 'Collapse'} month summary`}
className="hover-visible"
onClick={onToggleSummaryCollapse}
>
Expand Down Expand Up @@ -129,7 +130,7 @@ export default function BudgetSummary({ month }: BudgetSummaryProps) {
/>
</View>
<View style={{ userSelect: 'none' }}>
<Button type="bare" onClick={onMenuOpen}>
<Button type="bare" aria-label="Menu" onClick={onMenuOpen}>
<DotsHorizontalTriple
width={15}
height={15}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default function BudgetSummary({
>
<Button
type="bare"
aria-label={`${collapsed ? 'Expand' : 'Collapse'} month summary`}
className="hover-visible"
onClick={onToggleSummaryCollapse}
>
Expand Down Expand Up @@ -132,7 +133,7 @@ export default function BudgetSummary({
/>
</View>
<View style={{ userSelect: 'none', marginLeft: 2 }}>
<Button type="bare" onClick={onMenuOpen}>
<Button type="bare" aria-label="Menu" onClick={onMenuOpen}>
<DotsHorizontalTriple
width={15}
height={15}
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-client/src/components/manager/BudgetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function DetailButton({ state, onDelete }) {
<View>
<Button
type="bare"
aria-label="Menu"
onClick={e => {
e.stopPropagation();
setMenuOpen(true);
Expand Down Expand Up @@ -235,6 +236,7 @@ function RefreshButton({ onRefresh }) {
return (
<Button
type="bare"
aria-label="Refresh"
style={{ padding: 10, marginRight: 5 }}
onClick={_onRefresh}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function OverflowMenu({
<View>
<Button
type="bare"
aria-label="Menu"
onClick={e => {
e.stopPropagation();
setOpen(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ function MonthlyPatterns({ config, dispatch }) {
/>
<Button
type="bare"
aria-label="Remove recurrence"
style={{ padding: 7 }}
onClick={() =>
dispatch({
Expand All @@ -255,6 +256,7 @@ function MonthlyPatterns({ config, dispatch }) {
</Button>
<Button
type="bare"
aria-label="Add recurrence"
style={{ padding: 7, marginLeft: 5 }}
onClick={() => dispatch({ type: 'add-recurrence' })}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ type ToggleButtonProps = {
function ToggleButton({ style, isFloating, onFloat }: ToggleButtonProps) {
return (
<View className="float" style={{ ...style, flexShrink: 0 }}>
<Button type="bare" onClick={onFloat} color={theme.buttonMenuBorder}>
<Button
type="bare"
aria-label={`${isFloating ? 'Pin' : 'Unpin'} sidebar`}
onClick={onFloat}
color={theme.buttonMenuBorder}
>
{isFloating ? (
<Pin
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ function PayeeIcons({
{transferAccount && (
<Button
type="bare"
aria-label="Transfer"
style={buttonStyle}
onClick={e => {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export function AmountInput({
leftContent={
<Button
type="bare"
aria-label={`Make ${negative ? 'positive' : 'negative'}`}
style={{ padding: '0 7px' }}
onPointerUp={onSwitch}
onPointerDown={e => e.preventDefault()}
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2025.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MikesGlitch]
---

Adding aria-labels to some buttons for greater accessibility

0 comments on commit 5f52801

Please sign in to comment.