fix(dashboard): improve performance with OnPush change detection (#440)

* fix(dashboard): improve performance with OnPush change detection

* fix(dashboard): refactor book card component for improved readability and performance

* fix(tests): mock matchMedia for improved test compatibility

* fix(tests): matchMedia mock for better CI compatibility and support

* fix(dashboard): add clearAll method to BookBrowserScrollService and update tests

* fix(dashboard): improve performance with content visibility and refactor styles

* fix(dashboard): improve scroll performance with estimated total height and refactor layout

* fix(tests): add mock for getCurrentUser in userService for improved test coverage

* fix(dashboard): implement infinite scroll for book loading and scroll restoration

* fix(tests): fix lint error

* fix(tests): mock ResizeObserver and IntersectionObserver

* fix(tests): mock ResizeObserver and IntersectionObserver (again)

* fix(dashboard): improve accessibility and performance by updating aria attributes and optimizing animations

* fix(dashboard): improve submenu accessibility and optimize virtual scroller performance

* fix(dashboard): clean up imports and improve component structure

* fix(dashboard): correct mobile check in author browser component

* fix(dashboard): add OnDestroy lifecycle hook to BookBrowserComponent
This commit is contained in:
brios
2026-04-22 17:27:11 -04:00
committed by Zach Yale
parent a779de8f57
commit 85e8d235b6
140 changed files with 1546 additions and 1233 deletions
@@ -440,32 +440,31 @@
padding: 1rem;
box-sizing: border-box;
overflow-y: auto;
will-change: scroll-position;
overflow-anchor: none;
@media (width <= 768px) {
height: calc(100dvh - 9rem);
}
}
.grid {
.book-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(1px, 1fr));
column-gap: 21px;
gap: 21px;
align-items: start;
width: 100%;
contain: layout style;
// Mobile: fixed 2 or 3 columns based on phone width
@media (width <= 767px) {
column-gap: 8px;
gap: 0.5rem 8px;
padding: 0 0.5rem;
}
}
.scroll-sentinel {
height: 1px;
}
.virtual-scroller-item {
position: relative;
margin-bottom: 21px; // Whole px to avoid parseInt truncation in ngx-virtual-scroller
margin-bottom: 21px;
contain: strict;
content-visibility: auto;
contain-intrinsic-size: auto var(--virtual-scroller-item-height, 220px);