Route default to /all-books and refactor book filters to server-driven signals#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b5ac984f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| signals['amazonRating'] = computed(() => this.rangedFilters(this.appBooksApi.amazonRatingOptions(), ratingRanges)); | ||
| signals['goodreadsRating'] = computed(() => this.rangedFilters(this.appBooksApi.goodreadsRatingOptions(), ratingRanges)); | ||
| signals['hardcoverRating'] = computed(() => this.rangedFilters(this.appBooksApi.hardcoverRatingOptions(), ratingRanges)); | ||
| signals['pageCount'] = computed(() => this.rangedFilters(this.appBooksApi.pageCountOptions(), pageCountRanges)); |
There was a problem hiding this comment.
Add missing rating filter signals for all supported filter types
buildFilterSignals() skips lubimyczytacRating, ranobedbRating, and audibleRating even though these filter types are part of VisibleFilterType defaults and AppBooksApiService exposes option signals for them. Because BookFilterComponent derives filterTypes from Object.keys(filterSignals), those three filters disappear from the sidebar entirely and any saved visibility settings for them become unusable.
Useful? React with 👍 / 👎.
| private readonly autoExpandVisiblePanels = effect(() => { | ||
| if (!this.showFilter()) return; | ||
| this.expandedPanels.set(this.getAutoExpandedPanels()); |
There was a problem hiding this comment.
Limit auto-expand effect to filter pane open transitions
This effect reruns whenever dependencies inside getAutoExpandedPanels() change (including activeFilters and server option signals), so while the filter pane is open it repeatedly resets expandedPanels and overrides user-collapsed accordion state. In practice, selecting a filter or option refresh can re-expand panels unexpectedly; this should only run when showFilter transitions from hidden to visible.
Useful? React with 👍 / 👎.
Motivation
/dashboardto the new/all-bookslanding route.Description
['/dashboard']with['/all-books']inLoginComponent,OidcCallbackComponent, and setup redirect guards and updated corresponding unit tests.BookFilterServiceto stop aggregating books locally and instead build cachedSignal<Filter[]>values fromAppBooksApiServiceendpoints, adding helper functionsserverOptionsToFilters,countedToFilters, andrangedFiltersto normalize server responses.BookFilterComponentto sort visible filter types by label, exposegetSortedFilters()for stable client-side display, auto-expand panels when the filter view is shown via aneffect, and usegetSortedFilters()in the template and virtual scroll sizing.Testing
vitest) covering updated specs includingoidc-callback.component.spec.ts,login.component.spec.ts,setup-guards.spec.ts, andsetup-redirect.guard.spec.ts, and all relevant tests passed.Codex Task