processing / processing/p5.js-website

Tab behavior toggle for website code editor convenience

Open
#705 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Good First Issue
Dominant language
MDX
Stars
96
Forks
322
Avg merge
5d 22h
Merged PRs (30d)
8

Description

Increasing Access

The goal of this feature is to "accommodate people who prefer tabs over spaces for code indentation and want to use that in the embedded code editors on the site" (see longer comment by @calebfoss below). The default behavior, where tabs are not used for indentation, is essential for accessibility, so any implementation of this convenience feature should not conflict with that behavior.

As a current accessibility feature, the code editor on the site does not use tab for indent. This way, tab key can be used for navigation by, for example, screenreaders and other users who rely on keyboards for navigation. You can check out any page with an editable code snippet, and try to use tab both inside and outside the code editor to see what it currently does.

However, tab could be used in the code editor to indent if esc can be used to get out of the editor mode. This would avoid the keyboard trap that was the original accessibility problem (WCAG Success Criterion 2.1.2: No Keyboard Trap), but it's not really intuitive, so it should not be the default behavior. Other solutions are also in the discussion below.

Most appropriate sub-area of p5.js?

Home

Feature request details

Proposed behavior:

  • Current behavior stays as a default, which is tab is used for navigation and not indent
  • Under the "Accessibility" tab, there is a new entry, "No tab indent," which is checked by default.
  • When this is NOT checked, the user should be able to use tab to navigate into the code editor, and then esc to get out of the code editor. This still avoids keyboard traps.

See also other ideas and solutions in the discussion below. Mainly, this convenience feature should be visible/available, but not conflicting with accessibility requirements.

Previous discussion and further reading:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the editable code snippet linked in the issue and inspect the Accessibility tab and current tab-key behavior. Read the discussion in pull request #667 and issue #666 before choosing an approach. Done means the default navigation behavior remains accessible, while the opt-out setting supports editor entry and Escape-based exit without a keyboard trap.

Written by the indexing model from the issue text.

Assessment

Domain
accessibility, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.