feat(ui): bring adult-hidden-by-default and category tabs to the TUI - #110
Merged
Merged
Conversation
…, add category tabs Adult-sourced favourites and stream-history items used to stay visible forever once saved, regardless of the search-time adultContent setting — browsing the Porn category left Continue Watching full of adult items with no way to hide them. A new independent adultHistoryVisible setting (default off) now gates them out entirely server-side, and while we're splitting the lists at all, Library and Continue Watching both gain general category tabs (Movies/TV/Anime/etc, derived from each item's source) rather than a single flat list. - src/sources/registry.ts: categoryForSource/isAdultSource/ visibleWithAdultHistory/nonEmptyCategories — the shared classification and filtering helpers, reused by the TUI in a follow-up PR. - src/config/config.ts: adultHistoryVisible config field + resolver + sanitiseSettingsPatch entry. - src/web/wire.ts, routes.ts: PublicFavourite/PublicStreamHistoryItem gain a server-computed `category`; SavedResponse/LibraryResponse/ ContinueWatchingResponse gain non-empty tab lists; savedLists/libraryAction/ continueWatchingAction filter adult items out of every response when the setting is off, so they never reach the browser at all. - src/web/static/savedModel.ts, app.ts, settingsModel.ts, index.html: tab strips for both lists, driven by the server-provided category lists, plus the new "Adult history" toggle in the settings dialog. Verified manually via serve --web: toggling the setting live updates the tab strips and their data with no page reload. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XddtC9qHvnPLb4xp9fiL7n
Follow-up to the web PR: the TUI's Favourites and Continue Watching panes get the same treatment. Adult items are filtered out of the Store's favourites/streamHistory fields in App.tsx (gated by the adultHistoryVisible setting added in the core+web PR), so neither pane ever sees them when the setting is off — same guarantee as the web wire. Both panes also gain category tabs (cycled with [ and ]), reusing categoryForSource/ nonEmptyCategories from src/sources/registry.ts rather than re-deriving categories locally. - src/ui/store.ts, App.tsx: adultHistoryVisible store field + toggle action, and the one filtering choke-point for both lists. - src/ui/components/Favourites.tsx, ContinueWatching.tsx: category tab strip, [ / ] to cycle (the only free key pair in both panes' existing bindings). - src/ui/components/Settings.tsx: "Adult history" toggle row, after "Adult screenshots". - src/ui/testHarness.ts, scripts/render-previews-impl.tsx: matching Store field per this repo's CLAUDE.md rule; preview/settings.svg regenerated to match (browse.svg/help.svg left untouched — their diffs were unrelated pre-existing drift from an "o" keybinding, not this change). - New Favourites.test.tsx (no test file existed before) plus tab-cycling tests in ContinueWatching.test.tsx and the new toggle row in Settings.test.tsx. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XddtC9qHvnPLb4xp9fiL7n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #109 (core + web) — stacked on that branch since it needs the
adultHistoryVisibleconfig field and thecategoryForSource/visibleWithAdultHistory/nonEmptyCategoriesregistry helpers it introduces. Base this againstmainonce #109 merges, or merge #109 first.favourites/streamHistoryfields inApp.tsx(one choke point), gated by the sameadultHistoryVisiblesetting — Favourites and Continue Watching never see them when it's off, matching the web UI's guarantee.[/](the only free key pair in both panes' existing bindings — arrows/j/k/Return/x, plusr/sin Continue Watching).testHarness.tsandrender-previews-impl.tsxget the matchingStorefield per this repo's CLAUDE.md rule;preview/settings.svgregenerated to match (leftbrowse.svg/help.svguntouched — their diffs on anpm run previewsrun were unrelated pre-existing drift from anokeybinding, not this change).Test plan
npm test— 3344 tests pass, including newFavourites.test.tsx(no test file existed for this component before) and new tab-cycling tests inContinueWatching.test.tsx/Settings.test.tsxnpm run typechecknpm run lint— only the pre-existingreact-hooks/exhaustive-depswarningnpm run buildnpm run previews— regeneratedpreview/settings.svgshows the new "Adult history" row rendering correctly🤖 Generated with Claude Code