Skip to content

Redirect post-login to /all-books and refactor BookFilter to server-backed signals#2

Merged
dinosmm merged 2 commits into
dmsfrom
codex/recreate-sidebar-filter-behaviors-vp62nu
Apr 24, 2026
Merged

Redirect post-login to /all-books and refactor BookFilter to server-backed signals#2
dinosmm merged 2 commits into
dmsfrom
codex/recreate-sidebar-filter-behaviors-vp62nu

Conversation

@dinosmm

@dinosmm dinosmm commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Change the default landing page after login and OIDC callback from /dashboard to the new /all-books route to reflect updated UX/navigation.
  • Replace client-side aggregation of filter options with server-provided options to improve performance and correctness for the book filter UI.
  • Improve filter UI behavior by ensuring stable sorting, proper virtual scroll sizing, and auto-expanding a sensible default panel when the filter panel becomes visible.

Description

  • Updated post-login redirects in OidcCallbackComponent, LoginComponent, and setup redirect guards/specs to navigate to /all-books instead of /dashboard and adjusted related spec expectations (oidc-callback.component.ts, login.component.ts, setup-redirect.guard.spec.ts, setup-guards.spec.ts, login.component.spec.ts, oidc-callback.component.spec.ts).
  • Reworked BookFilterService to build cached filterSignals from AppBooksApiService and Angular Signal/computed APIs instead of computing filters from the local BookService, and added helpers serverOptionsToFilters, countedToFilters, and rangedFilters to convert server options into Filter[] structures.
  • Updated BookFilterComponent to sort visible filter types alphabetically, provide getSortedFilters() for stable locale-aware ordering, switch the template to iterate over sorted filters and compute virtual scroll height from that sorted list, and added an auto-expand effect (wasFilterVisible, autoExpandVisiblePanels) and getAutoExpandedPanels() to set sensible default expanded panels.
  • Removed older aggregation/streaming code paths and adjusted imports and types to align with server-driven filter option shapes (e.g. AppFilterOptions, LanguageOption, range constants, and READ_STATUS_LABELS).

Testing

  • Updated and ran unit tests covering the login flow and OIDC callback (oidc-callback.component.spec.ts and login.component.spec.ts) and the setup redirect guards (setup-redirect.guard.spec.ts and setup-guards.spec.ts), and the spec expectations were updated to assert navigation to /all-books where applicable.
  • Ran the frontend unit test suite for modified components and services, and all updated tests passed.

Codex Task

@dinosmm dinosmm merged commit 8e971e3 into dms Apr 24, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

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));

P1 Badge Add missing server-backed rating filter signals

buildFilterSignals() now manually enumerates filter keys, but this block only wires amazonRating, goodreadsRating, and hardcoverRating; it never creates signals for lubimyczytacRating, ranobedbRating, or audibleRating. Those types are still part of FilterType and DEFAULT_VISIBLE_FILTERS, so they silently disappear from visibleFilterTypes() and users can no longer select them in the sidebar. Please add computed signals for all three using the corresponding AppBooksApiService option signals.


if (!this.wasFilterVisible()) {
this.expandedPanels.set(this.getAutoExpandedPanels());
this.wasFilterVisible.set(true);
}

P2 Badge Re-run default panel expansion after options arrive

This effect marks wasFilterVisible as true on the first visible render even when filter data has not loaded yet. In the common case where the sidebar is already visible and category options arrive asynchronously, getAutoExpandedPanels() initially returns [], and later updates no longer call expandedPanels.set(...) because of the wasFilterVisible guard. The result is that the default panel never auto-expands unless the user hides and re-shows the sidebar.

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant