Skip to content

fix(pageFilters): Default to All Projects in open-membership orgs#110768

Open
JonasBa wants to merge 7 commits intomasterfrom
jb/fix/project-filter-open-membership-default
Open

fix(pageFilters): Default to All Projects in open-membership orgs#110768
JonasBa wants to merge 7 commits intomasterfrom
jb/fix/project-filter-open-membership-default

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Mar 16, 2026

Fixes a bug where my projects was 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.

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>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 16, 2026
…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>
JonasBa and others added 3 commits March 17, 2026 17:29
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>
@JonasBa JonasBa marked this pull request as ready for review March 18, 2026 00:34
@JonasBa JonasBa requested a review from a team as a code owner March 18, 2026 00:34
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant