feat(deep-link): posthog-code://new?prompt=… opens prefilled task input#2020
Draft
posthog[bot] wants to merge 1 commit intomainfrom
Draft
feat(deep-link): posthog-code://new?prompt=… opens prefilled task input#2020posthog[bot] wants to merge 1 commit intomainfrom
posthog[bot] wants to merge 1 commit intomainfrom
Conversation
…nput Adds a new deep link key handled by TaskLinkService that opens the task input view with an optional prompt prefilled. Reuses the existing pending deep link queue + tRPC subscription pattern so cold-start launches are covered. Whitespace-only prompts collapse to undefined. Generated-By: PostHog Code Task-Id: 2521ff3b-a2ea-48ec-adf6-db44a6661ef4
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.
Summary
Adds a new deep link key so external integrations can launch PostHog Code straight into the new-task view with an optional prompt prefilled.
URL:
posthog-code://new?prompt=fix%20the%20bug(prod) orposthog-code-dev://new?prompt=…(dev)."new"handler registered inTaskLinkService. The handler readspromptfrom the URL's query params, treats whitespace-only values as undefined, and emits aCreateTaskevent (or queues it as a pending deep link if the renderer isn't ready yet).deepLinkRoutergetsonCreateTask(subscription) +getPendingNewTaskLink(query), mirroring the existing task / inbox shape.useTaskDeepLinknow drains pending new-task links on mount (cold start) and subscribes toonCreateTask(warm start), then callsnavigateToTaskInput({ initialPrompt })— which is the same path the codebase already uses for prefilled inputs from inbox reports.taskandinboxhandlers.task-link/service.test.tscovering both the existing task handler (which had no tests) and the new-task handler.Test plan
pnpm --filter code typecheckpassespnpm --filter code exec vitest run src/main/services/task-linkpasses (12/12)posthog-code-dev://new?prompt=hello%20worldin dev — task input opens with "hello world" prefilledposthog-code-dev://new— task input opens with empty promptposthog-code-dev://new?prompt=testfrom a terminal — app launches into prefilled inputCreated with PostHog Code