This repository was archived by the owner on Aug 6, 2026. It is now read-only.
fix(canvas): fix the Activity bell's hover card resurfacing, and wedging, after it navigates - #4017
Merged
trunk-io[bot] merged 3 commits intoJul 30, 2026
Conversation
…navigates Clicking the Activity bell navigates to the Activity page, but quill's popover trigger runs its own open handler after ours and still inside the same click, so `isActivity` is false and the card stores itself as open. The Activity page only hid that state instead of clearing it, so the card reappeared over the next page opened from the feed. Swallow the open belonging to the navigating click, the same way the sidebar's Activity row already does. Generated-By: PostHog Code Task-Id: f89ba875-c0c8-4a08-b088-67b2a900e66d
|
😎 Merged successfully - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
The first pass swallowed the open that quill's trigger applies on click, which stopped the stray card but left the underlying problem: refusing an open desyncs the trigger. Base UI applies the open internally before we see it, so handing back `false` leaves the bell stuck with `data-popup-open`/`data-pressed` and its hover-open dead until the trigger remounts. The old `!isActivity` gate refused opens the same way, so this was reachable on the Activity page too. Remove the refusals instead: the trigger's own click-open is prevented outright with `preventBaseUIHandler`, and the Activity page renders the bell with no popover at all. Owning the open state in a component that only mounts off the Activity page means it is born closed on every visit, so there is nothing to mask and nothing left over to resurface. Generated-By: PostHog Code Task-Id: f89ba875-c0c8-4a08-b088-67b2a900e66d
Generated-By: PostHog Code Task-Id: f89ba875-c0c8-4a08-b088-67b2a900e66d
adboio
marked this pull request as ready for review
July 30, 2026 19:19
Contributor
|
Reviews (1): Last reviewed commit: "refactor(canvas): drop comments from the..." | Re-trigger Greptile |
There was a problem hiding this comment.
Contained UI-only fix to a canvas nav popover's open-state handling, with new regression tests covering the exact bug; no risky territory (no auth, billing, API, deps, or CI changes) touched.
- Author wrote 0% of the modified lines and has 12 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 | ✓ | 93L, 1F substantive, 132L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (132L, 2F, single-area, fix) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ 5ac5892 · reviewed head 9926f2e |
trunk-io
Bot
deleted the
posthog-code/fix-activity-bell-popover-after-nav
branch
July 30, 2026 19:46
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
Two things go wrong with the Activity bell in the channels nav, both every time:
Why: the bell is both a popover trigger and a nav button, and quill's trigger opens the card on click as well. Our handler runs first, then the trigger's own open lands — still inside the same click, before the route changes — so the card records itself as open. The Activity page only hid that (
open={!isActivity && activityOpen}) rather than closing it, so it resurfaced on the next navigation.The pressed-and-dead-hover half has the same root: refusing an open isn't free. Base UI applies the open to its store before handing it to us, so a
falsewe hand back desyncs the trigger — it keepsdata-popup-open/data-pressed, and its hover-open path bails on the stale internal state until the trigger remounts. The old!isActivitygate refused opens the same way, so hovering the bell on the Activity page wedged it too.Changes
Stop refusing opens rather than papering over the effects:
event.preventBaseUIHandler()) — the click's one job is to navigate.onOpenChangeis a plain mirror.How did you test this?
Diagnosed by probing the trigger's DOM state through the reported flow, which showed
data-popup-open/data-pressedstuck on the bell and hover dead afterwards — both reproducible onmain.ChannelNav.test.tsx: no card after the bell navigates and you open a notification, hover still opens the card afterwards, and no leftover popover state on the bell. All three fail onmain, pass here.@posthog/uisuite: 283 files / 2409 tests pass, including the existing hover-open, close-on-unhover, and no-card-on-the-Activity-page tests.turbo run typecheck --filter=@posthog/uiandbiome checkon the touched files: clean.Not driven in the running Electron app — worth a click-through when you pull it.
Automatic notifications
Created with PostHog Code