fix(pageFilters): Default to All Projects in open-membership orgs#110768
Open
fix(pageFilters): Default to All Projects in open-membership orgs#110768
Conversation
In open-membership organizations, every member implicitly has access to all projects. This means the backend treats "My Projects" (URL: no project param) identically to "All Projects" — both return all projects. The old ProjectPageFilter always showed "My Projects" as the default, even in open-membership orgs where the distinction is meaningless. This matched the pre-2023 behavior of the old projectSelector footer, which correctly showed "Select All Projects" (not "My Projects") for open-membership users. Changes: - Default selection intent is "All Projects" in open-membership orgs - "My Projects" option is hidden from the dropdown in open-membership orgs - URL encoding is unchanged: both states send no project param, matching existing backend behavior without any API changes Also fixes the "maintains stable sort" test which was flaky in the full suite because userEvent.hover() shares global pointer state between tests. Replaced hover with keyboard navigation (ArrowDown) which reliably sets the isFocused state regardless of prior test state. Co-Authored-By: Claude <noreply@anthropic.com>
…mbership
openMembership is an org setting (a boolean on the organization object),
not a feature flag. Replace organization.features.includes('open-membership')
with organization.openMembership, and update the tests to use the correct
OrganizationFixture field instead of features: ['open-membership'].
Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
The top-level organization fixture was open-membership, causing generic tests (single selection, multiple selection, keyboard navigation, reset, etc.) to implicitly test open-membership behavior. This made many assertions read 'All Projects' when the tests had nothing to do with open-membership logic. Revert the top-level fixture to a plain closed-membership org so generic tests use 'My Projects' as the default — matching actual default behavior. Move the open-membership fixture into the dedicated 'open-membership org defaults' describe block, which is the only place that should assert open-membership behavior. Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
The top-level organization fixture already has openMembership: false, so creating separate closedOrg instances with orgRole: 'member' adds noise without changing behavior. Use the default organization fixture throughout. Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
Remove the default value so callers must always pass isOpenMembership explicitly, making the dependency on org state visible at the call site. Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes a bug where
my projectswas wrongly rendered for orgs with open membership. This appears to be a long standing bug (2023) which we recently made visible when we made the list of projects checked when my projects is checkbox is enabled. Previously, when users would have my projects selected, they could not actually tell what that selection was - we made this visible.The fix is to check for org level open membership setting and hide my projects sentinel. I opted for this fix because in an org where anyone can join and query any project, the notion of my projects doesn't actually mean anything anymore - this was apparently the behavior before the was introduced.