Skip to content

fix: update filter behavior to clear tags when 'all' is selected#271

Open
shubham6822 wants to merge 1 commit intojnsahaj:mainfrom
shubham6822:fix/community-all-themes-filter-tag-sync
Open

fix: update filter behavior to clear tags when 'all' is selected#271
shubham6822 wants to merge 1 commit intojnsahaj:mainfrom
shubham6822:fix/community-all-themes-filter-tag-sync

Conversation

@shubham6822
Copy link
Copy Markdown

@shubham6822 shubham6822 commented Apr 1, 2026

What

  • "All Themes" is no longer shown as selected when a tag filter is active
  • Clicking "All Themes" now clears the ?tags= query param from the URL, resetting the page to show all themes

Why

When a tag was active (e.g., ?tags=minimal), the sidebar incorrectly highlighted both the tag and "All Themes" simultaneously. Additionally, clicking "All Themes" only updated the filter state but left the tags param intact, so themes remained filtered.

Changes

  • app/community/components/community-sidebar.tsx: Updated active state logic for "All Themes" to only apply when no tags are selected
  • app/community/components/community-themes-content.tsx: Updated handleFilterChange to call setTags([]) when "all" is selected

Closes #270

Summary by CodeRabbit

  • Bug Fixes
    • Improved filter button styling when tags are selected; matching filters now display standard hover states instead of active styling for better visual clarity
    • Fixed the filter reset mechanism; selecting the "all" filter now properly clears any previously selected tags, enabling a cleaner and more intuitive filtering experience

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87d38883-3b76-4b9c-b83a-bc964fdba51d

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb9c4c and f31eb46.

📒 Files selected for processing (2)
  • app/community/components/community-sidebar.tsx
  • app/community/components/community-themes-content.tsx

📝 Walkthrough

Walkthrough

The pull request fixes UI state synchronization in the community theme filtering system. The sidebar now conditionally applies the "active" visual state only when no tags are selected, and clicking "All Themes" clears active tag filters from the URL query parameters.

Changes

Cohort / File(s) Summary
Community Sidebar Styling
app/community/components/community-sidebar.tsx
Updated filter button active styling logic to disable the active state (bg-foreground/10 text-foreground) when tags are selected, preventing "All Themes" from appearing selected alongside active tag filters.
Community Themes Filter Logic
app/community/components/community-themes-content.tsx
Enhanced handleFilterChange to clear tag query state when "all" filter is selected, ensuring tag filters are properly reset. Updated function dependency array to include setTags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With a hop and a click, the filters align,
Tags clear away when "all" shines so fine,
No double selection to cause dismay,
The sidebar now guides the proper way!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating filter behavior to clear tags when 'all' is selected, which is directly related to the changeset modifications.
Linked Issues check ✅ Passed The PR changes address both requirements from issue #270: preventing 'All Themes' from appearing selected when tags are active (via community-sidebar.tsx) and clearing the tags query parameter when 'All Themes' is clicked (via community-themes-content.tsx).
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the UI state sync issue described in issue #270; no unrelated modifications are present in the two affected component files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

@shubham6822 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@shubham6822
Copy link
Copy Markdown
Author

Hey @jnsahaj ,
can you please check and merge this PR if everything looks good?

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.

All Themes incorrectly remains selected with active tag and does not clear filter on click

1 participant