chore(ui): clear eslint interaction accessibility bucket
Add keyboard handlers and focus support to clickable UI affordances across reader dialogs, metadata views, cards, and layout controls. Keep the existing click behavior intact while making non-button elements operable from the keyboard and clearing the remaining template interaction accessibility backlog. Validation: just ui lint
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<div class="toolbar-actions">
|
||||
<div class="toolbar-icons">
|
||||
@if (isFilterActive) {
|
||||
<a class="topbar-items topbar-item" (click)="clearFilter()">
|
||||
<a class="topbar-items topbar-item" role="button" tabindex="0" (click)="clearFilter()" (keydown.enter)="clearFilter()">
|
||||
<i
|
||||
class="pi pi-filter-slash filter-clear-icon"
|
||||
[pTooltip]="t('tooltip.clearFilters')"
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
@if (currentViewMode === 'table') {
|
||||
<div>
|
||||
<a class="topbar-items topbar-item" (click)="columnPopover.toggle($event)">
|
||||
<a class="topbar-items topbar-item" role="button" tabindex="0" (click)="columnPopover.toggle($event)" (keydown.enter)="columnPopover.toggle($event)">
|
||||
<i
|
||||
class="pi pi-eye"
|
||||
[pTooltip]="t('tooltip.visibleColumns')"
|
||||
@@ -94,7 +94,10 @@
|
||||
<div>
|
||||
<a
|
||||
class="topbar-items topbar-item"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="seriesCollapseOverlay.toggle($event)"
|
||||
(keydown.enter)="seriesCollapseOverlay.toggle($event)"
|
||||
[pTooltip]="t('tooltip.displaySettings')"
|
||||
tooltipPosition="top">
|
||||
<i class="pi pi-cog"></i>
|
||||
@@ -165,7 +168,7 @@
|
||||
</div>
|
||||
|
||||
<div class="sort-button-wrapper">
|
||||
<a class="topbar-items topbar-item" (click)="sortPopover.toggle($event)">
|
||||
<a class="topbar-items topbar-item" role="button" tabindex="0" (click)="sortPopover.toggle($event)" (keydown.enter)="sortPopover.toggle($event)">
|
||||
<i
|
||||
class="pi pi-sort"
|
||||
[pTooltip]="t('tooltip.selectSorting')"
|
||||
@@ -186,7 +189,7 @@
|
||||
</p-popover>
|
||||
</div>
|
||||
|
||||
<a class="topbar-items topbar-item" (click)="toggleTableGrid()">
|
||||
<a class="topbar-items topbar-item" role="button" tabindex="0" (click)="toggleTableGrid()" (keydown.enter)="toggleTableGrid()">
|
||||
<i
|
||||
[ngClass]="viewIcon"
|
||||
[pTooltip]="t('tooltip.toggleView')"
|
||||
@@ -251,7 +254,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<a class="topbar-items topbar-item" (click)="toggleSidebar()">
|
||||
<a class="topbar-items topbar-item" role="button" tabindex="0" (click)="toggleSidebar()" (keydown.enter)="toggleSidebar()">
|
||||
<i
|
||||
[ngClass]="showFilter() ? 'pi pi-angle-double-right' : 'pi pi-angle-double-left'"
|
||||
[pTooltip]="t('tooltip.toggleSidebar')"
|
||||
@@ -449,7 +452,10 @@
|
||||
@if (showFilter()) {
|
||||
<div
|
||||
class="mobile-filter-mask"
|
||||
(click)="toggleSidebar()">
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="toggleSidebar()"
|
||||
(keydown.enter)="toggleSidebar()">
|
||||
</div>
|
||||
<app-book-filter
|
||||
[showFilter]="showFilter()"
|
||||
|
||||
+7
-1
@@ -1,6 +1,9 @@
|
||||
<div class="book-card"
|
||||
[class.selected]="isSelected"
|
||||
(click)="onCardClick($event)">
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="onCardClick($event)"
|
||||
(keydown.enter)="onCardClick($event)">
|
||||
|
||||
<div class="cover-container" [ngClass]="{ 'center-info-btn': _isSeriesViewActive || !hasDigitalFile(), 'loaded': isImageLoaded, 'audiobook-cover': _isAudiobook, 'square-library-cover': useSquareCovers }">
|
||||
<img
|
||||
@@ -92,6 +95,9 @@
|
||||
[pTooltip]="readStatusTooltip"
|
||||
tooltipPosition="bottom"
|
||||
(click)="toggleReadStatusMenu($event, readStatusMenu)"
|
||||
(keydown.enter)="toggleReadStatusMenu($event, readStatusMenu)"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
[attr.aria-label]="'book.card.alt.readStatusMenu' | transloco">
|
||||
<i [class]="_readStatusIcon" style="font-size: 0.9rem"></i>
|
||||
</div>
|
||||
|
||||
+4
-1
@@ -41,11 +41,14 @@
|
||||
<div
|
||||
*cdkVirtualFor="let filter of filters; trackBy: trackByFilter"
|
||||
class="filter-row"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
[ngClass]="{
|
||||
'active': activeFilters[filterType]?.includes(getFilterValueId(filter)),
|
||||
'active-not': activeFilters[filterType]?.includes(getFilterValueId(filter)) && selectedFilterMode === 'not'
|
||||
}"
|
||||
(click)="handleFilterClick(filterType, getFilterValueId(filter))">
|
||||
(click)="handleFilterClick(filterType, getFilterValueId(filter))"
|
||||
(keydown.enter)="handleFilterClick(filterType, getFilterValueId(filter))">
|
||||
<span class="filter-value-text">{{ getFilterValueDisplay(filter) }}</span>
|
||||
<p-badge class="filter-value-badge" [value]="filter.bookCount"></p-badge>
|
||||
</div>
|
||||
|
||||
+7
-1
@@ -41,7 +41,13 @@
|
||||
}
|
||||
} @else if (books.length > 0) {
|
||||
@for (book of books; track book; let idx = $index) {
|
||||
<div class="search-dropdown-item" [class.active]="activeIndex === idx" (click)="onBookClick(book)">
|
||||
<div
|
||||
class="search-dropdown-item"
|
||||
[class.active]="activeIndex === idx"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="onBookClick(book)"
|
||||
(keydown.enter)="onBookClick(book)">
|
||||
<div class="search-item-content">
|
||||
<img
|
||||
[attr.src]="urlHelper.getThumbnailUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@
|
||||
{{ t('validCount', { count: entries.length }) }}
|
||||
</div>
|
||||
@if (skipped.length > 0) {
|
||||
<div class="summary-stat warn" (click)="showSkipped = !showSkipped">
|
||||
<div class="summary-stat warn" role="button" tabindex="0" (click)="showSkipped = !showSkipped" (keydown.enter)="showSkipped = !showSkipped">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
{{ t('skippedCount', { count: skipped.length }) }}
|
||||
<i class="pi" [class.pi-chevron-down]="!showSkipped" [class.pi-chevron-up]="showSkipped"></i>
|
||||
|
||||
@@ -47,7 +47,12 @@
|
||||
@if (allAuthors(); as authors) {
|
||||
<p class="series-authors">
|
||||
@for (author of authors; track $index; let isLast = $last) {
|
||||
<a class="author-link" (click)="goToAuthorBooks(author)">{{ author }}</a>
|
||||
<a
|
||||
class="author-link"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="goToAuthorBooks(author)"
|
||||
(keydown.enter)="goToAuthorBooks(author)">{{ author }}</a>
|
||||
@if (!isLast) {<span>, </span>}
|
||||
}
|
||||
</p>
|
||||
@@ -58,7 +63,12 @@
|
||||
<div class="categories-scroll">
|
||||
<div class="categories-list">
|
||||
@for (category of categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="category-link">
|
||||
<a
|
||||
class="category-link"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="goToCategory(category)"
|
||||
(keydown.enter)="goToCategory(category)">
|
||||
<app-tag color="red" size="xs">{{ category }}</app-tag>
|
||||
</a>
|
||||
}
|
||||
@@ -70,7 +80,12 @@
|
||||
<div class="metadata-cards">
|
||||
@if (allPublishers(); as publishers) {
|
||||
@if (publishers.length) {
|
||||
<span class="meta-card meta-card-publisher" (click)="goToPublisher(publishers[0])">
|
||||
<span
|
||||
class="meta-card meta-card-publisher"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="goToPublisher(publishers[0])"
|
||||
(keydown.enter)="goToPublisher(publishers[0])">
|
||||
<i class="pi pi-building"></i>
|
||||
@for (pub of publishers; track pub; let isLast = $last) {
|
||||
{{ pub }}{{ isLast ? '' : ', ' }}
|
||||
@@ -165,7 +180,12 @@
|
||||
<!-- Next Up + Progress (pushed to bottom, aligned with cover) -->
|
||||
<div class="hero-status">
|
||||
@if (nextUp(); as nextUp) {
|
||||
<div class="next-up-card" (click)="readBook(nextUp.book.id)">
|
||||
<div
|
||||
class="next-up-card"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="readBook(nextUp.book.id)"
|
||||
(keydown.enter)="readBook(nextUp.book.id)">
|
||||
<img [src]="nextUp.thumbnailUrl"
|
||||
[alt]="nextUp.book.metadata?.title || ''"
|
||||
class="next-up-thumb"
|
||||
|
||||
Reference in New Issue
Block a user