]> source.dussan.org Git - gitea.git/commit
Improve accessibility when (re-)viewing files (#24817)
authordelvh <dev.lh@web.de>
Sun, 21 May 2023 20:47:41 +0000 (22:47 +0200)
committerGitHub <noreply@github.com>
Sun, 21 May 2023 20:47:41 +0000 (20:47 +0000)
commite95b42e187cde9ac4bd541cd714bdb4f5c1fd8bc
tree473584ab54af5220390413f2199843597f2be5f2
parentc59a057297c782f44a81a3e630b5094a58099edb
Improve accessibility when (re-)viewing files (#24817)

Visually, nothing should have changed.
Changes include
- Convert most `<a [no href]>` to `<button>` when (re-)viewing files:
- `<a [no href]>` are, by HTML definition, not a link and hence cannot
be focused
- `<a class="ui button">` can now be clicked (again?) using
<kbd>Enter</kbd>
- Previously, the installed keypress handler on `.ui.button` elements
disabled it for links somehow
- The `(un)escape file`, the `expand section` and the `expand/collapse
file` buttons can now be focused (and subsequently clicked using only
the keyboard)
- You can now press <kbd>Space</kbd> on a focused `View file` checkbox
to mark the file as viewed.
- previously, this was impossible as this checkbox listened on the wrong
event listener

The `add code comment` button has been left inaccessible for now as it
requires quite a bit of extra logic so that it is unhidden when it is
focused (you can otherwise focus it without seeing it as you are not
hovering on the corresponding line).

---------

Co-authored-by: silverwind <me@silverwind.io>
17 files changed:
templates/repo/blame.tmpl
templates/repo/diff/blob_excerpt.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/section_split.tmpl
templates/repo/diff/section_unified.tmpl
templates/repo/issue/labels/labels_selector_field.tmpl
templates/repo/issue/view_title.tmpl
templates/repo/view_file.tmpl
templates/user/settings/profile.tmpl
web_src/css/repo.css
web_src/css/review.css
web_src/js/features/common-global.js
web_src/js/features/pull-view-file.js
web_src/js/features/repo-code.js
web_src/js/features/repo-diff.js
web_src/js/features/repo-issue.js
web_src/js/features/repo-unicode-escape.js