feat: community projects "My contributions only" toggle and switcher entry#3820
Merged
Anty0 merged 4 commits intoJul 24, 2026
Merged
Conversation
…entry Add the "My contributions only" toggle to /community-projects (default on, listing public projects the user contributed to as a non-member; off lists all public projects), served by a new opt-in filterContributed param on GET /v2/public/projects/with-stats reusing the project_contributor table. Re-wire the "Community translation" org-switcher entry, gated on a new InitialDataModel.hasCommunityContributions flag (a cheap EXISTS over the project_contributor user_id index), so the entry appears exactly when the community page has something to show. Re-enable the five skipped switcher navigation e2e tests and adapt the list/threshold tests to the default-on toggle; seed the required contributions in e2e test data.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…ments Rewrite hasNonMemberPublicContribution to structurally mirror ProjectRepository.findAllPublic so the switcher gate and the community-page listing read the same rule and cannot silently diverge (behavior-preserving). Remove design-rationale/test-setup comments per the project comments rule. Rename the stashed e2e-data field to currentTestData to drop the parameter shadowing (matches QaE2eDataController). Add a test covering the direct-permission half of the membership exclusion, and clean communityContributionData in the list/threshold/toggle e2e suites so they are isolated from the navigation suite's seeding regardless of run order.
… constant Replace the two parallel copies of the "non-member public contributor" filter with a single ProjectRepository.NON_MEMBER_CONTRIBUTOR_FILTER constant, used by both findAllPublic (mine-only branch) and hasNonMemberPublicContribution, so the switcher gate and the community-page listing cannot diverge by construction — the codebase's existing pattern (BASE_VIEW_QUERY, PUBLIC_PROJECT_VISIBILITY). Unify the bind parameter name and drop the coupling comment.
Add an e2e test asserting the "Community translation" switcher entry is absent for a signed-in user with no community contributions — the gate's false branch was untested, so a regression to always-on would have passed the suite. Also: document NON_MEMBER_CONTRIBUTOR_FILTER's required aliases/param, rename the injected UserAccountService to the conventional name, and switch the captured e2e-data field to the nullable-with-guard convention used by the sibling e2e controllers.
Anty0
merged commit Jul 24, 2026
4caf8fd
into
jirikuchynka/community-contributors
103 of 110 checks passed
Anty0
added a commit
that referenced
this pull request
Jul 25, 2026
…entry (#3820) Add the "My contributions only" toggle to /community-projects (default on; lists public projects the user contributed to as a non-member, off lists all public projects) via an opt-in filterContributed param on GET /v2/public/projects/with-stats. Re-wire the "Community translation" org-switcher entry, gated on a new InitialDataModel.hasCommunityContributions flag; the gate and the list filter share one NON_MEMBER_CONTRIBUTOR_FILTER constant. Re-enable the five skipped switcher-navigation e2e tests and add default-on/negative-branch coverage.
Anty0
added a commit
that referenced
this pull request
Jul 25, 2026
…entry (#3820) Add the "My contributions only" toggle to /community-projects (default on; lists public projects the user contributed to as a non-member, off lists all public projects) via an opt-in filterContributed param on GET /v2/public/projects/with-stats. Re-wire the "Community translation" org-switcher entry, gated on a new InitialDataModel.hasCommunityContributions flag; the gate and the list filter share one NON_MEMBER_CONTRIBUTOR_FILTER constant. Re-enable the five skipped switcher-navigation e2e tests and add default-on/negative-branch coverage.
Anty0
added a commit
that referenced
this pull request
Jul 26, 2026
…entry (#3820) Add the "My contributions only" toggle to /community-projects (default on; lists public projects the user contributed to as a non-member, off lists all public projects) via an opt-in filterContributed param on GET /v2/public/projects/with-stats. Re-wire the "Community translation" org-switcher entry, gated on a new InitialDataModel.hasCommunityContributions flag; the gate and the list filter share one NON_MEMBER_CONTRIBUTOR_FILTER constant. Re-enable the five skipped switcher-navigation e2e tests and add default-on/negative-branch coverage.
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.
Part 3 of the Community Contributors pitch (#3806) — the
/community-projectspage. Merges into the integration branchjirikuchynka/community-contributors(#3819), notmain.What this adds
/community-projects, default on. On, it lists public projects the user contributed to but is not a member of; off lists every public project. It sits where the add button renders on the normal projects list (the header's right slot, next to the search field).How it works
filterContributedparam onGET /v2/public/projects/with-stats. The predicate reuses Scope A'sproject_contributortable (EXISTSa contribution) plus a member-exclusion that mirrors the per-project contributor list, so the page and the switcher agree. The param is opt-in per caller, so the public homepage listing (which shares the hook) is unchanged.InitialDataModel.hasCommunityContributionsboolean — a cheapEXISTSover theproject_contributoruser_idindex, computed per authenticated user and piggybacked on the already-cachedinitial-datapayload the switcher reads (no extra request, available on every page).Tests
filterContributedlisting (non-member contributor only; member-owned excluded; anonymous empty) and thehasCommunityContributionsboolean, inPublicProjectsControllerTest;InitialDataControllerTestasserts the field is wired.adminlogin user via a small dedicated e2e-data set); existing list/threshold tests flip the toggle off (they assert the all-public view); new tests cover the default-on mine-only behavior.Known limitation (accepted, per pitch scope)
A contributor with no organization of their own won't see the switcher entry — the org popover renders nothing without a preferred organization.
Translations
The
community_my_contributions_togglekey ("My contributions only") is created in the Tolgee project (id 1), taggeddraft: community-projects-page. No screenshot uploaded yet.