|
1 | 1 | import { Kanban, ListBullets, Plus, User } from "@phosphor-icons/react"; |
2 | | -import type { PrSnapshot } from "@posthog/core/home/prSnapshot"; |
3 | 2 | import { insertTaskDedup } from "@posthog/core/tasks/taskDelete"; |
4 | 3 | import { Button } from "@posthog/quill"; |
5 | 4 | import { CHANNEL_TASK_BOARD_FLAG } from "@posthog/shared"; |
@@ -50,7 +49,6 @@ import { |
50 | 49 | import { useChannelHomeUiStore } from "@posthog/ui/features/canvas/stores/channelHomeUiStore"; |
51 | 50 | import { useThreadPanelStore } from "@posthog/ui/features/canvas/stores/threadPanelStore"; |
52 | 51 | import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag"; |
53 | | -import { useHomeSnapshot } from "@posthog/ui/features/home/hooks/useHomeSnapshot"; |
54 | 52 | import { SuggestedPromptCard } from "@posthog/ui/features/task-detail/components/SuggestedPromptCard"; |
55 | 53 | import { taskDetailQuery } from "@posthog/ui/features/tasks/queries"; |
56 | 54 | import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent"; |
@@ -79,7 +77,6 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) { |
79 | 77 | const effectiveViewMode = boardEnabled ? viewMode : "feed"; |
80 | 78 | const client = useOptionalAuthenticatedClient(); |
81 | 79 | const { data: currentUser } = useCurrentUser({ client }); |
82 | | - const { snapshot: homeSnapshot } = useHomeSnapshot(); |
83 | 80 |
|
84 | 81 | // Poll while empty so the intro's context.md card flips to "created" when |
85 | 82 | // the agent publishes mid plan-session, without a manual reload. |
@@ -132,22 +129,8 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) { |
132 | 129 | : tasks, |
133 | 130 | [boardEnabled, currentUser?.uuid, taskScope, tasks], |
134 | 131 | ); |
135 | | - const prSnapshotByTaskId = useMemo(() => { |
136 | | - const result = new Map<string, PrSnapshot>(); |
137 | | - for (const workstream of [ |
138 | | - ...homeSnapshot.needsAttention, |
139 | | - ...homeSnapshot.inProgress, |
140 | | - ]) { |
141 | | - if (!workstream.pr) continue; |
142 | | - for (const task of workstream.tasks) { |
143 | | - result.set(task.id, workstream.pr); |
144 | | - } |
145 | | - } |
146 | | - return result; |
147 | | - }, [homeSnapshot.inProgress, homeSnapshot.needsAttention]); |
148 | 132 | const taskPrStates = useChannelTaskPrStates( |
149 | 133 | boardEnabled && effectiveViewMode === "board" ? visibleTasks : [], |
150 | | - prSnapshotByTaskId, |
151 | 134 | ); |
152 | 135 |
|
153 | 136 | const composerRef = useRef<ChannelHomeComposerHandle>(null); |
@@ -250,14 +233,8 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) { |
250 | 233 | ); |
251 | 234 | const handleOpenTask = useCallback((task: Task) => setPreviewTask(task), []); |
252 | 235 | const handleOpenFeedTask = useCallback( |
253 | | - (task: Task) => { |
254 | | - if (boardEnabled) { |
255 | | - setPreviewTask(task); |
256 | | - } else { |
257 | | - handleOpenFull(task.id); |
258 | | - } |
259 | | - }, |
260 | | - [boardEnabled, handleOpenFull], |
| 236 | + (task: Task) => handleOpenFull(task.id), |
| 237 | + [handleOpenFull], |
261 | 238 | ); |
262 | 239 |
|
263 | 240 | const handleOpenThread = useCallback( |
@@ -398,7 +375,6 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) { |
398 | 375 | <ChannelBoardView |
399 | 376 | tasks={visibleTasks} |
400 | 377 | isLoading={isLoading} |
401 | | - prSnapshotByTaskId={prSnapshotByTaskId} |
402 | 378 | taskPrStates={taskPrStates} |
403 | 379 | onOpenTask={handleOpenTask} |
404 | 380 | onOpenThread={handleOpenThread} |
@@ -455,15 +431,11 @@ export function WebsiteChannelHome({ channelId }: { channelId: string }) { |
455 | 431 | task={previewTask} |
456 | 432 | channelId={channelId} |
457 | 433 | prUrl={ |
458 | | - previewTask |
459 | | - ? (taskPrUrl(previewTask, prSnapshotByTaskId) ?? undefined) |
460 | | - : undefined |
| 434 | + previewTask ? (taskPrUrl(previewTask) ?? undefined) : undefined |
461 | 435 | } |
462 | 436 | prState={ |
463 | 437 | previewTask |
464 | | - ? (taskPrStates.states.get(previewTask.id) ?? |
465 | | - prSnapshotByTaskId.get(previewTask.id)?.state ?? |
466 | | - null) |
| 438 | + ? (taskPrStates.states.get(previewTask.id) ?? null) |
467 | 439 | : null |
468 | 440 | } |
469 | 441 | onClose={() => setPreviewTask(null)} |
|
0 commit comments