From f5b65a888e65ea47b7439afede0ed9c72bec0a9a Mon Sep 17 00:00:00 2001 From: -Puter <22245429+puterhimself@users.noreply.github.com> Date: Mon, 3 Aug 2026 18:13:24 +0530 Subject: [PATCH] timelines --- apps/web/package.json | 3 +- .../components/projects/add-project-panel.tsx | 75 ++++- .../projects/github-connect-button.tsx | 2 +- .../projects/github-connection-settings.tsx | 2 +- .../src/components/projects/projects-grid.tsx | 2 +- .../components/projects/projects-header.tsx | 40 +-- .../components/projects/provider-chips.tsx | 2 +- .../projects/repository-selector.tsx | 9 - .../components/timeline/timeline-composer.tsx | 57 ++++ .../timeline/timeline-event-list.tsx | 48 ++++ apps/web/src/hooks/use-global-timeline.ts | 31 +++ apps/web/src/index.css | 259 ------------------ apps/web/src/routes.ts | 2 +- apps/web/src/routes/app/layout.tsx | 25 +- apps/web/src/routes/app/projects/page.tsx | 17 +- apps/web/src/routes/app/timeline/page.tsx | 54 ++++ 16 files changed, 287 insertions(+), 341 deletions(-) create mode 100644 apps/web/src/components/timeline/timeline-composer.tsx create mode 100644 apps/web/src/components/timeline/timeline-event-list.tsx create mode 100644 apps/web/src/hooks/use-global-timeline.ts create mode 100644 apps/web/src/routes/app/timeline/page.tsx diff --git a/apps/web/package.json b/apps/web/package.json index 9a0d145..1196287 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -25,8 +25,7 @@ "react": "catalog:", "react-dom": "catalog:", "react-router": "^8.1.0", - "sonner": "catalog:", - "streamdown": "catalog:" + "sonner": "catalog:" }, "devDependencies": { "@code/config": "workspace:*", diff --git a/apps/web/src/components/projects/add-project-panel.tsx b/apps/web/src/components/projects/add-project-panel.tsx index cd81656..feeafa5 100644 --- a/apps/web/src/components/projects/add-project-panel.tsx +++ b/apps/web/src/components/projects/add-project-panel.tsx @@ -1,6 +1,9 @@ +import { api } from "@code/backend/convex/_generated/api"; import type { Id } from "@code/backend/convex/_generated/dataModel"; -import { X } from "lucide-react"; -import { useEffect, useRef } from "react"; +import { Button } from "@code/ui/components/button"; +import { useAction } from "convex/react"; +import { Globe2, LoaderCircle, X } from "lucide-react"; +import { useEffect, useRef, useState } from "react"; import { createPortal } from "react-dom"; import { ProviderChips } from "./provider-chips"; @@ -19,6 +22,10 @@ export const AddProjectPanel = ({ readonly onProjectCreated: (projectId: string) => void; }) => { const dialogRef = useRef(null); + const importPublicGit = useAction(api.projects.importPublicGit); + const [repositoryUrl, setRepositoryUrl] = useState(""); + const [importing, setImporting] = useState(false); + const [importError, setImportError] = useState(); const githubConnectionId = accounts?.find( (account) => account.provider === "github" && account.status === "active" @@ -30,6 +37,29 @@ export const AddProjectPanel = ({ return () => dialog?.close(); }, []); + const importPublicRepository = async (event: React.FormEvent) => { + event.preventDefault(); + const url = repositoryUrl.trim(); + if (!url || importing) { + return; + } + setImporting(true); + setImportError(undefined); + try { + const project = await importPublicGit({ repositoryUrl: url }); + setRepositoryUrl(""); + onProjectCreated(String(project.id)); + } catch (caughtError) { + setImportError( + caughtError instanceof Error + ? caughtError.message + : "Public Git import failed" + ); + } finally { + setImporting(false); + } + }; + return createPortal(
+
+ +
+ setRepositoryUrl(event.target.value)} + placeholder="https://github.com/owner/repository" + type="url" + value={repositoryUrl} + /> + +
+ {importError ? ( +

+ {importError} +

+ ) : null} +
+ { setPending(true); try { await authClient.linkSocial({ - callbackURL: `${window.location.origin}/projects?resume=github`, + callbackURL: `${window.location.origin}/?resume=github`, provider: "github", }); } finally { diff --git a/apps/web/src/components/projects/github-connection-settings.tsx b/apps/web/src/components/projects/github-connection-settings.tsx index 680fe2f..5178f4d 100644 --- a/apps/web/src/components/projects/github-connection-settings.tsx +++ b/apps/web/src/components/projects/github-connection-settings.tsx @@ -67,7 +67,7 @@ export const GithubConnectionSettings = ({ setReauthorizing(true); try { await authClient.linkSocial({ - callbackURL: `${window.location.origin}/projects?resume=github`, + callbackURL: `${window.location.origin}/?resume=github`, provider: "github", // Pass the full desired scope set so GitHub grants everything. scopes: [...GITHUB_EXPANDED_SCOPES], diff --git a/apps/web/src/components/projects/projects-grid.tsx b/apps/web/src/components/projects/projects-grid.tsx index f6ef448..00393aa 100644 --- a/apps/web/src/components/projects/projects-grid.tsx +++ b/apps/web/src/components/projects/projects-grid.tsx @@ -29,7 +29,7 @@ export const ProjectsGrid = ({

- Choose a repository to continue its project conversation. + Open a project to manage its repository context.