From 56adc246c80a1f814b7a9f22d1cecbc83a11deab Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi Date: Tue, 10 Jun 2025 12:26:04 +0530 Subject: [PATCH] Feat: UI changes --- .eslintignore | 4 +- apps/webapp/.eslintignore | 1 + apps/webapp/.eslintrc | 15 ++- apps/webapp/app/components/dashboard/index.ts | 1 + .../app/components/dashboard/ingest.tsx | 47 +++++++ .../app/components/graph/graph-popover.tsx | 27 +--- .../components/graph/graph-visualization.tsx | 17 ++- apps/webapp/app/components/graph/graph.tsx | 2 +- .../app/components/graph/node-colors.ts | 52 ++++---- apps/webapp/app/components/graph/utils.ts | 107 ++++++++++++++++ .../app/components/layout/LoginPageLayout.tsx | 15 +-- .../app/components/sidebar/app-sidebar.tsx | 4 +- .../app/components/sidebar/nav-main.tsx | 9 +- apps/webapp/app/components/ui/resizable.tsx | 47 +++++++ apps/webapp/app/components/ui/tabs.tsx | 53 ++++++++ apps/webapp/app/components/ui/textarea.tsx | 36 ++++++ .../app/hooks/use-autosize-textarea.tsx | 23 ++++ apps/webapp/app/hooks/use-local-state.tsx | 26 ++++ apps/webapp/app/hooks/useWorkspace.ts | 5 +- apps/webapp/app/lib/ingest.queue.ts | 45 ------- apps/webapp/app/lib/ingest.server.ts | 116 ++++++++++++++++++ apps/webapp/app/lib/model.server.ts | 2 +- apps/webapp/app/lib/neo4j.server.ts | 91 +++++++++++++- apps/webapp/app/root.tsx | 5 +- apps/webapp/app/routes/_index.tsx | 47 ++----- apps/webapp/app/routes/auth.google.tsx | 1 - .../app/routes/confirm-basic-details.tsx | 4 - apps/webapp/app/routes/home.dashboard.tsx | 95 ++++++++++++++ apps/webapp/app/routes/home.tsx | 58 +++++++++ apps/webapp/app/routes/ingest.tsx | 48 +------- apps/webapp/app/routes/search.tsx | 5 +- .../app/services/apiRateLimit.server.ts | 15 ++- apps/webapp/app/services/googleAuth.server.ts | 2 - .../app/services/graphModels/episode.ts | 5 - .../app/services/graphModels/statement.ts | 1 - .../app/services/knowledgeGraph.server.ts | 3 +- apps/webapp/app/services/search.server.ts | 2 +- apps/webapp/app/services/search/rerank.ts | 2 +- apps/webapp/app/services/search/utils.ts | 10 +- apps/webapp/app/utils/pathBuilder.ts | 8 ++ .../app/utils/presets/{apps.ts => nodes.ts} | 4 + apps/webapp/package.json | 2 +- apps/webapp/vite.config.ts | 2 +- packages/types/src/graph/graph.entity.ts | 1 - pnpm-lock.yaml | 14 +++ turbo.json | 17 +-- 46 files changed, 840 insertions(+), 256 deletions(-) create mode 100644 apps/webapp/.eslintignore create mode 100644 apps/webapp/app/components/dashboard/index.ts create mode 100644 apps/webapp/app/components/dashboard/ingest.tsx create mode 100644 apps/webapp/app/components/graph/utils.ts create mode 100644 apps/webapp/app/components/ui/resizable.tsx create mode 100644 apps/webapp/app/components/ui/tabs.tsx create mode 100644 apps/webapp/app/components/ui/textarea.tsx create mode 100644 apps/webapp/app/hooks/use-autosize-textarea.tsx create mode 100644 apps/webapp/app/hooks/use-local-state.tsx delete mode 100644 apps/webapp/app/lib/ingest.queue.ts create mode 100644 apps/webapp/app/lib/ingest.server.ts create mode 100644 apps/webapp/app/routes/home.dashboard.tsx create mode 100644 apps/webapp/app/routes/home.tsx rename apps/webapp/app/utils/presets/{apps.ts => nodes.ts} (96%) diff --git a/.eslintignore b/.eslintignore index 827344f..bd515ce 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,6 @@ */**.js */**.d.ts packages/*/dist -packages/*/lib \ No newline at end of file +packages/*/lib + +build/ \ No newline at end of file diff --git a/apps/webapp/.eslintignore b/apps/webapp/.eslintignore new file mode 100644 index 0000000..d298be1 --- /dev/null +++ b/apps/webapp/.eslintignore @@ -0,0 +1 @@ +public/ \ No newline at end of file diff --git a/apps/webapp/.eslintrc b/apps/webapp/.eslintrc index 9f1bc38..9a70110 100644 --- a/apps/webapp/.eslintrc +++ b/apps/webapp/.eslintrc @@ -5,7 +5,6 @@ { "files": ["*.ts", "*.tsx"], "rules": { - "@typescript-eslint/consistent-type-imports": [ "warn", { @@ -13,15 +12,15 @@ // during some autofixes, so easier to just turn it off "prefer": "type-imports", "disallowTypeAnnotations": true, - "fixStyle": "inline-type-imports" - } + "fixStyle": "inline-type-imports", + }, ], - + "import/no-duplicates": ["warn", { "prefer-inline": true }], // lots of undeclared vars, enable this rule if you want to clean them up - "turbo/no-undeclared-env-vars": "off" - } - } + "turbo/no-undeclared-env-vars": "off", + }, + }, ], - "ignorePatterns": [] + "ignorePatterns": ["public/"], } diff --git a/apps/webapp/app/components/dashboard/index.ts b/apps/webapp/app/components/dashboard/index.ts new file mode 100644 index 0000000..6e99c11 --- /dev/null +++ b/apps/webapp/app/components/dashboard/index.ts @@ -0,0 +1 @@ +export * from "./ingest"; diff --git a/apps/webapp/app/components/dashboard/ingest.tsx b/apps/webapp/app/components/dashboard/ingest.tsx new file mode 100644 index 0000000..d2ece62 --- /dev/null +++ b/apps/webapp/app/components/dashboard/ingest.tsx @@ -0,0 +1,47 @@ +import { PlusIcon } from "lucide-react"; +import { Button } from "../ui"; +import { Textarea } from "../ui/textarea"; +import { useState } from "react"; +import { z } from "zod"; +import { EpisodeType } from "@core/types"; + +export const IngestBodyRequest = z.object({ + episodeBody: z.string(), + referenceTime: z.string(), + type: z.enum([EpisodeType.Conversation, EpisodeType.Text]), // Assuming these are the EpisodeType values + source: z.string(), + spaceId: z.string().optional(), + sessionId: z.string().optional(), +}); + +export const Ingest = () => { + const [text, setText] = useState(""); + + return ( +
+
+ + + + +