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

a11y and usability fixes #1134

Merged
merged 18 commits into from
Sep 25, 2019
Merged

a11y and usability fixes #1134

merged 18 commits into from
Sep 25, 2019

Conversation

akash07k
Copy link
Contributor

@akash07k akash07k commented Sep 22, 2019

Lots of accessibility and usability fixes. #1133

@akash07k
Copy link
Contributor Author

I don't know why, but when I'm expanding the sources, the sources are not displaying.

Copy link
Member

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

Thanks, I added some notes.

templates/home.phtml Outdated Show resolved Hide resolved
<?php endif; ?>

<a id="nav-copyright" href="https://selfoss.aditu.de" target="_blank" rel="noopener noreferrer">selfoss <?= \F3::get('version'); ?></a>
<a id="nav-copyright" href="https://selfoss.aditu.de" target="_blank" rel="noopener noreferrer"><?= trim(\F3::get('html_title')); ?> <?= \F3::get('version'); ?></a>
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 an information about the version of the software so it should probably always be selfoss, rather than the name administrator chooses for a given installation. Though I would argue that user should not need to care about what program this really is so I would move it to the settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is an information about the version of the software so it should probably always be selfoss, rather than the name administrator chooses for a given installation. Though I would argue that user should not need to care about what program this really is so I would move it to the settings.

Actually, I think for the better user experience, the name should be retrieved from the settings itself.
Also, since URL is unchanged and leads the user to the selfoss homepage, it should be fine. rest, it is your choice.

Copy link
Member

Choose a reason for hiding this comment

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

Also, since URL is unchanged and leads the user to the selfoss homepage, it should be fine.

Well this is precisely my point. I would expect the label to match the target URL so that user knows where will it lead before visiting it.

Also it is followed by a selfoss version number, which, I think, does not make sense when combined with a custom title.

I would just remove this link altogether, as it does not add much value while cluttering the sidebar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, since URL is unchanged and leads the user to the selfoss homepage, it should be fine.

Well this is precisely my point. I would expect the label to match the target URL so that user knows where will it lead before visiting it.

Also it is followed by a selfoss version number, which, I think, does not make sense when combined with a custom title.

I would just remove this link altogether, as it does not add much value while cluttering the sidebar.

Yeah, removing is also a better option.
It will be great.
Also, when will you commit your changes so that I can pull them and work further?
I also want to introduce a heading level1 on th home page because user always looks for the main heading I.E: h1 for reading about the website/application and for the main content. Since main content is already present, where and with which content we should add h1?

