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 improvements: keyboard navigation and labelling #1568

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

vvillenave
Copy link

No description provided.

Valentin Villenave added 2 commits October 20, 2021 17:44
The ad-hoc labelling used here forces us to use the check box’s
actual content as a description, removing the mnemonic underscore
chars and working around an Orca bug.
This will only read the icon name when a system icon is
used; in case of custom icons a generic “Icon” label is
read instead of the full path.

This commit adds a function to libcaja, as it will be
useful elsewhere down the line.
Comment on lines 568 to 575

gchar *icon_name;
get_image_for_properties_window (window, &icon_name, NULL);
if (! icon_name)
icon_name = g_strdup (_("Icon"));
atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (button)),
icon_name);
g_free (icon_name);
Copy link
Contributor

@rbuj rbuj Oct 21, 2021

Choose a reason for hiding this comment

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

a11y: do not mix filenames with filetypes

Copy link
Author

Choose a reason for hiding this comment

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

This is not a filetype description, it’s a description of the Accessible object. Unless we have a name for this icon, all we know is that it’s an icon.

Copy link
Contributor

@rbuj rbuj Oct 21, 2021

Choose a reason for hiding this comment

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

icon_name = g_strdup (_("Icon")); is a filetype description, meanwhile icon_name comes from the file name and it's actually used as an identifier. You can get all icon_name ids by running the command below:

find /usr/share/icons -type f -exec basename {} \; | grep -Po '.*(?=\.)' | sort -u

Copy link
Member

Choose a reason for hiding this comment

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

@rbuj I don't get what you mean? Indeed get_image_for_properties_window() will return the name of the icon which is not necessarily a great description, but most likely better than nothing, and probably better than a generic "icon". Or is there a way to get a description of the icon?

Copy link
Contributor

@rbuj rbuj Oct 26, 2021

Choose a reason for hiding this comment

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

@cwendling, in the case of the HTML language, why do you think the ALT attribute was added to the IMG tag instead of saying the URL or the filename?

The name of the icons, which are identifiers, they aren't fields which the end user needs to know.
https://freedesktop.org/wiki/Specifications/icon-naming-spec/

@vvillenave Can you explain this new functionality with some real examples? ie. what is the full message the user receives? Can the new message you propose be globalized (g11n = i18n + L10n)?

Copy link
Author

Choose a reason for hiding this comment

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

@rbuj @cwendling See my latest attempt.

  • Right now, the only thing that’s read when a screen reader reaches that button is: “Button”. (Hardly helpful.)
  • IIUC, that button actually conveys two pieces of information: it displays the currently used icon, and offers a way to select another one instead.
  • When a stock icon is used (e.g. user-desktop or whatever), we can retrieve its name; indeed, it won’t be localized (AFAIK there’s no mechanism anywhere in GTK for that) but that’s already a piece of useful information: to begin with, it allows to know which icons are different from one another.
  • Whenever a direct path to an icon is used for some reason, obtaining its name is trickier: therefore I suggest using a generic accessible name instead (I suggested “Icon” as it wouldn’t have to require a new string translation, but that could be “Current icon” instead). That name is localized.
  • That being said, since it’s not entirely clear that activating this button will allow to change the icon, I also added a description message in my latest attempt. That message is localized as well.

Copy link
Contributor

@rbuj rbuj left a comment

Choose a reason for hiding this comment

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

incorrect use of the identifier icon_name as a11y description, moreover, it isn't a g11n compatible field.

src/caja-property-browser.c Outdated Show resolved Hide resolved
@vvillenave vvillenave force-pushed the vv/a11y branch 2 times, most recently from 9bbfa82 to e9ff496 Compare October 26, 2021 11:19
@raveit65
Copy link
Member

raveit65 commented Nov 9, 2021

Any news from this?
Or is this ready to go?

@rbuj
Copy link
Contributor

rbuj commented Nov 10, 2021

I think we should wait to see what they say about the issue opened at orca, otherwise we are adding an useless code (adding a blank space at the end of the string).

About using the identifier icon_name as a description, I don't like it, but it should be reviewed by someone who is more familiar with accessibility.

About adding a function that removes the underscores... I don't think it's really necessary, but I'm not against it, maybe there's a pango function that allows you to get the text rendered without mnemonics, or any other formatting text.

@rbuj
Copy link
Contributor

rbuj commented Nov 10, 2021

I don't think it's a good solution adding a blank widget to allow keyboard navigation.

Valentin Villenave added 4 commits November 10, 2021 12:04
This implies creating an empty focusable widget so that its
mnemonic label will be read when pressing Tab.
This whole window should be rewritten as a
GtkDialog with standard buttons.
Otherwise there would be no way to leave that text area without
using the mouse.
@raveit65
Copy link
Member

Any news from this?
Or is this ready to go?

@rbuj
Copy link
Contributor

rbuj commented Nov 26, 2021

Almost all the proposed changes are related to bugs which come from the third party software called orca. If we considered them useful, then we should be able to remove them when they are fixed in orca, so they need to be labeled with labels such as FIXME including the uri of the external bug. In addition you shoudn't split commits which make use of the new method called caja_remove_mnemonics.

At first glance I haven't seen any change since my last review, the improper use of the file name as a image description, adding a blank widget to allow navigation, adding a blank space at the end because of the recent changes in orca...

@lukefromdc
Copy link
Member

What is the current status of this? Have the problems been fixed in Orca? If not, do we want to mark all these changes w FIXME's to remove them if Orca gets updates to do the same job, close this, or something else?

@lukefromdc
Copy link
Member

Should we close this since it relates to trying to work around bugs in an old version of Orca?

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.

5 participants