feat(activity): allow showing private contributions on public profile#38391
Open
m5r wants to merge 7 commits into
Open
feat(activity): allow showing private contributions on public profile#38391m5r wants to merge 7 commits into
m5r wants to merge 7 commits into
Conversation
Assisted-by: Claude Code:claude-fable-5 Signed-off-by: m5r <mokhtar@mial.net>
Assisted-by: Claude Code:claude-fable-5 Signed-off-by: m5r <mokhtar@mial.net>
Assisted-by: Claude Code:claude-fable-5 Signed-off-by: m5r <mokhtar@mial.net>
Assisted-by: Claude Code:claude-fable-5 Signed-off-by: m5r <mokhtar@mial.net>
Member
|
did some cleanups |
…ivate-activity Signed-off-by: m5r <mokhtar@mial.net>
Author
|
Thanks, I resolved the conflict that was present on |
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 #21585
Adds an opt-in user setting (defaults to off): "Include private contributions on my profile". When enabled:
/{username}/-/heatmapand API/api/v1/users/{user}/heatmap, both go throughGetUserHeatmapDataByUser), so the heatmap looks the same to the owner and to visitors.GET/PATCH /api/v1/user/settingsasshow_private_activity, next tohide_activity.This is similar to GitHub's "Include private contributions on my profile" toggle, with per-day rollups instead of GitHub's per-month timeline summaries.
Design
ENABLE_USER_HEATMAP).keep_activity_privatewins: with activity fully hidden, this setting has no effect (ActivityReadableshort-circuits). Users with limited/private visibility stay hidden from viewers who cannot see their profile at all (IsUserVisibleToViewer).Known limitation
The heatmap buckets days in the browser's timezone while the
?date=filter and the rollups use the server's, but this is a pre-existing mismatch (clicking a heatmap square near a day boundary can already show a feed that doesn't match the square). Rollup dates follow the existing browser-local display convention; viewers offset more than 12h from the server timezone can see an adjacent date.Testing
models/activities/user_heatmap_test.go): heatmap visibility matrix including opted-in cases and the collaborator invariant; rollup partition tests (mid-day page boundaries, hidden actions interleaving visible ones, timestamp ties, out-of-range pages, day bucketing).tests/integration/showprivateactivity_test.go): setting off/on, heatmap counts via web + API, rollup rows without leaking repo links, invalid dates, pages beyond the feed, owner's own view,keep_activity_privateprecedence, API settings round-trip including a null-field PATCH.Screenshots