Improve search visibility and add simple/full filter toggles#34
Improve search visibility and add simple/full filter toggles#34Swastikdan wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR adds an advanced options toggle to the recommendations and watchlist components, updating their UI to switch between "Simple" and "Full options" modes, while also refreshing the search bar styling from a dark theme to a light theme. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/recommendations.tsx (1)
419-515:⚠️ Potential issue | 🟠 MajorDon't leave advanced constraints active when the UI is in "Simple" mode.
Collapsing this section only hides the controls;
selectedEras,selectedGenres, and a non-defaultcountstill affecthandleGenerate(). In the collapsed state there is no badge or summary like the watchlist toggle, so users can generate with stale hidden constraints and no visible explanation for the changed results. Please either clear advanced state when switching back to simple mode, or surface an active-options summary/count on the toggle and expose it as a proper disclosure witharia-expanded/aria-controls.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/routes/recommendations.tsx` around lines 419 - 515, When collapsing advanced options (via setShowAdvancedOptions), clear or reset hidden advanced constraints so they don't affect handleGenerate: update the toggle handler used in the Button onClick to, when switching from true to false, call the state setters to reset selectedEras, selectedGenres, and count to their defaults (e.g., setSelectedEras([]), setSelectedGenres([]), setCount(DEFAULT_COUNT)); ensure you reference the existing state vars and setters (selectedEras, selectedGenres, count, setSelectedEras, setSelectedGenres, setCount, setShowAdvancedOptions) so hidden constraints are not applied when showAdvancedOptions is false.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/routes/recommendations.tsx`:
- Around line 419-515: When collapsing advanced options (via
setShowAdvancedOptions), clear or reset hidden advanced constraints so they
don't affect handleGenerate: update the toggle handler used in the Button
onClick to, when switching from true to false, call the state setters to reset
selectedEras, selectedGenres, and count to their defaults (e.g.,
setSelectedEras([]), setSelectedGenres([]), setCount(DEFAULT_COUNT)); ensure you
reference the existing state vars and setters (selectedEras, selectedGenres,
count, setSelectedEras, setSelectedGenres, setCount, setShowAdvancedOptions) so
hidden constraints are not applied when showAdvancedOptions is false.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a5ce8d7f-93e0-478c-a868-180e237ed86c
📒 Files selected for processing (3)
src/components/ui/search-bar.tsxsrc/routes/recommendations.tsxsrc/routes/watchlist.tsx
Motivation
Description
src/components/ui/search-bar.tsxto use a higher-contrast background, stronger border, and subtle shadow so the field is less dim and matches other surfaces.showAdvancedOptionstoggle and aSlidersHorizontalbutton tosrc/routes/recommendations.tsxand moved era/count/genre controls behind this toggle so the default view is simpler.src/routes/recommendations.tsx.src/routes/watchlist.tsxand adjusted the filters container visibility to be toggled on demand.Testing
pnpm -s biome check src/components/ui/search-bar.tsx src/routes/recommendations.tsx src/routes/watchlist.tsxwhich completed successfully.pnpm -s tsc --noEmitwhich completed successfully.Codex Task
Summary by CodeRabbit
New Features
Style