Skip to content

fix(loops): group loops by visibility - #81654

Merged
trunk-io[bot] merged 2 commits into
masterfrom
posthog/fix/loop-visibility-tabs
Aug 13, 2026
Merged

fix(loops): group loops by visibility#81654
trunk-io[bot] merged 2 commits into
masterfrom
posthog/fix/loop-visibility-tabs

Conversation

@benben

@benben benben commented Aug 12, 2026

Copy link
Copy Markdown
Member

Problem

Anyone with a team loop they created themselves sees it filed under "My loops" instead of "Team loops", because the loops list groups by creator ownership rather than by the loop's own visibility. Teammates browsing Team loops miss loops that happen to be authored by the person viewing.

Ports PostHog/code#3957.

Changes

  • Group personal and team loops by their visibility value instead of creator ownership.
  • Team-visible loops created by the current user now appear under Team loops.
  • Removed the current-user request from LoopsListView — it only existed to support ownership grouping.
  • Regression coverage for team loops created by the signed-in user.

The monorepo tree has drifted from the source repo (a sharedPageHeader prop landed since, and the tab-switching test was split), so the port was applied by hand rather than git am; the third source hunk targeted a test that no longer exists in that form, and its intent is already covered.

How did you test this code?

  • pnpm exec vitest run src/features/loops/components/LoopsListView.test.tsx — 3 passed (from packages/ui root)
  • pnpm exec vitest run src/features/loops — all 12 loops test files, 206 tests passed
  • pnpm exec biome check on both changed files — clean
  • pnpm typecheck in packages/ui — clean (after building workspace deps)

Did not run the app or exercise the UI manually.

Automatic notifications

  • Publish to changelog?

Docs update

None — internal grouping behavior no user-facing docs describe.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Ported with PostHog Desktop using the repo's porting-code-prs skill (mentioned in a comment on the source PR). The source tree and the imported products/desktop tree had drifted, so the agent applied the patch's intent manually, verified no other consumers relied on the removed currentUserId prop, and kept the stories file untouched since it never used the prop.


Created with PostHog Desktop

Ports PostHog/code#3957 into the monorepo products/desktop tree.

- group personal and team loops by their visibility instead of creator ownership
- move team-visible loops created by the current user into Team loops
- remove the current-user request that was only needed for ownership grouping
- add regression coverage for team loops created by the signed-in user

Generated-By: PostHog Desktop
Task-Id: af12ea6d-4341-4ab3-8ff6-8faf1ae36e08
@trunk-io

trunk-io Bot commented Aug 12, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@benben benben self-assigned this Aug 12, 2026
@benben
benben requested a review from a team August 12, 2026 08:06
@benben
benben marked this pull request as ready for review August 12, 2026 08:06
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit bf2f595.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(loops): group loops by visibility" | Re-trigger Greptile

@trunk-io

trunk-io Bot commented Aug 12, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@benben benben added the stamphog Request AI approval (no full review) label Aug 13, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Contained UI bug fix that changes loop grouping to key off visibility instead of creator ownership, removing an unneeded currentUser fetch; diff matches the description, tests were updated to match new behavior, and no risky-territory (auth/billing/API/schema/CI/deps) is touched.

  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 34L, 1F substantive, 56L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1b-small (56L, 2F, single-area, fix)
stamphog 2.0.0b4 .stamphog/policy.yml @ 824d8b3 · reviewed head 911e80c

@trunk-io
trunk-io Bot merged commit 00f50ad into master Aug 13, 2026
195 checks passed
@trunk-io
trunk-io Bot deleted the posthog/fix/loop-visibility-tabs branch August 13, 2026 11:55
@deployment-status-posthog

deployment-status-posthog Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-08-13 12:45 UTC Run
prod-us ✅ Deployed 2026-08-13 13:09 UTC Run
prod-eu ✅ Deployed 2026-08-13 13:11 UTC Run

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

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant