Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility edits #40

Merged
merged 23 commits into from
Jun 11, 2024
Merged

Conversation

DynieM
Copy link
Contributor

@DynieM DynieM commented Nov 8, 2023


Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

I appreciate the new PR that supersedes #38 and includes changes from a branch other than master. However, it looks like your last commit to this branch might have caused some unintended issues - for example, the function definitions for both assistiveNotification and _assistiveAlert were removed, which is causing console errors and breaks the player.

Copy link
Contributor

@dmols dmols left a comment

Choose a reason for hiding this comment

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

Looks really good! Tabbing works as expected and VO callouts are great. The only thing I'd recommend adding is a note of how many astronauts are left to sort, after a pairing has been made. If it's not a pain to implement, it could also be useful to note after shifting pages, so the user has a quick idea of how many pairings they have left to make.

@cayb0rg
Copy link
Contributor

cayb0rg commented Dec 7, 2023

I like the new addition! Just one bug I noticed: it seems that the screenreader dialog for how many matches are completed is carried over into the current page when focusing the previous page arrow. (EDIT: this might have been a browser issue as I am no longer experiencing it on new laptop; however, when there are no matches complete, the dialog will say "of 5 complete" instead of "0 of 5 complete" or similar)

Edit: one other thing - everything but the Close button in the instruction manual has cursor: pointer on hover

else if direction == 'previous' then _assistiveAlert 'Page decremented. You are on the previous page.'


_updateCompletionStatus = () ->
Copy link
Contributor

Choose a reason for hiding this comment

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

This function appears to be causing the "___ of 5 remaining" issue. It resets the completePerPage array before refilling it using the matches each time a match is made. It would need another loop that finds pages with no matches, and sets those pages' counts to 0 in the completePerPage array.

The more efficient method may be to just replace the call to _updateCompletionStatus with $scope.completePerPage[$scope.currentPage]++ inside _pushMatch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!

Copy link
Contributor

@cayb0rg cayb0rg left a comment

Choose a reason for hiding this comment

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

Nice work! I believe I made an oversight when proposing the above solution to the "blank of 5" problem, sorry. I did not realize _pushMatch is called every time a match is made even if that is using an answer/question that's already matched to something. Doing so will cause results like these:
Screenshot 2024-01-09 at 1 42 13 PM

So, we probably do need to iterate through the $scope.matches array, or any other method as you see fit. Note that this still needs to account for pages with 0 matches completed so that "[blank] of 5" doesn't happen.

I'm also seeing an issue when a match is made multiple times using the same question/answer and the matches left is wrong. Upon a cursory glance, I'm guessing this has something to do with how the number of matches left is calculated on lines 272-274 of player.coffee.
image

Also, I noticed there are no instructions for shortcut keys (such as using 1,2,3,4,5 for left column and Q,W,E,R,T,Y, etc. for right column) for keyboard users.

Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

This looks and feels great. Really nice work.

Only one piece of feedback before I stamp it with an approval: the .vscode/launch.json file and corresponding directory shouldn't be included in the git history, since it appears to be used for debugging and doesn't really belong in the repo. Once you remove it, this is good to go.

Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

All requested changes are in. Looks good. 👍

Copy link
Contributor

@cayb0rg cayb0rg left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome work.

Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

Unfortunately the player test failures uncovered some issues that went unnoticed previously. You'll have to correct them before LCC is good to go.

Also note that I pushed some changes to your branch to bring it up to parity with the target branch, dev/2.1.0, so make sure you git pull from the remote before doing anything. LCC is now using MWDK 3.x, so you'll also have to do the following after pulling the changes:

  1. rm node_modules to remove the current node modules installed for the widget
  2. Use nvm to install and switch to node 18.13.0 instead of 12.3.1 via nvm install 18.13.0 and nvm use 18.13.0
  3. yarn install to get the new node packages

After which you can run yarn start and continue normally.

src/controllers/player.coffee Show resolved Hide resolved

$scope.unfinishedPagesBefore = false
$scope.unfinishedPagesAfter = false
helpModal = document.getElementById("instructions");
helpModal.inert = true;
Copy link
Member

Choose a reason for hiding this comment

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

These lines were not causing any sort of console of behavioral failure, so they got overlooked when I reviewed your changes previously, but FYI this is not how you assign attributes to DOM elements in JS. Even though helpModal is referencing a DOM element object, attributes must be set (or removed) via the setAttribute or removeAttribute methods, like so:

helpModal.setAttribute('inert', '')

Bear in mind that inert doesn't require a value, so the mere existence of the attribute means the inert behavior will be applied. Therefore, helpModal.setAttribute('inert', 'false') wouldn't work to disable it. The attribute has to be removed completely with removeAttribute. This change will need to be applied on all lines that are trying to set or remove the inert attribute.

Copy link
Member

Choose a reason for hiding this comment

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

This line is still improperly trying to set the inert property on the DOM object directly, instead of using setAttribute(). It's causing the test suite to fail. Always remember to run yarn test before committing!

src/controllers/player.coffee Outdated Show resolved Hide resolved
src/controllers/player.coffee Outdated Show resolved Hide resolved
Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

Still one reference to inert that you didn't update, once that's corrected, I think it's good.


$scope.unfinishedPagesBefore = false
$scope.unfinishedPagesAfter = false
helpModal = document.getElementById("instructions");
helpModal.inert = true;
Copy link
Member

Choose a reason for hiding this comment

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

This line is still improperly trying to set the inert property on the DOM object directly, instead of using setAttribute(). It's causing the test suite to fail. Always remember to run yarn test before committing!

Copy link
Member

@clpetersonucf clpetersonucf left a comment

Choose a reason for hiding this comment

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

Ready to go.

@clpetersonucf clpetersonucf merged commit a53750a into ucfopen:dev/2.1.0 Jun 11, 2024
1 check passed
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