fix(ui): filter sidebar width narrow bug + UI polish (#1470)
This commit is contained in:
+90
-88
@@ -233,80 +233,81 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (booksError()) {
|
||||
<div class="no-books-container">
|
||||
<p class="no-books-text">
|
||||
@switch (entityType()) {
|
||||
@case (EntityType.LIBRARY) {
|
||||
{{ t('labels.failedLibrary') }}
|
||||
}
|
||||
@case (EntityType.SHELF) {
|
||||
{{ t('labels.failedShelf') }}
|
||||
}
|
||||
@default {
|
||||
{{ t('labels.failedBooks') }}
|
||||
}
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="book-browser-body">
|
||||
<div class="book-browser-content">
|
||||
@let visibleBooks = books();
|
||||
@if (visibleBooks.length === 0 && !showBooksLoadingPlaceholder()) {
|
||||
@if (booksError()) {
|
||||
<div class="no-books-container">
|
||||
<p class="no-books-text">
|
||||
{{ t('labels.noBooks') }}
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@if (currentViewMode() === 'table' && (visibleBooks.length > 0 || showTableLoadingPlaceholder())) {
|
||||
<app-book-table
|
||||
[books]="visibleBooks"
|
||||
[virtualRowCount]="virtualRowCount()"
|
||||
[loadedBookCount]="loadedBookCount()"
|
||||
[isFetchingNextPage]="isFetchingNextBooksPage()"
|
||||
[bookQueryToken]="bookQueryToken()"
|
||||
(selectAllRequested)="selectAllBooks()"
|
||||
(loadNextPage)="loadNextBooksPage()"
|
||||
[visibleColumns]="visibleColumns()"
|
||||
[useSquareCovers]="isAudiobookOnlyLibrary()"
|
||||
></app-book-table>
|
||||
}
|
||||
@if (currentViewMode() === 'grid') {
|
||||
<div #scrollElement class="virtual-scroller">
|
||||
<div class="virtual-content" [style.height.px]="virtualGrid.virtualizer.getTotalSize()">
|
||||
@for (virtualItem of virtualGrid.virtualizer.getVirtualItems(); track virtualItem.key) {
|
||||
@if (visibleBooks[virtualItem.index]; as book) {
|
||||
<div
|
||||
class="virtual-cell"
|
||||
[style.width.px]="virtualGrid.itemWidth()"
|
||||
[style.height.px]="virtualItem.size"
|
||||
[style.transform]="virtualGrid.itemTransform(virtualItem)">
|
||||
<app-book-card
|
||||
[index]="virtualItem.index"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[seriesViewEnabled]="seriesViewEnabled()"
|
||||
[onBookSelect]="onBookCardSelect"
|
||||
[isSeriesCollapsed]="seriesCollapseFilter.seriesCollapsed()"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[isSelected]="bookSelectionService.isBookSelected(book)"
|
||||
[useSquareCovers]="isAudiobookOnlyLibrary()"
|
||||
[overlayPreferenceService]="bookCardOverlayPreferenceService">
|
||||
</app-book-card>
|
||||
</div>
|
||||
} @else {
|
||||
<div
|
||||
class="virtual-cell virtual-loader-cell"
|
||||
[style.width.px]="virtualGrid.itemWidth()"
|
||||
[style.height.px]="virtualItem.size"
|
||||
[style.transform]="virtualGrid.itemTransform(virtualItem)"></div>
|
||||
@switch (entityType()) {
|
||||
@case (EntityType.LIBRARY) {
|
||||
{{ t('labels.failedLibrary') }}
|
||||
}
|
||||
@case (EntityType.SHELF) {
|
||||
{{ t('labels.failedShelf') }}
|
||||
}
|
||||
@default {
|
||||
{{ t('labels.failedBooks') }}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@if (userService.currentUser(); as currentUser) {
|
||||
} @else {
|
||||
@let visibleBooks = books();
|
||||
@if (visibleBooks.length === 0 && !showBooksLoadingPlaceholder()) {
|
||||
<div class="no-books-container">
|
||||
<p class="no-books-text">
|
||||
{{ t('labels.noBooks') }}
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@if (currentViewMode() === 'table' && (visibleBooks.length > 0 || showTableLoadingPlaceholder())) {
|
||||
<app-book-table
|
||||
[books]="visibleBooks"
|
||||
[virtualRowCount]="virtualRowCount()"
|
||||
[loadedBookCount]="loadedBookCount()"
|
||||
[isFetchingNextPage]="isFetchingNextBooksPage()"
|
||||
[bookQueryToken]="bookQueryToken()"
|
||||
(selectAllRequested)="selectAllBooks()"
|
||||
(loadNextPage)="loadNextBooksPage()"
|
||||
[visibleColumns]="visibleColumns()"
|
||||
[useSquareCovers]="isAudiobookOnlyLibrary()"
|
||||
></app-book-table>
|
||||
}
|
||||
@if (currentViewMode() === 'grid') {
|
||||
<div #scrollElement class="virtual-scroller">
|
||||
<div class="virtual-content" [style.height.px]="virtualGrid.virtualizer.getTotalSize()">
|
||||
@for (virtualItem of virtualGrid.virtualizer.getVirtualItems(); track virtualItem.key) {
|
||||
@if (visibleBooks[virtualItem.index]; as book) {
|
||||
<div
|
||||
class="virtual-cell"
|
||||
[style.width.px]="virtualGrid.itemWidth()"
|
||||
[style.height.px]="virtualItem.size"
|
||||
[style.transform]="virtualGrid.itemTransform(virtualItem)">
|
||||
<app-book-card
|
||||
[index]="virtualItem.index"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[seriesViewEnabled]="seriesViewEnabled()"
|
||||
[onBookSelect]="onBookCardSelect"
|
||||
[isSeriesCollapsed]="seriesCollapseFilter.seriesCollapsed()"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[isSelected]="bookSelectionService.isBookSelected(book)"
|
||||
[useSquareCovers]="isAudiobookOnlyLibrary()"
|
||||
[overlayPreferenceService]="bookCardOverlayPreferenceService">
|
||||
</app-book-card>
|
||||
</div>
|
||||
} @else {
|
||||
<div
|
||||
class="virtual-cell virtual-loader-cell"
|
||||
[style.width.px]="virtualGrid.itemWidth()"
|
||||
[style.height.px]="virtualItem.size"
|
||||
[style.transform]="virtualGrid.itemTransform(virtualItem)"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (userService.currentUser(); as currentUser) {
|
||||
<div class="book-browser-footer" [class.footer-hidden]="selectedCount() === 0">
|
||||
<div class="footer-content">
|
||||
<div class="footer-left">
|
||||
@@ -429,29 +430,30 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (showFilter()) {
|
||||
<div
|
||||
class="mobile-filter-mask"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="toggleSidebar()"
|
||||
(keydown.enter)="toggleSidebar()">
|
||||
@if (showFilter()) {
|
||||
<div
|
||||
class="mobile-filter-mask"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="toggleSidebar()"
|
||||
(keydown.enter)="toggleSidebar()">
|
||||
</div>
|
||||
}
|
||||
<app-book-filter
|
||||
[showFilter]="showFilter()"
|
||||
class="filter-overlay-container"
|
||||
[ngClass]="{ 'active': showFilter() }"
|
||||
[entity]="entity()"
|
||||
[entityType]="entityType()"
|
||||
[style.display]="showFilter() ? '' : 'none'"
|
||||
(filterSelected)="onFilterSelected($event)"
|
||||
(filterModeChanged)="onFilterModeChanged($event)">
|
||||
</app-book-filter>
|
||||
</div>
|
||||
}
|
||||
<app-book-filter
|
||||
[showFilter]="showFilter()"
|
||||
class="filter-overlay-container"
|
||||
[ngClass]="{ 'active': showFilter() }"
|
||||
[entity]="entity()"
|
||||
[entityType]="entityType()"
|
||||
[style.display]="showFilter() ? '' : 'none'"
|
||||
(filterSelected)="onFilterSelected($event)"
|
||||
(filterModeChanged)="onFilterModeChanged($event)">
|
||||
</app-book-filter>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
+22
-10
@@ -2,7 +2,7 @@
|
||||
.book-browser-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -12,16 +12,25 @@
|
||||
.book-browser-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 0;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.book-browser-body {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex-direction: row;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.book-browser-content {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex: 1 1 0;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
@@ -35,6 +44,7 @@
|
||||
gap: 0.25rem;
|
||||
padding: 0.35rem;
|
||||
margin-right: 2px;
|
||||
flex-shrink: 0;
|
||||
background-color: var(--card-background);
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
@@ -464,16 +474,18 @@
|
||||
}
|
||||
|
||||
.filter-overlay-container {
|
||||
--book-filter-sidebar-width: 225px;
|
||||
|
||||
flex-shrink: 0;
|
||||
z-index: 50;
|
||||
|
||||
@media (width <= 991px) {
|
||||
width: var(--sidebar-width, 225px);
|
||||
position: fixed;
|
||||
top: 3.85rem;
|
||||
width: var(--book-filter-sidebar-width);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: calc(100% - 3.85rem);
|
||||
height: 100%;
|
||||
background-color: var(--card-background);
|
||||
box-shadow: -2px 0 10px rgb(0 0 0 / 15%);
|
||||
transform: translateX(100%);
|
||||
@@ -499,10 +511,10 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
width: var(--sidebar-width, 225px);
|
||||
width: var(--book-filter-sidebar-width);
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
margin-left: 1rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,18 +16,18 @@
|
||||
}
|
||||
|
||||
:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper {
|
||||
width: calc(var(--sidebar-width, 225px) - 35px) !important;
|
||||
width: calc(var(--book-filter-sidebar-width, 225px) - 35px) !important;
|
||||
min-width: unset;
|
||||
}
|
||||
|
||||
.book-filter-container {
|
||||
height: 100%;
|
||||
border-radius: 0.75rem;
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
background: var(--card-background);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-left: 1px solid var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.filter-header {
|
||||
|
||||
Reference in New Issue
Block a user