fix(canvas): open channel-filed task notifications in /website#2784
Merged
raquelmsmith merged 2 commits intoJun 19, 2026
Conversation
Clicking a "task needs action" notification (or a posthog-code://task deep
link) always navigated to /code/tasks/$taskId, even when the task was filed
to a Project Bluebird channel. It now routes filed tasks to their channel
view at /website/$channelId/tasks/$taskId, mirroring the command palette.
- openTask() takes an optional { channelId } and navigates to the channel
route when present, keeping all other side effects (cache seed, analytics,
workspace binding) identical.
- useTaskDeepLink resolves channel membership (gated by PROJECT_BLUEBIRD_FLAG)
via useChannels + useTaskChannelMap, held in a ref so the open-task
subscription isn't recreated on each channel poll.
- CommandMenu collapsed onto the same parameterized openTask helper.
Generated-By: PostHog Code
Task-Id: 81a5307a-63f0-4aae-8376-60ef3faa0f42
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/ui/src/features/deep-links/useTaskDeepLink.test.tsx:77-114
**Prefer parameterised tests for the routing dispatch cases**
The three cold-start routing assertions repeat the same setup (set `channelMapState.map`, mock `getPendingDeepLink`, `renderHook`, `waitFor`) and differ only in flag state, channel map contents, and the expected `routerOpenTask` args. Per the project rule, collapsing them into a single `it.each` would express the same ideas without duplication. A fourth row could cover the warm-start path (trigger via `onOpenTask`'s subscription callback rather than `getPendingDeepLink`) to close that coverage gap at the same time.
Reviews (1): Last reviewed commit: "fix(canvas): open channel-filed task not..." | Re-trigger Greptile |
Collapse the repeated cold-start routing assertions into a single it.each covering unfiled, channel-filed, and flag-off cases, and add a warm-start row that drives the onOpenTask subscription callback — closing that coverage gap. Follows the project's parameterised-test convention. Generated-By: PostHog Code Task-Id: 81a5307a-63f0-4aae-8376-60ef3faa0f42
Member
Author
|
tested locally, works |
Contributor
|
Reviews (2): Last reviewed commit: "test(canvas): parameterise task deep-lin..." | Re-trigger Greptile |
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.
Problem
When a task needs action, the user gets a desktop notification. Clicking it always opened the task at
/code/tasks/$taskId— even when the task was filed to a Project Bluebird channel, where it should open in the channel-organized view at/website/$channelId/tasks/$taskId(keeping the channels chrome), exactly like the command palette already does.The notification click and
posthog-code://task/<id>deep links both funnel throughuseTaskDeepLink, which calledopenTask(task)and unconditionally navigated to/code. Nothing consulted channel membership.Change
useOpenTask.ts—openTasknow accepts an optional{ channelId }. When present it navigates vianavigateToChannelTask(→/website); otherwise/codeas before. Every other side effect (detail-cache seed, analytics,ensureWorkspaceForTask) is unchanged, so channel tasks still get workspace provisioning. Existing single-arg callers are unaffected.useTaskDeepLink.ts— resolves channel membership (gated behindPROJECT_BLUEBIRD_FLAG) viauseChannels+useTaskChannelMap, mirrored into a ref so the stablehandleOpenTaskcallback reads the current map without tearing down theonOpenTasksubscription on each 30s channel poll.CommandMenu.tsx— collapsed its duplicatedif/elsebranch onto the same parameterizedopenTask, so palette-opened channel tasks also get workspace binding.This fixes both notification clicks and deep links, since they share the path.
Known limitation
Cold start (app launched by the click before the channel map has loaded) falls back to
/code. Warm clicks — the dominant case for "needs action" notifications — route correctly.Verification
pnpm --filter @posthog/ui test run …/useTaskDeepLink.test.tsx— 4/4 pass (added cases: filed task → channel route; flag-off →/code).pnpm --filter @posthog/ui typecheck— clean.biome linton changed files — clean.🤖 Generated with Claude Code