Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 0483df0

Browse files
authored
refactor(tasks): move shared board modules out of home
Generated-By: PostHog Code Task-Id: 1fbd8776-9d5b-4e74-9629-a6bdb8d3b78f
1 parent 40a9bdd commit 0483df0

4 files changed

Lines changed: 33 additions & 17 deletions

File tree

File renamed without changes.

packages/core/src/home/taskBoardStatus.ts renamed to packages/core/src/tasks/taskBoardStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { TaskRunStatus } from "@posthog/shared/domain-types";
2-
import type { PrSnapshot, PrSnapshotState } from "./prSnapshot";
2+
import type { PrSnapshot, PrSnapshotState } from "../home/prSnapshot";
33

44
export const TASK_BOARD_STATUSES = [
55
"working",

‎packages/ui/src/features/canvas/components/ChannelBoardView.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
TASK_BOARD_STATUSES,
1111
type TaskBoardStatus,
1212
taskBoardStatusFromSources,
13-
} from "@posthog/core/home/taskBoardStatus";
13+
} from "@posthog/core/tasks/taskBoardStatus";
1414
import type { Task } from "@posthog/shared/domain-types";
1515
import { UserAvatar } from "@posthog/ui/features/auth/UserAvatar";
1616
import {
@@ -24,13 +24,13 @@ import {
2424
} from "@posthog/ui/features/canvas/hooks/useChannelTaskPrStates";
2525
import { useTaskThread } from "@posthog/ui/features/canvas/hooks/useTaskThread";
2626
import { userDisplayName } from "@posthog/ui/features/canvas/utils/userDisplay";
27+
import type { SidebarPrState } from "@posthog/ui/features/sidebar/useTaskPrStatus";
28+
import { useInView } from "@posthog/ui/primitives/hooks/useInView";
2729
import {
2830
WorkBoard,
31+
type WorkBoardColor,
2932
type WorkBoardColumn,
30-
} from "@posthog/ui/features/home/components/WorkBoard";
31-
import type { SituationColor } from "@posthog/ui/features/home/utils/situationDisplay";
32-
import type { SidebarPrState } from "@posthog/ui/features/sidebar/useTaskPrStatus";
33-
import { useInView } from "@posthog/ui/primitives/hooks/useInView";
33+
} from "@posthog/ui/primitives/WorkBoard";
3434
import { Box } from "@radix-ui/themes";
3535
import { useMemo } from "react";
3636

@@ -49,7 +49,7 @@ const STATUS_VISUAL: Record<
4949
{
5050
label: string;
5151
description: string;
52-
color: SituationColor;
52+
color: WorkBoardColor;
5353
Icon: typeof GitCommit;
5454
}
5555
> = {

packages/ui/src/features/home/components/WorkBoard.tsx renamed to packages/ui/src/primitives/WorkBoard.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
import type { Icon } from "@phosphor-icons/react";
2-
import {
3-
type SituationColor,
4-
situationCss,
5-
} from "@posthog/ui/features/home/utils/situationDisplay";
62
import { ScrollArea } from "@radix-ui/themes";
73
import type { ReactNode } from "react";
84

5+
export type WorkBoardColor =
6+
| "red"
7+
| "orange"
8+
| "amber"
9+
| "green"
10+
| "blue"
11+
| "purple"
12+
| "gray";
13+
914
export interface WorkBoardColumn<T> {
1015
id: string;
1116
label: string;
1217
description: string;
13-
color: SituationColor;
18+
color: WorkBoardColor;
1419
Icon: Icon;
1520
items: T[];
1621
}
1722

23+
function columnColors(color: WorkBoardColor) {
24+
return {
25+
foreground: `var(--${color}-11)`,
26+
tint: `var(--${color}-a3)`,
27+
wash: `var(--${color}-a2)`,
28+
};
29+
}
30+
1831
export function WorkBoard<T>({
1932
columns,
2033
getKey,
@@ -29,7 +42,7 @@ export function WorkBoard<T>({
2942
return (
3043
<div className="flex h-full min-h-0 gap-3 overflow-x-auto p-4">
3144
{columns.map((column) => {
32-
const c = situationCss(column.color);
45+
const colors = columnColors(column.color);
3346
const count = column.items.length;
3447
return (
3548
<div
@@ -40,22 +53,25 @@ export function WorkBoard<T>({
4053
className="mb-2 flex items-center gap-2 px-1"
4154
title={column.description}
4255
>
43-
<span style={{ color: c.fg }}>
56+
<span style={{ color: colors.foreground }}>
4457
<column.Icon size={14} weight="bold" />
4558
</span>
4659
<span className="font-semibold text-[12px] text-gray-12">
4760
{column.label}
4861
</span>
4962
<span
5063
className="rounded-full px-1.5 py-px font-semibold text-[10.5px] tabular-nums"
51-
style={{ color: c.fg, backgroundColor: c.tint }}
64+
style={{
65+
color: colors.foreground,
66+
backgroundColor: colors.tint,
67+
}}
5268
>
5369
{count}
5470
</span>
5571
</div>
5672
<div
5773
className="min-h-0 flex-1 rounded-xl border border-(--gray-3)"
58-
style={{ backgroundColor: c.wash }}
74+
style={{ backgroundColor: colors.wash }}
5975
>
6076
<ScrollArea scrollbars="vertical" className="h-full min-h-0">
6177
<div className="flex flex-col gap-2 p-2">
@@ -85,7 +101,7 @@ export function WorkBoard<T>({
85101
function WorkBoardCardSkeleton() {
86102
return (
87103
<output
88-
aria-label="Loading tasks"
104+
aria-label="Loading items"
89105
className="flex h-[112px] animate-pulse flex-col gap-3 rounded-lg border border-(--gray-4) bg-(--color-panel-solid) p-3"
90106
>
91107
<div className="h-3 w-4/5 rounded bg-(--gray-5)" />

0 commit comments

Comments
 (0)