Skip to content

Accessibility - Transition from interceptor to accessibility library #508

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

Merged
merged 14 commits into from
Feb 22, 2018

Conversation

lm-n
Copy link
Member

@lm-n lm-n commented Jan 30, 2018

  • added accessible elements to iframe using accessibility library
  • removed interceptor
  • added aria labels
  • added css to iframe
  • focus on iframe when play is pressed

@MathuraMG @CleezyITP

@catarak
Copy link
Member

catarak commented Jan 30, 2018

yay this is very exciting! in README.md, in the installation instructions, there's a section about the submodule setup—could you remove those parts in this PR as well? thanks!

Copy link
Member

@catarak catarak left a comment

Choose a reason for hiding this comment

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

i think you need to do something to remove the submodule besides deleting .gitmodules—when i look at the accessibility branch on github the submodule is still there.

}
scriptsToInject = scriptsToInject.concat(interceptorScripts);
const accessiblelib = sketchDoc.createElement('script');
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/e856365c/dist/p5-accessibility.js');
Copy link
Member

Choose a reason for hiding this comment

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

rather than link to the accessibility using raw git, i think it would be better to add the library as a dependency in package.json, then import the built script using webpack.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cc @lm-n, @CleezyITP - We have been talking about this one, we would like the library to be a part of the HTML code as a CDN so that when a user shares their code (say, send a zip to someone, it will include the library. This would make sharing more accessible. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@catarak - was wondering what your thoughts on this are?

@@ -13,15 +13,19 @@ const defaultHTML =
`<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

why is this including jquery?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we will clear this out - our library has dependencies on jquery but we will make them vanilla javascript.

@@ -419,7 +401,7 @@ PreviewFrame.propTypes = {
textOutput: PropTypes.bool.isRequired,
gridOutput: PropTypes.bool.isRequired,
soundOutput: PropTypes.bool.isRequired,
setTextOutput: PropTypes.func.isRequired,
// setTextOutput: PropTypes.func.isRequired,
Copy link
Member

Choose a reason for hiding this comment

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

should this be removed rather than commented out?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will do.

@MathuraMG
Copy link
Collaborator

@catarak - We will fix the above asap.
Also, a quick update. There is an issue with the accessibility library that we found yesterday. We will fix that and then get back on this PR, so that we have the right version of the library put in. Is that ok?
Thanks!

@lm-n

@catarak
Copy link
Member

catarak commented Feb 1, 2018

no worries, that is of course okay! this brings up an important point, which is how we want to connect the version of the accessibility library to the editor in the package.json, so that when you run npm install in the editor, it doesn't install the latest commit, but a stable commit— we could 1. add a commit sha, or 2. tag a release version, using semantic versioning. (1) could come first and then (2) could come later.

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn
Copy link
Member

@catarak catarak left a comment

Choose a reason for hiding this comment

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

looking great, a couple more things left to iron out though! also, question, is there a git command to run to delete a submodule? or do you have to just delete the directory? i'm worried we'll merge this, and then someone will accidentally check in the submodule directory.

</head>
<body>
<section aria-label='accessible output' id='accessible-outputs'></section>
Copy link
Member

Choose a reason for hiding this comment

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

rather than add the accessibility elements and css to the default html file, i think it would be better to inject them in the PreviewFrame.jsx file, in the function injectLocalFiles. As it is now, a user could accidentally delete these elements from the HTML and then the accessibility features would be broken.

Copy link
Collaborator

@MathuraMG MathuraMG Feb 14, 2018

Choose a reason for hiding this comment

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

@catarak - I think some of the questions we had for you were deleted after we made the new commits :)
@lm-n and myself were thinking it should be a part of the HTML (at the risk of being deleted) , the same way as p5-dom or p5-sound. This way if someone decides to share their code, they can share or download it with the accessibility lib and so the code stays accessible beyond the editor. What do you think about this?

Copy link
Member

Choose a reason for hiding this comment

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

got it. should it be added by default or only if accessibility features are turned on? and also, you want the script to point to a specific release of the library? or a specific commit? or to the latest on master?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we tried to add it only if accessibility features are added but there was a problem? @lm-n ?

}
scriptsToInject = scriptsToInject.concat(interceptorScripts);
const accessiblelib = sketchDoc.createElement('script');
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js');
Copy link
Member

Choose a reason for hiding this comment

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

i still would prefer to link this file by putting it in the package.json and importing the build with webpack!

Copy link
Member

Choose a reason for hiding this comment

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

@MathuraMG and i talked through this and decided it would be best to address this in the future ✨

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js
@lm-n
Copy link
Member Author

lm-n commented Feb 15, 2018

@catarak I think both should work. When I move into the accessibility branch the submodule directory does not exist anymore: when writing git submodule it doesn't return anything, if the submodule directory/the submodule was still there when writing git submodule it would return: -62938f2e9cbe1c83a9c1b702a9deccb11a452170 static/p5-interceptor It can be done also with git submodule deinit -f [submodule name] rm -rf [submodule directory] git rm -f [submodule name] @MathuraMG

@@ -30,6 +31,15 @@ const defaultCSS =
margin: 0;
padding: 0;
}

#accessible-outputs {
Copy link
Member

Choose a reason for hiding this comment

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

i think this is the last thing, but this CSS should also get injected by the library!

@lm-n lm-n mentioned this pull request Feb 18, 2018
* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js

* moved accessible output css
@@ -207,6 +207,12 @@ class PreviewFrame extends React.Component {
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js');
const accessibleOutputs = sketchDoc.createElement('section');
Copy link
Member

Choose a reason for hiding this comment

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

should these accessible outputs be created in the library itself? this is necessary for the library to work, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason we don't create the sections in the library is because the section is currently the trigger to which output the user wants. So in this case we create that section when they select the option in preferences.

@lm-n

Copy link
Member

Choose a reason for hiding this comment

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

got it. would it instead make sense to make some boolean for the library instead that enables/disables the accessible output? then, in the future, if this ever needs to change you can change it in the accessibility library rather than here as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I didn't get what you mean by ' boolean for the library'? :)
The reason we are having sections now is so that beyond the editor the user can determine where they want the output in their program.

Copy link
Member

Choose a reason for hiding this comment

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

got it! what i mean is maybe there's a script that initializes the library, rather than just appending to an HTML element if it's there. for example, one includes the accessibility library, and then includes a script:

var accessibility = new p5.Accessibility(<reference to the HTML element you want to append to>);

or it could create an HTML element to append to by default. My inspiration for this is dat.gui. my instinct is that it is not the best that including an html element determines whether or not the library is included.

Copy link
Member

Choose a reason for hiding this comment

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

sure! should i merge this in then?

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good!

Copy link
Member Author

@lm-n lm-n Feb 22, 2018

Choose a reason for hiding this comment

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

Here are the issues on the library repo: processing/p5.accessibility#13 processing/p5.accessibility#12 We'll follow up in the next few days.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@catarak Yes! That sounds good!

Copy link
Member

Choose a reason for hiding this comment

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

great, will do ⭐️

@catarak
Copy link
Member

catarak commented Feb 22, 2018

just another thought that there's an open issue for, #137: right now, accessibility features won't be added to the full screen view or embed view. and if a user downloads a sketch it won't be included. open to thoughts!

@catarak catarak merged commit 24b0be6 into master Feb 22, 2018
MathuraMG pushed a commit to MathuraMG/p5.js-web-editor that referenced this pull request Mar 1, 2018
* Remove gitmodule (processing#509)


* remove git modules

* removed submodule and replaced interceptor for library

* removed submodule and replaced interceptor for library (processing#510)

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* Fixes processing#508 (processing#539)

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js

* Fixes processing#508  (processing#545)

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js

* moved accessible output css

* removed css, added aria-label, preliminary cdn update

* removed section from iframe

* updated cdn
catarak pushed a commit that referenced this pull request Mar 1, 2018
* Change accessibility example links

* added library to iframe

* changed preview to add accessible elements to iframe

* add library only when accesible output is seleceted

* focus on iframe when plaing

* css

* deleted accessibleOutput.jsx and edited IDEView to integrate accessibility library

* deleted comments

* fix package

* Moved CSS to library and removed section from file.js (#2)

* Remove gitmodule (#509)


* remove git modules

* removed submodule and replaced interceptor for library

* removed submodule and replaced interceptor for library (#510)

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* Fixes #508 (#539)

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js

* Fixes #508  (#545)

* removed submodule and replaced interceptor for library

* deleted comments

* deleted jquery

* deleted interceptor folder

* delete interceptor

* added jquery

* removed jquery and updated accessible library cdn

* remove empty divs from files.js

* fix merge error

* remove empty divs from files.js

* moved accessible output css

* removed css, added aria-label, preliminary cdn update

* removed section from iframe

* updated cdn

* add autofocus; remove CSS
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.

3 participants