-
Notifications
You must be signed in to change notification settings - Fork 45
[Fixes #448] Draft PR for VPAT Compliance #449
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
base: main
Are you sure you want to change the base?
Conversation
…elp into Skeleton
…ener When Shift+digit keys are pressed, the event.key is not guaranteed to be the digit character, it may be the shifted character (e.g. "!" for "1"). This caused issues with shortcuts like Shift+1 not being recognized.
New keybindings: - Ctrl + T - Ctrl + Shift + T - Ctrl + H - Ctrl + E
- Separate keybindings into groups using the KeybindGroup class - Apply conditions to a Keybind group - Refactor focus/scroll code to event-traffic-control
This hides the tabbable contents inside widgets from accessibility devices.
and keyboard events to edit overlay
762a701 to
93a4930
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
Thanks for taking care of this! 🙇♂️
I left a ton of comments here, but it's nearly all code style stuff. I'm not sure if you did or didn't do this, but always make sure to go over the diffs of your changes before submitting, to check for errors and see if you can think of any ways you might have been able to do things better.
Regardless, the substance of the functionality seems pretty good. I like that you were able to isolate most of the CoffeeScript changes to a separate accessibility package. keybinds.coffee seems particularly nice. I really like it when powerful things can just be simple and declarative.
There's no rush for addressing these things, I think, as I am not trying to get it into the NLW bundle for 7.0.1.
app/assets/javascripts/beak/widgets/accessibility/key-combo.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/key-combo.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/keybind.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/keybind.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/keybind.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/ractives/subcomponent/custom-slider.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/ractives/subcomponent/custom-slider.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/key-combo.coffee
Outdated
Show resolved
Hide resolved
app/assets/javascripts/beak/widgets/accessibility/key-combo.coffee
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| # Print methods | ||
| # { String: String } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first read of this is "keyStringTable is an object with only one key: String, which is of type String". On the second or third parse, my brain understood that you were specifying that the keys are strings, but, generally, you don't have to do that, because JavaScript demands that the keys of all objects are strings, regardless. Sometimes, I'll explicitly point out that I'm trying to only put numbers in as keys (for example), but a key type of String should be the first assumption, since it's the only true reality. I'd just write this type as Object[String].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object keys in JavaScript need not be only strings: since ES6, keys are of type string | Symbol. Further, object notation coalesces anything that is not a string to a string using its prototype.toString method. A common pattern is custom classes that evaluate keys internally using toString, and its useful to specify those as well. One can say that keys are of type string | Symbol | object noting that objects are not keyed on object identity (but they could be*).
function id() {
return Math.random().toString(36).slice(2); // simple unique ID
}
class ObjectWithIdentity {
constructor(...args) {
Object.assign(this, ...args); // if you want to merge props
this.id = id();
}
toString() {
return String(this.id);
}
}
const x = new ObjectWithIdentity({ ... })
const y = new ObjectWithIdentity({ ... })
const z = { [x]: ..., [y]: ...} // <= This is validRegarding semantic, TypeScript types these as either Record<K, V> where K is the key and V is the value type using the generic pattern or
{
[k: K]: V
}using the indexing pattern. I'll use one of these because Object[String] is ambigious.
|
This is all just functionality testing, I didn't review the code yet. Most of the testing is in Chrome, some in Firefox as noted.
|
|
I'm noting these here, for now, as I noticed them in testing, but they should be split out into separate issues as they're out-of-scope:
|
|
@LaCuneta I'll take a look over everything more in depth but a few notes.
Ctrl+{1,2,3} Open/Close the tabs. You are looking for Ctrl+Shift+{1,2,3} for Focus tabs 1,2,3.
It's under |
Nice! I'd definitely consider reversing those functions (
👍
Ah, neat! The |
I have thought about this a bit more, and with the shortcuts to jump to command center, code, and info, I'm not sure tabbing through those in order even makes much sense, but it's fine to have the option. What I do really want when I'm "done" with the code tab or command center is usually to jump back to the widgets/interface. So I think a
I see that this is also used to break out of the command center input where |
Fixed in caebfa6.
HTML differentiates
When we updated the styling of widgets, we decided that the number entry would not be focusable to allow for left-right and up-down arrows to work by default. I added
I'm going through your entire comment, so for the sake of completeness: alt+T and shift+alt+T are mock keybinds for Tab and Shift+Tab to move focus out of the code editor. Esc is not a keybind for this action as it may be captured by the code editor itself. I did a patch for a related bug in 5c6d687.
Discussed.
[CANNOT REPRODUCE] [EXPECTED] I can't reproduce this. Also, from the sound of it, this is the expected behavior. Clear comes after the command center input in the tab order.
Added new global on-activateClick event to toggle these buttons.
Fixed in 28fe74a. In particular, the code editor now receives the correct tabindex so it can be focused.
Fixed in 28fe74a. The code editor used to receive to set internal tabindex of 0 at all times. In addition, Esc->Tab and Alt+Tab can be both used to exit the code editor.
[TODO]
Fixed.
Added.
Discussed.
Done.
Done.
Done.
Done.
[TODO] |
- on-activateClick: on-click + on-keydown (spacebar, enter) - added to authoring button and code orientation button
Available for widgets: (chooser, input, slider, monitor)
…ue of the widget on the widget component
- Added new focusElementVisible helper to ensure focused element gets :focus-visible psuedo class applied.
…or Ractive global events
…on-copy events to RactiveWidget.
14833cd to
4a7089c
Compare
- Fix many aria-labels and roles for better keyboard and screen reader accessibility. - Fix incorrect tabindex for code editor. - Fix focus trap issues when modals are open. - Fix focus visible issues for programmatic focus.
|
Navigating between code tabs and the main widget area is still a bit unusual. Same goes for alerts and anything outside the main widget area. It is a lot more usable now though. I am pretty satisfied with the widget area. I added some shortcuts that makes it usable from the keyboard. In particular, |
…d preventing default browser behavior.
…d to code editor/set cmd+0 to always at least focus the main model window
|
@LaCuneta @TheBizzle Interacting with a model (choosing a model, switching a model, setting parameters, reading the info tab, etc...): (https://streamable.com/f73ga1) Authoring a mode (creating and placing widgets, defining widget parameters, writing code, compiling code, testing model in action, going back and forth between tabs and widget area, setting model speed, setting tabs orientation): |


No description provided.