.gitignore Outdated Show resolved Hide resolved
templates/home.phtml Show resolved Hide resolved
templates/home.phtml Outdated Show resolved Hide resolved
@@ -49,10 +49,10 @@ selfoss.events.entriesToolbar = function(parent) {
if (parent.find('.entry-toolbar').has('button.entry-share' + shares[0]).length == 0) {
// add the share toolbar entries
parent.find('.entry-smartphone-share button.entry-newwindow').after(selfoss.shares.buildLinks(shares, function(name) {
return '<button class="entry-share entry-share' + name + '" title="' + name + '"><img class="entry-share" title="' + name + '" src="images/' + name + '.png" height="16" width="16">' + name + '</button>';
Copy link
Member

Choose a reason for hiding this comment

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

Why use aria-haspopup? It opens a new tab/window, not a popup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why use aria-haspopup? It opens a new tab/window, not a popup.

You are right, but, since it behaves like link, either it should be changed to link, or if it is required to keep it button, then aria-haspopup is best bet for this. Since, normal buttons are not supposed to open any new tab/page

Copy link
Member

Choose a reason for hiding this comment

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

I will defer to you on this. Unfortunately, we cannot use link, as some sharers work in the background (e.g. copy to clipboard, share with operating system menu).

Maybe we could improve the button labels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will defer to you on this. Unfortunately, we cannot use link, as some sharers work in the background (e.g. copy to clipboard, share with operating system menu).

Maybe we could improve the button labels.

No problem, we can improve the labels.
Should I do something or you're already doing?

Copy link
Member

Choose a reason for hiding this comment

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

I will push the changes shortly.

templates/home.phtml Outdated Show resolved Hide resolved
templates/home.phtml Outdated Show resolved Hide resolved
templates/item.phtml Show resolved Hide resolved
templates/home.phtml Outdated Show resolved Hide resolved
@akash07k
Copy link
Contributor Author

akash07k commented Sep 23, 2019 via email

@akash07k
Copy link
Contributor Author

I don't know why, but when I'm expanding the sources, the sources are not displaying.

They are displaying now, but screen reader is not treating them as list still after changing the code.

@jtojnar
Copy link
Member

jtojnar commented Sep 23, 2019

Feel free to address what you like, I will be back from school in two or three hours and then will take a jab at it.

@akash07k
Copy link
Contributor Author

Feel free to address what you like, I will be back from school in two or three hours and then will take a jab at it.

Sure, also, if you find anything wrong in the code, try to remove my changes.

@akash07k akash07k changed the title Accessibility fixes a11y and usability fixes Sep 23, 2019
@akash07k
Copy link
Contributor Author

akash07k commented Sep 23, 2019 via email

@jtojnar
Copy link
Member

jtojnar commented Sep 23, 2019

Yup, they are in the headings above, which is why I suggested to use aria-labelledby. But if it is better for you to have the label be Filter by status/tag/source (a context that seeing users will get from the filters being together in the sidebar), it might be better to use a separate string.

Though, I would also be worried the screen reader will now read the label twice:

[Heading level 3] Tags
[List] Tags
…

@akash07k
Copy link
Contributor Author

Yup, they are in the headings above, which is why I suggested to use aria-labelledby. But if it is better for you to have the label be Filter by status/tag/source (a context that seeing users will get from the filters being together in the sidebar), it might be better to use a separate string.

Though, I would also be worried the screen reader will now read the label twice:

[Heading level 3] Tags
[List] Tags
…

Pushed the changes. removed the duplicated strings and used aria-labeledby
No. there's no issue, for example, JAWS reads like this:
Heading level 2 tags.
Tags list of 19 items.
Which is fine.

@jtojnar
Copy link
Member

jtojnar commented Sep 23, 2019

  • Rebased onto master.
  • Dropped the db patches since that is separate issue (Log database driver name when estabilishing a connection #944)
  • Converted the <span>s with roles to proper HTML elements, fixed the JavaScript and styles.
  • Specialized the login form autocomplete attributes.
  • Removed the branding link in the sidebar.

I left out the aria-expanded on .entry-title, as that one is non-trivial to fix. We will need the closing/opening methods as @niol suggested in #1127 (comment).

@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

I am looking at adding the buttons to the entry titles some more and there is an issue: micro-articles such as tweets can contain links inside the titles. For that reason we cannot really make the whole title clickable. I am not sure how to represent that properly.

@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

For now, I have made the .entry-title a role=link and moved aria-expanded there. But I am not sure how will it behave with tweets containing links in title. Here is an example of such tweet body, could you check how it behaves with screen readers https://jsfiddle.net/2hxLrgjt/1/show.

I have also rebased this onto master and it is ready to be merged, pending a review from @niol regarding the latest commit.

Copy link
Collaborator

@niol niol left a comment

Choose a reason for hiding this comment

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

Looks good

templates/tag.phtml Outdated Show resolved Hide resolved
templates/tag.phtml Outdated Show resolved Hide resolved
@akash07k
Copy link
Contributor Author

For now, I have made the .entry-title a role=link and moved aria-expanded there. But I am not sure how will it behave with tweets containing links in title. Here is an example of such tweet body, could you check how it behaves with screen readers https://jsfiddle.net/2hxLrgjt/1/show.

I have also rebased this onto master and it is ready to be merged, pending a review from @niol regarding the latest commit.

I've just checked your example, no problem, screen readers are recognising every link as individual link and there's no problem with the readability also.
I feel that since screen readers are not having any problem with the links contained in the title, can't we just make the entry title button as before? I don't think that it will cause problems.

@akash07k
Copy link
Contributor Author

I am looking at adding the buttons to the entry titles some more and there is an issue: micro-articles such as tweets can contain links inside the titles. For that reason we cannot really make the whole title clickable. I am not sure how to represent that properly.

If we'll make the whole title clickable, won't the user be able to click the individual links contained in the title?

@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

I've just checked your example, no problem, screen readers are recognising every link as individual link and there's no problem with the readability also.

That’s great.

I feel that since screen readers are not having any problem with the links contained in the title, can't we just make the entry title button as before? I don't think that it will cause problems.

Unfortunately, HTML does not allow interactive elements inside links or buttons, so we cannot use the native elements. I would say the link role fits better than the button, since expanding the item also changes the URL hash to point to that page.

If we'll make the whole title clickable, won't the user be able to click the individual links contained in the title?

Not if we use native HTML elements.

@akash07k
Copy link
Contributor Author

akash07k commented Sep 24, 2019 via email

@akash07k
Copy link
Contributor Author

akash07k commented Sep 24, 2019 via email

@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

Good idea. Will do that.

@akash07k
Copy link
Contributor Author

akash07k commented Sep 24, 2019 via email

@akash07k
Copy link
Contributor Author

akash07k commented Sep 24, 2019 via email

@jtojnar jtojnar requested a review from niol September 24, 2019 21:39
@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

@niol I refactored entry selection as well. Could you please take a look at it as well?

@jtojnar
Copy link
Member

jtojnar commented Sep 24, 2019

I think the aria-current for navigation will be better handled in #1064

@akash07k
Copy link
Contributor Author

akash07k commented Sep 25, 2019 via email

@jtojnar
Copy link
Member

jtojnar commented Sep 25, 2019

I have pushed the composer updates to master as there do not seem to be any breaking changes.

As for the jQuery update, the security vulnerabilities do not affect us and there are many breaking changes regarding to Deferred, which will need to be manually checked. And we should probably switch to A+-style promises throughout the codebase.

The remaining deprecations and breaking changes should be addressed in 8e991c4, except for bind() deprecation. That is better left for a separate PR.

Akash Kakkar added 2 commits September 25, 2019 13:14
Added autocomplete to the user login form and made the title of the login form to retrieve from the configurations
Added the aria-label explicitly to some controls, because titles are treated as tooltip by the screen readers and some screen readers do not announce the tooltips. In this case user will not be able to understand that what the button does. Aria-label is a perfect fix for that
jtojnar and others added 16 commits September 25, 2019 13:14
Users should not need to care, what version of selfoss are they running.

Also cleaned up the sidebar button bar slightly, and fixed a bug where refresh button was always shown.
The headings for "filters", "tags" and "sources" are clickable like a link so, added the link role as well along with the heading.
There was no need of aria-haspopup attribute, so removed all the references.
Also, Filters, Tags etc are defined as a list but role="link" added to the list item because they work like a link, thus, screen readers do not treat them as a list, thus, added the role="listitem" also in the span so that screen reader properly recognise them as both list and link.

Co-Authored-By: Jan Tojnar <[email protected]>
All the stories should be in h3 not in h2, so fixed that as well.
Removed maximum-scale and changed the user-scalable to user-scalable="yes". Setting the maximum-scale=1 and user-scalable=no makes the zooming useless and difficult for the low vision users.
Please refer:
https://a11yproject.com/posts/never-use-maximum-scale/
Changed some more things so that application can retrieve the title/name of the app from the configurations.
Fixed the zooming for OPML and hasspassword templates as well.
Also added the main landmark.
Fixed some issues in sources.phtml template. made the favicon hidden by aria-hidden="true" because alt="" is not a efficient practise.
Added the access keys for the common controls for the better user experience and also added some aria attributes.
For easier and effective navigation…
Also wrap the contents of `.entry-title` with `span[role=link].entry-title-link` which is now the holder for the `aria-expanded` attribute. This will improve the accessibility of the entry page. Unfortunately, it might cause some issues with tweets, that can contain links in the title.

Also change the focus target when navigating using keyboard to that link, since it is tabindexed, unlike the icon, used previously.
Previously, we had a separate #fullscreen-entry element, where we copied the body of entry when opened on mobile. Now we are using CSS to make the original entry occupy the full viewport.
Copy link
Collaborator

@niol niol left a comment

Choose a reason for hiding this comment

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

What's in master/more-a11y seems to work with no obvious problem.

@jtojnar jtojnar merged commit d089773 into fossar:master Sep 25, 2019
@jtojnar
Copy link
Member

jtojnar commented Sep 25, 2019

Thanks for all the help.

@akash07k
Copy link
Contributor Author

Thanks for all the help.

Thanks a lot to you too and @niol As well. I'm really liking contributing with you people and I'm very happy with all your cooperation.
You guys are really great.
Also, if I have some other fix for a11y, should I open a new pull requestor reopen it with my changes? What do you recommend?

@jtojnar
Copy link
Member

jtojnar commented Sep 25, 2019

Please open a new pull request. GitHub does not allow re-opening PRs that were merged anyway.

Also please try to split commits that do several (even small) different things on different components into multiple commits. And use git commit --fixup when you need to fix something in a previous commit – that will allow us to easily squash typo commits before the pull request is merged.

@akash07k
Copy link
Contributor Author

Please open a new pull request. GitHub does not allow re-opening PRs that were merged anyway.

Also please try to split commits that do several (even small) different things on different components into multiple commits. And use git commit --fixup when you need to fix something in a previous commit – that will allow us to easily squash typo commits before the pull request is merged.

Sure!

@jtojnar jtojnar mentioned this pull request Oct 15, 2019
@jtojnar
Copy link
Member

jtojnar commented Sep 27, 2020

Hi @akash07k. Previously, it was not clear if selfoss was licensed under GPL 3 only, or also any later version. Could you clarify whether you are fine with licensing your contribution under GPL-3-or-later?

Thanks again and sorry for the confusion.

@akash07k
Copy link
Contributor Author

@jtojnar
Yes, absolutely buddy.
No problem at all

Hi @akash07k. Previously, it was not clear if selfoss was licensed under GPL 3 only, or also any later version. Could you clarify whether you are fine with licensing your contribution under GPL-3-or-later?

Thanks again and sorry for the confusion.

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