File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ export function SidebarNavSection() {
5454 const inChannels = useRouterState ( {
5555 select : ( s ) => s . location . pathname . startsWith ( "/website" ) ,
5656 } ) ;
57+ const goNewTask = ( ) =>
58+ openTaskInput ( inChannels ? { space : "website" } : undefined ) ;
5759 const goHome = inChannels ? navigateToWebsiteHome : navigateToHome ;
5860 const goSkills = inChannels ? navigateToWebsiteSkills : navigateToSkills ;
5961 const goMcpServers = inChannels
@@ -100,7 +102,7 @@ export function SidebarNavSection() {
100102 return (
101103 < Flex direction = "column" className = "shrink-0 gap-px px-2 py-2" >
102104 < Box mb = "2" >
103- < NewTaskItem isActive = { isHomeActive } onClick = { openTaskInput } />
105+ < NewTaskItem isActive = { isHomeActive } onClick = { goNewTask } />
104106 </ Box >
105107
106108 { homeTabEnabled && (
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ export function navigateToMcpServers(): void {
100100// sidebar keeps the channels chrome instead of switching back to Code. The
101101// SidebarNavSection picks the right variant based on the active space.
102102
103+ export function navigateToWebsiteNew ( ) : void {
104+ void getRouterOrNull ( ) ?. navigate ( { to : "/website/new" } ) ;
105+ }
106+
103107export function navigateToWebsiteHome ( ) : void {
104108 void getRouterOrNull ( ) ?. navigate ( { to : "/website/home" } ) ;
105109}
Original file line number Diff line number Diff line change 1+ import { TaskInput } from "@posthog/ui/features/task-detail/components/TaskInput" ;
2+ import { useAppView } from "@posthog/ui/router/useAppView" ;
3+ import { createFileRoute } from "@tanstack/react-router" ;
4+
5+ // Channels-space mirror of the /code/ new-task screen. Renders the same shared
6+ // TaskInput (reading the same prefill) so the page stays single-source; only
7+ // the route entry is duplicated so opening it from the channels sidebar keeps
8+ // the channels chrome. (Per-channel new tasks live at /website/$channelId/new.)
9+ export const Route = createFileRoute ( "/website/new" ) ( {
10+ component : WebsiteNewTaskRoute ,
11+ } ) ;
12+
13+ function WebsiteNewTaskRoute ( ) {
14+ const view = useAppView ( ) ;
15+
16+ return (
17+ < TaskInput
18+ initialPrompt = { view . initialPrompt }
19+ initialPromptKey = { view . taskInputRequestId }
20+ initialCloudRepository = { view . initialCloudRepository }
21+ initialModel = { view . initialModel }
22+ initialMode = { view . initialMode }
23+ reportAssociation = { view . reportAssociation }
24+ />
25+ ) ;
26+ }
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ function deriveFromMatches(matches: Match[]): AppView {
4949 }
5050 case "/code/tasks/pending/$key" :
5151 return { type : "task-pending" , pendingTaskKey : last . params . key } ;
52+ // Channels-space new-task screen — same task-input view (and prefill merge
53+ // below) as the /code/ index, so the New task item highlights identically.
54+ case "/website/new" :
55+ return { type : "task-input" } ;
5256 case "/folders/$folderId" :
5357 return { type : "folder-settings" , folderId : last . params . folderId } ;
5458 case "/code/home" :
Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ export interface TaskInputNavigationOptions {
5555 initialModel ?: string ;
5656 initialMode ?: string ;
5757 reportAssociation ?: { reportId : string ; title : string } ;
58+ // Which space's new-task screen to open. Both render the same TaskInput; the
59+ // channels variant keeps the channels chrome instead of switching to Code.
60+ space ?: "code" | "website" ;
5861}
5962
6063/**
@@ -90,7 +93,11 @@ export function openTaskInput(
9093 : undefined ,
9194 } ,
9295 } ) ;
93- nav . navigateToCode ( ) ;
96+ if ( options . space === "website" ) {
97+ nav . navigateToWebsiteNew ( ) ;
98+ } else {
99+ nav . navigateToCode ( ) ;
100+ }
94101}
95102
96103export function useOpenTaskInput ( ) : typeof openTaskInput {
You can’t perform that action at this time.
0 commit comments