-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Accessibility for project detail page and file browser #206
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
Conversation
<nav aria-label="<%= t('.nav_file_browser_label') %>"> | ||
<ol data-file-browser-target="pathDisplay" class="breadcrumb d-flex align-items-center flex-wrap gap-2"> | ||
<% path_parts = current_path.split('/').reject(&:blank?) %> | ||
<% accumulated_path = '/' %> | ||
<% path_parts.each do |part| %> | ||
<li> | ||
<% accumulated_path = File.join(accumulated_path, part) %> | ||
<span class="text-muted">/</span> | ||
<a class="breadcrumb-folder text-body text-decoration-none" | ||
tabindex="0" | ||
data-entry-path="<%= accumulated_path %>" | ||
data-entry-type="folder" | ||
data-action="dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown"> | ||
<i class="bi bi-folder-fill" aria-hidden="true"></i> <%= part %> | ||
</a> | ||
</li> | ||
<% end %> | ||
</ol> | ||
</nav> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path browser redefined as a ul list with li items inside a nav tag, to make it more understandable for accessibility devices. tabindex="0" and the keydown
handler in data-action
allow the usage of keyboard
tabindex="0" | ||
data-action="dragstart->file-browser#handleDragStart dragend->file-browser#handleDragEnd dblclick->file-browser#handleDoubleClick keydown->file-browser#handleKeydown"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these lines allow the use of keyboard
@@ -11,7 +11,7 @@ | |||
<%= t('.file_drop_text') %> | |||
</div> | |||
<div data-file-drop-target="icon" class="position-absolute translate-middle-y drop-text d-none" style="top: 50%; left: 1rem; z-index: 100;"> | |||
<i class="bi bi-plus-square-fill fs-1"></i> | |||
<i class="bi bi-plus-square-fill fs-1" aria-hidden="true"></i> | |||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a title or hidden span here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Just a comment in case we are missing a title or hidden label.
fixes: #155