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

Make it possible to navigate Product Opener using keyboard shortcuts #1852

Open
3 tasks
Tracked by #5525
teolemon opened this issue Jun 2, 2019 · 4 comments
Open
3 tasks
Tracked by #5525
Labels
accessibility ♿ Ensuring Open Food Facts is accessible to all ✏️ Editing Fixable via Userscript This issue can be fixed using the Power User Script. Fixed via Userscript This issue was fixed using the Power User Script. It could be fixed directly in Product Opener.

Comments

@teolemon
Copy link
Member

teolemon commented Jun 2, 2019

What

Make it possible to navigate Product Opener using keyboard shortcuts

  • product edition (e)
  • product JSON (a)
  • view mode (v), etc.

Code pointers

Add "Edit" keyboard shortcut for logged users
Clicking E in the page would open edit mode.

Part of

@VaiTon
Copy link
Member

VaiTon commented Jun 2, 2019

If this is approved I can start working on it. 😄

@CharlesNepote
Copy link
Member

CharlesNepote commented Jun 4, 2019

@VaiTon it would be great.

We shouldn't have only one keyboard shortcut but several related to the different part of the page (the HTML code already provide many "id"s in the page, but we can add more if necessary).

The keyboard shortcuts should be consistent between edit and view modes.

I think we first have to ask feedbacks from huge contributors such as SebLeOuf, @teolemon, @TaciteOFF, @stephanegigandet, @aleene, @moon-rabbitOFF, @hangy, @offvince, etc. [TODO: add more ?]...

Also we have to carefully design all the keyboard shortcuts. Suggestions:

  • "E" can be for edit mode
  • "P" could be for "Product characteristic" section (view mode: <h2>Product characteristics</h2> => <h2 id="product_characteristic">Product characteristics</h2> (not very useful) ; edit mode: <legend>Product characteristics</legend> => add the id)
  • "P" could also be for the "product name" field (edit mode: id="product_name_fr" when fr)
  • "I" could be for "Ingredients" section (view mode: <h2>Ingredients</h2> => <h2 id="ingredients_section">Ingredients</h2> ; edit mode: <legend>Ingredients</legend> => add the id)
  • "I" could also be for the "Ingredients" field (edit mode: id="ingredients_text_fr" when fr)
  • "N" could be for "Nutrition facts" section (view mode: <h2>Nutrition facts</h2> => <h2 id="nutrition_facts_section">Nutrition facts</h2> ; edit mode: <legend>Nutrition facts</legend> => add the id)
  • "N" could also be for the "Energy" field in edit mode (id="nutriment_energy")
  • "Q" for "quantity"
  • "B" for "brands"
  • "C" for "categories" (very important field)
  • "L" for "labels"
  • "F" for "Dietary fiber" (often not completed for historical reasons)

Finally, I Think we might use pure HTML rather than Javascript, see: https://www.w3schools.com/tags/att_global_accesskey.asp

@CharlesNepote
Copy link
Member

I started a Greasemonkey script to let power user play with it and suggest their own hacks:
https://gist.github.com/CharlesNepote/f6c675dce53830757854141c7ba769fc

@hangy
Copy link
Member

hangy commented Jun 4, 2019

Finally, I Think we might use pure HTML rather than Javascript, see: https://www.w3schools.com/tags/att_global_accesskey.asp

👍 Much better for accessibility reasons than a custom JS-only solution.

About the shortcuts to use: I wonder if we should take I18N/I10N into account from the get-go. We could let translators choose the access keys, so that the shortcuts make sense for their specific locale.

@teolemon teolemon added Fixable via Userscript This issue can be fixed using the Power User Script. Fixed via Userscript This issue was fixed using the Power User Script. It could be fixed directly in Product Opener. labels Jan 10, 2020
@teolemon teolemon changed the title Add "Edit" keyboard shortcut for logged users Make it possible to navigate Product Opener using keyboard shortcuts Aug 30, 2021
@teolemon teolemon added the accessibility ♿ Ensuring Open Food Facts is accessible to all label Jun 8, 2023
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility ♿ Ensuring Open Food Facts is accessible to all ✏️ Editing Fixable via Userscript This issue can be fixed using the Power User Script. Fixed via Userscript This issue was fixed using the Power User Script. It could be fixed directly in Product Opener.
Projects
Status: To discuss and validate
Development

No branches or pull requests

4 participants