Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion web/src/app/api/integrations/calendar/events/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { fetchCalendarEvents } from "@/lib/integrations/calendar";

export async function GET() {
try {
// In a real app, we would get the user ID from the session
const events = await fetchCalendarEvents();
return NextResponse.json(events);
} catch (error) {
Expand Down
19 changes: 11 additions & 8 deletions web/src/components/Onboarding.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState } from "react";
import { useState, useEffect } from "react";
import { motion, AnimatePresence } from "framer-motion";
import { Card, CardContent, CardHeader, CardTitle, CardFooter } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
Expand All @@ -17,6 +17,8 @@ interface Step {
icon: React.ReactNode;
}

const ONBOARDING_SEEN_KEY = "devcontext:onboarding-seen";

const steps: Step[] = [
{
title: "Welcome to DevContext!",
Expand All @@ -41,14 +43,15 @@ const steps: Step[] = [
];

export function Onboarding() {
const [isOpen, setIsOpen] = useState(() => {
if (typeof window !== 'undefined') {
return !localStorage.getItem("devcontext:onboarding-seen");
}
return false;
});
const [isOpen, setIsOpen] = useState(false);
const [currentStep, setCurrentStep] = useState(0);

useEffect(() => {
if (!localStorage.getItem(ONBOARDING_SEEN_KEY)) {
setIsOpen(true);
}
}, []);

const handleNext = () => {
if (currentStep < steps.length - 1) {
setCurrentStep(currentStep + 1);
Expand All @@ -58,7 +61,7 @@ export function Onboarding() {
};

const handleComplete = () => {
localStorage.setItem("devcontext:onboarding-seen", "true");
localStorage.setItem(ONBOARDING_SEEN_KEY, "true");
setIsOpen(false);
};

Expand Down
1 change: 0 additions & 1 deletion web/src/lib/analytics/dna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export async function calculateCodeDNA(user: string): Promise<CodeDNA> {
const ts = a.timestamp.getTime();
if (ts - lastTimestamp > 30 * 60 * 1000) {
if (currentSessionFiles.size > 0) filesPerSession.push(currentSessionFiles.size);
sessions++;
currentSessionFiles = new Set();
}
currentSessionFiles.add(a.target);
Expand Down
Loading