Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

Fix axe audits - #262

Open
miathedev wants to merge 1 commit into
strichliste:masterfrom
miathedev:master
Open

Fix axe audits#262
miathedev wants to merge 1 commit into
strichliste:masterfrom
miathedev:master

Conversation

@miathedev

Copy link
Copy Markdown

This pull request introduces several improvements focused on accessibility, internationalization, and code modernization. The most significant changes include enhanced accessibility for screen readers, dynamic currency support based on user settings, refactoring of the CurrencyInput component to use React hooks, and updates to test suites to better reflect state management. Additionally, several scripts and styles have been updated for improved developer experience and UI consistency.

Copilot AI review requested due to automatic review settings December 10, 2025 19:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request focuses on improving accessibility compliance by addressing axe audit findings. The changes enhance screen reader support through comprehensive aria-label attributes, add keyboard navigation aids with skip-to-content links and semantic landmarks, improve color contrast for better readability, and modernize the codebase by refactoring the CurrencyInput component from a class to a functional component with hooks. Additionally, dynamic currency support is introduced to respect user settings.

  • Added aria-label attributes to icon-only buttons across the application for screen reader accessibility
  • Implemented semantic HTML5 landmarks (main element with skip link) and improved color contrast ratios
  • Refactored CurrencyInput from class-based to functional component using React hooks and added dynamic currency support via Redux

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/store/reducers/setting.ts Adds getCurrencyAlpha3 selector to retrieve user's currency setting
src/locales/en.ts Adds locale keys for user creation modal and submit button accessibility labels
src/components/user/create-user-inline-form.tsx Adds aria-label to create user modal trigger and submit buttons
src/components/transaction/create-custom-transaction-form.tsx Adds aria-label to deposit and dispense transaction buttons
src/components/settings/scaling-buttons.tsx Adds aria-label to text size increase/decrease buttons
src/components/currency/currency.tsx Adds dynamic currency support using Redux selector with optional override
src/components/currency/currency-input.tsx Refactors component from class to functional component using hooks
src/components/currency/tests/currency.spec.tsx Updates tests to include Redux Provider for currency selector
src/components/currency/tests/currency-input.spec.tsx Updates tests to include Redux Provider wrapper
src/components/article/article-list.tsx Adds aria-label to add article button
src/bricks/theme/theme.css Improves text contrast colors and adds visually-hidden utility class for screen readers
src/bricks/theme/theme-provider.tsx Adds aria-label to theme toggle button
src/bricks/button/button.tsx Adds aria-label prop support and default labels for AcceptButton, CancelButton, and Tag buttons
src/app.tsx Adds skip-to-content link and main landmark with visually hidden h1
package.json Updates scripts with NODE_OPTIONS for legacy OpenSSL support and localstorage configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app.tsx
Comment on lines +78 to +79
</main>
<MainFooter />

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing </main> and <MainFooter /> tags have inconsistent indentation. They should be aligned at the same level as the opening <main> tag for better code readability.

Suggested change
</main>
<MainFooter />
</main>
<MainFooter />

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines +24 to +29
"start": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts start",
"start:legacy": "react-scripts start",
"build": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts build",
"build:legacy": "react-scripts build",
"lint": "eslint --ext .tsx,.ts src/",
"test": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts test --env=jest-environment-jsdom-sixteen",

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --localstorage-file flag appears to be a non-standard Node.js option. NODE_OPTIONS typically accepts flags like --max-old-space-size, --openssl-legacy-provider, etc., but --localstorage-file is not a recognized Node.js flag. This may cause the scripts to fail or the option to be silently ignored. Please verify this is the correct configuration or if this should be handled differently (e.g., as an environment variable or through a different mechanism).

Suggested change
"start": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts start",
"start:legacy": "react-scripts start",
"build": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts build",
"build:legacy": "react-scripts build",
"lint": "eslint --ext .tsx,.ts src/",
"test": "NODE_OPTIONS=\"--openssl-legacy-provider --localstorage-file=/tmp/strichliste-localstorage.json\" react-scripts test --env=jest-environment-jsdom-sixteen",
"start": "NODE_OPTIONS=\"--openssl-legacy-provider\" react-scripts start",
"start:legacy": "react-scripts start",
"build": "NODE_OPTIONS=\"--openssl-legacy-provider\" react-scripts build",
"build:legacy": "react-scripts build",
"lint": "eslint --ext .tsx,.ts src/",
"test": "NODE_OPTIONS=\"--openssl-legacy-provider\" react-scripts test --env=jest-environment-jsdom-sixteen",

Copilot uses AI. Check for mistakes.
<button aria-label="remove">
<CancelIcon />
</button>
<button>{children}</button>

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second button in the Tag component lacks an accessible name. While it has visible text content ({children}), it should have an explicit aria-label or the button's purpose should be clear from its text content. Consider adding an appropriate aria-label if the children content may not provide sufficient context for screen reader users.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +35
title={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}
aria-label={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title and aria-label attributes have inconsistent indentation. The title attribute should be aligned with the other props on the Button component.

Suggested change
title={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}
aria-label={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}
title={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}
aria-label={intl.formatMessage({ id: 'ARTICLE_ADD_LINK' })}

Copilot uses AI. Check for mistakes.
setValue(getValueFromProps());
}
}
}, [props.value, lastPropValue, getValueFromProps]);

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getValueFromProps callback is included in the useEffect dependency array, which will cause this effect to run on every render since the callback is recreated each time props.value changes. This creates a circular dependency: when props.value changes, getValueFromProps is recreated, triggering the effect, which calls getValueFromProps() and updates state, potentially causing unnecessary re-renders. Consider removing getValueFromProps from the dependency array since props.value is already there and directly captures the needed value.

Suggested change
}, [props.value, lastPropValue, getValueFromProps]);
}, [props.value, lastPropValue]);

Copilot uses AI. Check for mistakes.
public getValueFromProps(): number {
return this.props.value ? this.props.value / 100 : 0;
}
const getValueFromProps = React.useCallback(() => (props.value ? props.value / 100 : 0), [props.value]);

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getValueFromProps callback using useCallback is unnecessary since it's only used during initialization and in the useEffect. Consider replacing it with a simple inline function or directly computing the value where needed to reduce complexity.

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants