Skip to content

fix(loops): Improve loop detail back navigation - #3876

Merged
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/restore-channel-loop-back-navigation
Jul 28, 2026
Merged

fix(loops): Improve loop detail back navigation#3876
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/restore-channel-loop-back-navigation

Conversation

@MattPua

@MattPua MattPua commented Jul 28, 2026

Copy link
Copy Markdown
Member

Problem

Why: Loop detail should return users to the surface they opened it from instead of always sending them to the main loops page.

Changes

  • Use router history for the loop detail back action
  • Fall back to the main loops page for direct links without prior history

How did you test this?

  • Biome check on changed files
  • git diff --check

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 3e0a680c-b843-46f6-ba7e-7898c06bcdb8
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit c174cc7.

Generated-By: PostHog Code
Task-Id: 3e0a680c-b843-46f6-ba7e-7898c06bcdb8
@MattPua MattPua changed the title Fix back navigation for channel loops Improve loop detail back navigation Jul 28, 2026
@MattPua
MattPua marked this pull request as ready for review July 28, 2026 15:06
@MattPua MattPua added the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
Comment thread packages/ui/src/features/loops/components/LoopDetailView.tsx Outdated
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/ui/src/features/loops/components/LoopDetailView.tsx:213-218
**Direct links use unrelated history**

When a user directly opens a loop-detail URL after visiting another route in the same session, `canGoBackInHistory()` treats that unrelated entry as the opening surface, causing Back to navigate there instead of using the documented loops-page fallback.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Use history for loop back navigation" | Re-trigger Greptile

@stamphog

stamphog Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed c8189df5b2ef808efa58ded274efe76865c1072c — verdict: REFUSED

Small, low-risk UI navigation tweak, but Greptile's unresolved comment flags a real edge case (direct-link visits can trigger back-navigation to unrelated history instead of the documented loops-page fallback) that the diff doesn't address.

  • Author wrote 0% of the modified lines and has 10 merged PRs in these paths (familiarity MODERATE).
  • greptile-apps[bot] reviewed the current head.
  • Unresolved Greptile inline comment: canGoBackInHistory() can navigate Back to unrelated history for direct links, contrary to the documented fallback behavior.
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 12L, 1F substantive — within ceiling
tier T1-agent / T1a-trivial (12L, 1F, single-area, unknown)
stamphog 2.0.0b3 .stamphog/policy.yml @ 2a074aa · reviewed head c8189df

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
Generated-By: PostHog Code
Task-Id: f4cc7312-bef8-46af-86a7-84a19118d770
@MattPua MattPua added the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
@MattPua MattPua changed the title Improve loop detail back navigation fix(loops): Improve loop detail back navigation Jul 28, 2026
github-actions[bot]
github-actions Bot previously approved these changes Jul 28, 2026

@github-actions github-actions 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.

Small, contained UI navigation fix outside risky territory; the prior Greptile concern about direct-link history is resolved by gating on the new loopListOrigin state flag before falling back to the loops page, and no other reviewer concerns are outstanding.

  • Author wrote 0% of the modified lines and has 10 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 23L, 2F substantive — within ceiling
tier T1-agent / T1b-small (23L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ 2a074aa · reviewed head 65db0dc

Generated-By: PostHog Code
Task-Id: f4cc7312-bef8-46af-86a7-84a19118d770
@stamphog
stamphog Bot dismissed github-actions[bot]’s stale review July 28, 2026 16:25

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@github-actions github-actions 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 navigation fix in a single feature area, outside risky territory; the one prior reviewer concern (direct links using unrelated history) is resolved and the diff's hasLoopListOrigin gate concretely addresses it.

  • Author wrote 0% of the modified lines and has 10 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 23L, 2F substantive — within ceiling
tier T1-agent / T1b-small (23L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ cd0509a · reviewed head c174cc7

@trunk-io
trunk-io Bot merged commit 36353aa into main Jul 28, 2026
33 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/restore-channel-loop-back-navigation branch July 28, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant