Skip to content

Commit e7dcd4a

Browse files
committed
Wizard integration and first data-less tasks
1 parent de71216 commit e7dcd4a

16 files changed

Lines changed: 1727 additions & 8 deletions

File tree

apps/code/src/main/services/workspace/service.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import { CreateOrSwitchBranchSaga } from "@posthog/git/sagas/branch";
1515
import { DetachHeadSaga } from "@posthog/git/sagas/head";
1616
import { WorktreeManager } from "@posthog/git/worktree";
17+
import { ANALYTICS_EVENTS } from "@shared/types/analytics";
1718
import { inject, injectable } from "inversify";
1819
import type { RepositoryRepository } from "../../db/repositories/repository-repository";
1920
import type { WorkspaceRepository } from "../../db/repositories/workspace-repository";
@@ -340,9 +341,9 @@ export class WorkspaceService extends TypedEventEmitter<WorkspaceServiceEvents>
340341
branchName,
341342
error,
342343
});
343-
trackAppEvent("branch_link_default_branch_unknown", {
344-
taskId,
345-
branchName,
344+
trackAppEvent(ANALYTICS_EVENTS.BRANCH_LINK_DEFAULT_BRANCH_UNKNOWN, {
345+
task_id: taskId,
346+
branch_name: branchName,
346347
});
347348
return;
348349
}
@@ -368,7 +369,7 @@ export class WorkspaceService extends TypedEventEmitter<WorkspaceServiceEvents>
368369
taskId,
369370
branchName,
370371
});
371-
trackAppEvent("branch_linked", {
372+
trackAppEvent(ANALYTICS_EVENTS.BRANCH_LINKED, {
372373
task_id: taskId,
373374
branch_name: branchName,
374375
source: source ?? "unknown",
@@ -382,7 +383,7 @@ export class WorkspaceService extends TypedEventEmitter<WorkspaceServiceEvents>
382383
taskId,
383384
branchName: null,
384385
});
385-
trackAppEvent("branch_unlinked", {
386+
trackAppEvent(ANALYTICS_EVENTS.BRANCH_UNLINKED, {
386387
task_id: taskId,
387388
source: source ?? "unknown",
388389
});

apps/code/src/renderer/components/MainLayout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { useInboxDeepLink } from "@features/inbox/hooks/useInboxDeepLink";
1414
import { FolderSettingsView } from "@features/settings/components/FolderSettingsView";
1515
import { SettingsDialog } from "@features/settings/components/SettingsDialog";
1616
import { useSettingsDialogStore } from "@features/settings/stores/settingsDialogStore";
17+
import { SetupView } from "@features/setup/components/SetupView";
1718
import { MainSidebar } from "@features/sidebar/components/MainSidebar";
1819
import { useSidebarData } from "@features/sidebar/hooks/useSidebarData";
1920
import { useVisualTaskOrder } from "@features/sidebar/hooks/useVisualTaskOrder";
@@ -115,6 +116,8 @@ export function MainLayout() {
115116
{view.type === "command-center" && <CommandCenterView />}
116117

117118
{view.type === "skills" && <SkillsView />}
119+
120+
{view.type === "setup" && <SetupView />}
118121
</Box>
119122
</Flex>
120123

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import type { DiscoveredTask } from "@features/setup/types";
2+
import type { Icon } from "@phosphor-icons/react";
3+
import {
4+
ArrowRight,
5+
Bug,
6+
ChartLine,
7+
Copy,
8+
Flag,
9+
Funnel,
10+
Lightning,
11+
Lock,
12+
Trash,
13+
Warning,
14+
Wrench,
15+
} from "@phosphor-icons/react";
16+
import { Flex, Text } from "@radix-ui/themes";
17+
import { motion } from "framer-motion";
18+
19+
const CATEGORY_CONFIG: Record<
20+
DiscoveredTask["category"],
21+
{ icon: Icon; color: string }
22+
> = {
23+
bug: { icon: Bug, color: "red" },
24+
security: { icon: Lock, color: "red" },
25+
dead_code: { icon: Trash, color: "gray" },
26+
duplication: { icon: Copy, color: "orange" },
27+
performance: { icon: Lightning, color: "green" },
28+
stale_feature_flag: { icon: Flag, color: "amber" },
29+
error_tracking: { icon: Warning, color: "orange" },
30+
event_tracking: { icon: ChartLine, color: "blue" },
31+
funnel: { icon: Funnel, color: "violet" },
32+
};
33+
34+
interface SuggestedTasksProps {
35+
tasks: DiscoveredTask[];
36+
onSelectTask: (task: DiscoveredTask) => void;
37+
}
38+
39+
export function SuggestedTasks({ tasks, onSelectTask }: SuggestedTasksProps) {
40+
if (tasks.length === 0) {
41+
return (
42+
<Flex
43+
align="center"
44+
justify="center"
45+
py="4"
46+
style={{ color: "var(--gray-9)" }}
47+
>
48+
<Text size="2">No issues found. Your codebase looks clean!</Text>
49+
</Flex>
50+
);
51+
}
52+
53+
return (
54+
<Flex direction="column" gap="3" style={{ width: "100%" }}>
55+
{tasks.map((task, index) => {
56+
const config = CATEGORY_CONFIG[task.category] ?? {
57+
icon: Wrench,
58+
color: "gray",
59+
};
60+
const TaskIcon = config.icon;
61+
return (
62+
<motion.button
63+
key={task.id}
64+
initial={{ opacity: 0, y: 12 }}
65+
animate={{ opacity: 1, y: 0 }}
66+
transition={{ duration: 0.3, delay: index * 0.08 }}
67+
onClick={() => onSelectTask(task)}
68+
type="button"
69+
style={{
70+
display: "flex",
71+
alignItems: "flex-start",
72+
gap: 14,
73+
padding: "16px 18px",
74+
backgroundColor: "var(--color-panel-solid)",
75+
border: "1px solid var(--gray-a3)",
76+
borderRadius: 12,
77+
boxShadow:
78+
"0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02)",
79+
cursor: "pointer",
80+
textAlign: "left",
81+
width: "100%",
82+
transition: "border-color 0.15s ease, box-shadow 0.15s ease",
83+
}}
84+
whileHover={{
85+
borderColor: `var(--${config.color}-6)`,
86+
boxShadow:
87+
"0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04)",
88+
}}
89+
>
90+
<Flex
91+
align="center"
92+
justify="center"
93+
style={{
94+
width: 32,
95+
height: 32,
96+
borderRadius: 8,
97+
backgroundColor: `var(--${config.color}-3)`,
98+
flexShrink: 0,
99+
marginTop: 2,
100+
}}
101+
>
102+
<TaskIcon
103+
size={18}
104+
weight="duotone"
105+
color={`var(--${config.color}-9)`}
106+
/>
107+
</Flex>
108+
<Flex direction="column" gap="1" style={{ flex: 1, minWidth: 0 }}>
109+
<Flex align="center" justify="between" gap="2">
110+
<Text
111+
size="2"
112+
weight="medium"
113+
style={{ color: "var(--gray-12)" }}
114+
>
115+
{task.title}
116+
</Text>
117+
<ArrowRight
118+
size={14}
119+
color="var(--gray-8)"
120+
style={{ flexShrink: 0 }}
121+
/>
122+
</Flex>
123+
<Text
124+
size="1"
125+
style={{
126+
color: "var(--gray-11)",
127+
lineHeight: 1.5,
128+
}}
129+
>
130+
{task.description}
131+
</Text>
132+
{task.file && (
133+
<Text
134+
size="1"
135+
style={{
136+
color: "var(--gray-9)",
137+
fontStyle: "italic",
138+
marginTop: 2,
139+
}}
140+
>
141+
{task.file}
142+
{task.lineHint ? `:${task.lineHint}` : ""}
143+
</Text>
144+
)}
145+
</Flex>
146+
</motion.button>
147+
);
148+
})}
149+
</Flex>
150+
);
151+
}

apps/code/src/renderer/features/onboarding/stores/onboardingStore.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const log = logger.scope("onboarding-store");
88
interface OnboardingStoreState {
99
currentStep: OnboardingStep;
1010
hasCompletedOnboarding: boolean;
11+
hasCompletedSetup: boolean;
1112
isConnectingGithub: boolean;
1213
selectedProjectId: number | null;
1314
selectedDirectory: string;
@@ -16,6 +17,7 @@ interface OnboardingStoreState {
1617
interface OnboardingStoreActions {
1718
setCurrentStep: (step: OnboardingStep) => void;
1819
completeOnboarding: () => void;
20+
completeSetup: () => void;
1921
resetOnboarding: () => void;
2022
resetSelections: () => void;
2123
setConnectingGithub: (isConnecting: boolean) => void;
@@ -28,6 +30,7 @@ type OnboardingStore = OnboardingStoreState & OnboardingStoreActions;
2830
const initialState: OnboardingStoreState = {
2931
currentStep: "welcome",
3032
hasCompletedOnboarding: false,
33+
hasCompletedSetup: false,
3134
isConnectingGithub: false,
3235
selectedProjectId: null,
3336
selectedDirectory: "",
@@ -43,6 +46,7 @@ export const useOnboardingStore = create<OnboardingStore>()(
4346
log.info("completeOnboarding");
4447
set({ hasCompletedOnboarding: true });
4548
},
49+
completeSetup: () => set({ hasCompletedSetup: true }),
4650
resetOnboarding: () => set({ ...initialState }),
4751
resetSelections: () =>
4852
set({
@@ -59,6 +63,7 @@ export const useOnboardingStore = create<OnboardingStore>()(
5963
partialize: (state) => ({
6064
currentStep: state.currentStep,
6165
hasCompletedOnboarding: state.hasCompletedOnboarding,
66+
hasCompletedSetup: state.hasCompletedSetup,
6267
selectedProjectId: state.selectedProjectId,
6368
selectedDirectory: state.selectedDirectory,
6469
}),

0 commit comments

Comments
 (0)