Skip to content

Add random picker dialog for watchlist items#23

Merged
krolebord merged 2 commits intomainfrom
claude/add-random-picker-GIqLg
Feb 6, 2026
Merged

Add random picker dialog for watchlist items#23
krolebord merged 2 commits intomainfrom
claude/add-random-picker-GIqLg

Conversation

@krolebord
Copy link
Copy Markdown
Collaborator

@krolebord krolebord commented Feb 6, 2026

Summary

Adds a new "What Should I Watch?" random picker feature to the watchlist app, allowing users to get a random recommendation from their unwatched items based on customizable filters.

Changes

  • New Component: RandomPickerDialog - A dialog-based UI for randomly selecting unwatched items with filtering options

    • Filters by maximum duration, minimum rating, priority level, and tags
    • Displays the picked item with poster, title, release date, duration, and tags
    • Allows re-rolling to pick another item or showing the picked item in the list
    • Shows count of matching items based on applied filters
  • Integration: Added RandomPickerDialog to the list page header next to the recommendations dialog

  • Minor Formatting: Reformatted the deny list in .claude/settings.local.json to single-line format

Implementation Details

  • Uses Jotai atoms (randomizedItemAtom) to communicate picked items back to the list view
  • Leverages existing database query hooks (useDbQuery) to fetch unwatched items
  • Implements tag parsing and filtering with error handling for malformed data
  • Reuses existing UI components (VoteAverage, Button, Dialog, Slider, Select) for consistency
  • Includes proper accessibility with tooltips and semantic HTML

https://claude.ai/code/session_01PoJrgSTnBTRv61tggrN25P


Open with Devin

Add a randomizer dialog that picks an unwatched item from the list,
with optional filters for max duration, min rating, priority level,
and tags. Solves the "scrolling paralysis" problem by letting users
set constraints and get a random suggestion with one click.

https://claude.ai/code/session_01PoJrgSTnBTRv61tggrN25P
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/add-random-picker-GIqLg

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

const [minRating, setMinRating] = useState(0);
const [priority, setPriority] = useState<Priority>("any");
const [selectedTag, setSelectedTag] = useState<string>("any");
const [pickedItem, setPickedItem] = useState<ListItem | null>(null);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Picked item becomes stale when filters change or database is updated

The pickedItem state holds a snapshot of a ListItem object that can become stale in two ways:

  1. Filter changes: When the user changes filters (maxDuration, minRating, priority, or tag), the filteredItems array is recalculated, but pickedItem is not cleared or revalidated. This results in displaying an item that no longer matches the current filter criteria.

  2. Database updates: If the underlying item is modified in the database (e.g., marked as watched, deleted, or has its rating changed), the pickedItem state still holds the old data since it's a copy, not a reactive reference.

Impact and Reproduction

Reproduction:

  1. Open the random picker dialog
  2. Pick a random item with rating 5
  3. Change the min rating filter to 7
  4. The picked item (with rating 5) is still displayed, even though it doesn't match the new filter
  5. The "matches" count shows a different number than what's actually being shown

Impact:

  • Confusing UX where the displayed item doesn't match the stated filter criteria
  • If the user clicks "Show in list", they navigate to an item that doesn't match their intended criteria
  • The "Re-roll" button behavior is inconsistent - it might pick from a different set than what the user expects

Expected behavior: When filters change, the pickedItem should be cleared (set to null) so the user must pick again with the new criteria.

Prompt for agents
Add a useEffect hook to clear the pickedItem state when any filter changes. After line 73 where pickedItem state is declared, add:

useEffect(() => {
  setPickedItem(null);
}, [maxDuration, minRating, priority, selectedTag]);

This ensures that when any filter changes, the previously picked item is cleared, forcing the user to pick again with the new filter criteria.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@krolebord krolebord merged commit bd5c6fc into main Feb 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants