Skip to content

fix(ui): reset module and workspace-view filters when the scope changes#365

Open
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/filter-reset-on-route
Open

fix(ui): reset module and workspace-view filters when the scope changes#365
cavidelizade wants to merge 1 commit into
Devlaner:mainfrom
cavidelizade:fix/filter-reset-on-route

Conversation

@cavidelizade

@cavidelizade cavidelizade commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Module and workspace-view filters carried over across navigation, so you could end up filtering one project by another project's member/lead/status ids (usually showing nothing).

Linked issues

Closes #339

Type of change

  • Bug fix (fix:)

Surface

  • UI (apps/web/)

What changed

  • The modules filter provider lives at the app-shell root and outlives the page. ModulesFilterContext now exposes a reset, and ModulesPage calls it when the project id changes. The last-filtered project is tracked at module scope so the reset still fires when you leave the modules page and come back under a different project (the provider keeps the stale state across that remount, a page-local ref wouldn't catch it).
  • Workspace views had the mirror bug: switching from a custom view (with saved filters) to a static view left the custom view's filters applied because the apply effect early-returned for static views. It now clears filters back to defaults when the target view is static.

Test plan

  • npm run typecheck + npm run lint pass
  • Manual: filter modules in project A by a member, open project B's modules, filters are cleared; apply filters in a custom view, switch to All issues, filters are cleared

AI assistance

  • AI tools were used, tool(s): Claude Code (Opus 4.8), commits carry a Co-Authored-By: trailer

Summary by CodeRabbit

  • Bug Fixes
    • Module filters are now cleared when switching between projects, preventing filters from carrying over unexpectedly.
    • Custom view filters are reset when navigating to built-in workspace views.
    • Filter state now resets consistently when changing contexts, showing results relevant to the selected project or view.

The modules filter provider lives at the app-shell root and outlives the page,
so a project's status/lead/member filters (project-specific ids) carried over
into the next project, usually hiding everything. ModulesPage now resets the
filter when the project id changes, tracked at module scope so it survives the
page remounting between routes.

Workspace views had the mirror problem: switching from a custom view (with
saved filters) to a static view left the custom view's filters applied, because
the apply effect early-returned for static views. Now it clears filters back to
defaults when the target view is static.

Closes Devlaner#339

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cavidelizade
cavidelizade requested a review from a team as a code owner July 16, 2026 21:10
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 10f64ca7-fb19-4af2-81ec-dd4899953a46

📥 Commits

Reviewing files that changed from the base of the PR and between 61bc903 and 9ade29e.

📒 Files selected for processing (3)
  • apps/web/src/contexts/ModulesFilterContext.tsx
  • apps/web/src/pages/ModulesPage.tsx
  • apps/web/src/pages/WorkspaceViewsPage.tsx

📝 Walkthrough

Walkthrough

Module filters now reset when switching projects, while workspace-view filters clear when navigating to static views. The module filter context exposes a reset method that restores its default state.

Changes

Filter State Scoping

Layer / File(s) Summary
Add module filter reset API
apps/web/src/contexts/ModulesFilterContext.tsx
Adds a memoized reset method to the module filter context and wires it into the provider value.
Reset filters during navigation
apps/web/src/pages/ModulesPage.tsx, apps/web/src/pages/WorkspaceViewsPage.tsx
Resets module filters when projectId changes and clears custom filters when switching to static workspace views.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: UI/UX, improvement

Suggested reviewers: martian56

Poem

A bunny hops through filters bright,
Clearing old trails left overnight.
New projects bloom, views start anew,
No stale crumbs remain in queue.
Reset and hop—what a tidy delight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional, and accurately describes the main behavior change.
Description check ✅ Passed The description covers the summary, linked issue, change details, test plan, and AI disclosure, with only non-critical template sections omitted.
Linked Issues check ✅ Passed The PR resets module filters on project changes and clears workspace-view filters on static-view switches, matching the linked issue's main bug.
Out of Scope Changes check ✅ Passed All code changes are directly related to resetting persisted filter state in the modules and workspace-views flows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

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.

Module and workspace-view filter state carries over across project/workspace switches

1 participant