Skip to content

feat: clear all filters when deselecting a segment#26920

Merged
eunjae-lee merged 2 commits intomainfrom
devin/clear-filters-on-segment-deselect-1768556137
Jan 16, 2026
Merged

feat: clear all filters when deselecting a segment#26920
eunjae-lee merged 2 commits intomainfrom
devin/clear-filters-on-segment-deselect-1768556137

Conversation

@eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Jan 16, 2026

What does this PR do?

When a filter segment is selected and the user clicks it again to deselect, this PR now clears all active filters in addition to deselecting the segment.

Previously, deselecting a segment only called setSegmentId(null), which removed the segment selection but left the filters in place. Now it calls clearAll() which clears both the segment selection and all active filters.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Go to a page with DataTable and filter segments (e.g., Bookings page or Organization Members page)
  2. Select a filter segment (e.g., "My Bookings" system segment or a user-created segment)
  3. Verify filters are applied (URL contains activeFilters)
  4. Click the same segment again to deselect it
  5. Verify the segment is deselected AND all filters are cleared (URL should no longer contain activeFilters)

An e2e test has been added to filter-segment.e2e.ts:

  • Deselecting a segment clears all active filters

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Human Review Checklist

  • Verify that calling clearAll() instead of setSegmentId(null) is the intended behavior (clears both segment selection and all active filters)
  • Consider if there are use cases where users might want to keep filters when deselecting a segment

Link to Devin run: https://app.devin.ai/sessions/44f22b80d9c442bdb334d04dac2b476d
Requested by: @eunjae-lee

When a segment is selected and clicked again to deselect, now calls
clearAll() instead of just setSegmentId(null) to also clear all active
filters.

Added e2e tests to verify the behavior for both system and user segments.

Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Moved the 'Deselecting a segment clears all active filters' test from
system-segments.e2e.ts to filter-segment.e2e.ts since the behavior
applies to all segments, not just system segments.

Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jan 16, 2026
@eunjae-lee eunjae-lee marked this pull request as ready for review January 16, 2026 10:01
@graphite-app graphite-app bot added consumer core area: core, team members only labels Jan 16, 2026
@graphite-app graphite-app bot requested a review from a team January 16, 2026 10:01
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

LGTM - working well

@eunjae-lee eunjae-lee merged commit b13e0f4 into main Jan 16, 2026
84 of 85 checks passed
@eunjae-lee eunjae-lee deleted the devin/clear-filters-on-segment-deselect-1768556137 branch January 16, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments