Skip to content

Conversation

@natainakata
Copy link
Contributor

@natainakata natainakata commented Sep 29, 2024

Closes #25935

What I did

Added indicator display for ActionBar, Input, and Boolean toggle, since it was not clear whether the focus was applied in High Contrast Mode.
Focus on it and the outline will appear.
The Boolean toggle further displays an underscore for the selected boolean value.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Probably does not require manual testing.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B 0.65 0%
initSize 152 MB 152 MB 957 B -0.86 0%
diffSize 74 MB 74 MB 957 B -0.86 0%
buildSize 6.77 MB 6.77 MB 588 B -1.15 0%
buildSbAddonsSize 1.5 MB 1.5 MB 139 B -1.37 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.83 MB 1.83 MB 180 B -0.89 0%
buildSbPreviewSize 270 kB 270 kB 0 B -1.62 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.8 MB 3.8 MB 319 B -1.21 0%
buildPreviewSize 2.97 MB 2.97 MB 269 B -0.41 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 6.2s 15.3s 9s 0.27 59%
generateTime 21.3s 20.2s -1s -82ms -0.18 -5.3%
initTime 14.9s 14s -826ms -0.63 -5.9%
buildTime 9s 10.5s 1.5s 0.58 14.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.2s 8s 1.8s 0.72 22.6%
devManagerResponsive 4s 5.2s 1.1s 0.85 22.6%
devManagerHeaderVisible 545ms 739ms 194ms 0.64 26.3%
devManagerIndexVisible 579ms 762ms 183ms 0.52 24%
devStoryVisibleUncached 1.2s 1.4s 195ms 0.56 13.9%
devStoryVisible 578ms 770ms 192ms 0.55 24.9%
devAutodocsVisible 512ms 592ms 80ms 0.31 13.5%
devMDXVisible 549ms 629ms 80ms 0.48 12.7%
buildManagerHeaderVisible 475ms 683ms 208ms 0.57 30.5%
buildManagerIndexVisible 505ms 693ms 188ms 0.5 27.1%
buildStoryVisible 506ms 748ms 242ms 0.58 32.4%
buildAutodocsVisible 478ms 697ms 219ms 0.81 31.4%
buildMDXVisible 414ms 609ms 195ms 0.43 32%

Greptile Summary

This pull request improves accessibility for high contrast mode in Storybook's UI components.

  • Added visible focus indicators for ActionBar buttons in high contrast mode
  • Implemented transparent border for Input components when focused in forced-colors environments
  • Enhanced Boolean toggle control with underline for selected value in high contrast mode
  • These changes address issue [Bug]: Visual focus indicators (VFIs) aren't visible in high contrast mode #25935, improving keyboard navigation for users with visual impairments

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings

@nx-cloud
Copy link

nx-cloud bot commented Sep 30, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 56e246e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Contributor

@MichaelArestad MichaelArestad left a comment

Choose a reason for hiding this comment

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

I just has one suggestion for slightly tidier code. I very much appreciate you taking the time to add these enhancements for high contrast mode. Thank you!

color: theme.color.defaultText,
padding: '7px 15px',
},
'@media (forced-colors: active)': {
Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, you can nest media queries in the above selector (below line 94) which should result in not needing to duplicate a complex selector like this one. It's just slightly tidier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Media queries are now nested.
Applied to other changes as well.

@Sidnioulz
Copy link
Member

@natainakata thanks for your contribution! I've reopened this branch on the Storybook repo to rebase it and check the state of the CI. I'm closing this PR as a result, and I'll make sure the rebase PR gets merged.

You can follow up on #29239.

@Sidnioulz Sidnioulz closed this Jun 23, 2025
@github-project-automation github-project-automation bot moved this from In review to Done in Accessibility Improvements Jun 23, 2025
@Sidnioulz Sidnioulz added the a11y: contrast Accessibility issues related to contrast including Windows High Contrast Mode label Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y: contrast Accessibility issues related to contrast including Windows High Contrast Mode accessibility bug ci:normal ui

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Visual focus indicators (VFIs) aren't visible in high contrast mode

4 participants