Skip to content

Add workflow input options for reducedMotion and colorScheme#145

Merged
JoyceZhu merged 5 commits intomainfrom
copilot/add-reduced-motion-and-color-scheme-options
Feb 28, 2026
Merged

Add workflow input options for reducedMotion and colorScheme#145
JoyceZhu merged 5 commits intomainfrom
copilot/add-reduced-motion-and-color-scheme-options

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

  • Inspect repository structure, related issues, and current find action input flow
  • Run existing lint/tests and identify baseline status (noting unrelated existing failures)
  • Add minimal new inputs to the appropriate action.yml files for reduced_motion and color_scheme
  • Thread new inputs through the find action code and validate allowed values before passing to Playwright context options
  • Update directly related documentation for the new inputs
  • Run relevant lint/build/tests after changes
  • Run code review and security scan tools, address any actionable findings
  • Summarize changes, validation results, and security status

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits February 26, 2026 01:27
Co-authored-by: JoyceZhu <6251669+JoyceZhu@users.noreply.github.com>
Co-authored-by: JoyceZhu <6251669+JoyceZhu@users.noreply.github.com>
@JoyceZhu JoyceZhu marked this pull request as ready for review February 26, 2026 05:58
@JoyceZhu JoyceZhu requested a review from a team as a code owner February 26, 2026 05:58
Copy link
Contributor

Copilot AI left a comment

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 adds support for Playwright's reducedMotion and colorScheme emulation parameters to the accessibility scanner. These parameters allow users to test their websites under different user preference conditions for motion and color schemes.

Changes:

  • Added two new optional inputs (reduced_motion and color_scheme) to the main action and find sub-action
  • Implemented input validation in the find action to ensure only valid Playwright values are accepted
  • Threaded the parameters through to Playwright's browser context configuration
  • Updated documentation in README.md and the find action's README.md

Reviewed changes

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

Show a summary per file
File Description
action.yml Added reduced_motion and color_scheme input definitions and passed them to the find sub-action
README.md Documented the new optional inputs with examples and allowed values
.github/actions/find/action.yml Added input definitions for the find sub-action
.github/actions/find/src/index.ts Implemented input validation and parameter extraction
.github/actions/find/src/findForUrl.ts Added parameters to function signature and applied them to Playwright context options
.github/actions/find/README.md Documented the new inputs with links to Playwright API documentation

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


📄 This project is licensed under the terms of the MIT open source license. Please refer to the [LICENSE](./LICENSE) file for the full terms.

## Maintainers
Copy link
Contributor

Choose a reason for hiding this comment

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

autoformatting stripped spaces in VSCode.

@JoyceZhu JoyceZhu changed the title [WIP] Add options for reducedMotion and colorScheme parameters Add workflow input options for reducedMotion and colorScheme Feb 26, 2026
@JoyceZhu JoyceZhu requested a review from a team February 26, 2026 23:13
executablePath: process.env.CI ? '/usr/bin/google-chrome' : undefined,
})
const contextOptions = authContext?.toPlaywrightBrowserContextOptions() ?? {}
const contextOptions = {
Copy link

@abdulahmad307 abdulahmad307 Feb 27, 2026

Choose a reason for hiding this comment

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

this is not blocking.

Since we're now generating a higher-level context object (that includes auth context and other settings), I think it would be valuable to have a 'contextBuilder' (or whatever you want to call it) that generates the full context outside of this function and passes in 1 context object (maybe even create a specific type of what we expect this context to contain). I would image somewhere in the main function in the index file, something like:

const context = buildFullContext(...whatYouDidHere)
findForUrl(context...)

side-note. this is more of a preference than a suggestion; we don't even have to pass the context down as a param if we don't want to. we can use a provider (contextProvider) that generates the context and caches it, and any function that needs it can import it and read it directly.

const authContext = new AuthContext(authContextInput)

const includeScreenshots = core.getInput('include_screenshots', {required: false}) !== 'false'
const reducedMotionInput = core.getInput('reduced_motion', {required: false})
Copy link

@abdulahmad307 abdulahmad307 Feb 27, 2026

Choose a reason for hiding this comment

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

again, non-blocking. so building on what I said in the comment before - most of this could be moved into a context builder function somewhere and called here.

I also personally find it valuable to wrap input reads in some kind of 'getter' or 'reader' function to isolate how each input is read/parsed (or if an error needs to be thrown, or if we need to transform the input somehow) before being exposed to the rest of the code (here's one similar example - although, this does a few more things than just read the input).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, once we've trimmed down the list of feature requests I think it would be a good time to do some code maintenance / refactoring (since the scope of the codebase is expanding). Perhaps once we've got your plugin functionality merged? That seems worthy of a major version update.

Copy link

@abdulahmad307 abdulahmad307 left a comment

Choose a reason for hiding this comment

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

left a couple suggestions. I think they'd be valuable to make. but its your call.

@JoyceZhu JoyceZhu merged commit cf0b579 into main Feb 28, 2026
6 checks passed
@JoyceZhu JoyceZhu deleted the copilot/add-reduced-motion-and-color-scheme-options branch February 28, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants