mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-12 00:28:26 +00:00
fix: ui fixes
This commit is contained in:
parent
654de54ab9
commit
b708ecfb53
@ -41,7 +41,7 @@ export const LogOptions = ({ id }: LogOptionsProps) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (deleteFetcher.state === "idle" && deleteFetcher.data?.success) {
|
if (deleteFetcher.state === "idle" && deleteFetcher.data?.success) {
|
||||||
redirect(`/home/logs`);
|
redirect(`/home/inbox`);
|
||||||
}
|
}
|
||||||
}, [deleteFetcher.state, deleteFetcher.data]);
|
}, [deleteFetcher.state, deleteFetcher.data]);
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
Activity,
|
Activity,
|
||||||
Columns3,
|
Columns3,
|
||||||
|
Inbox,
|
||||||
LayoutGrid,
|
LayoutGrid,
|
||||||
MessageSquare,
|
MessageSquare,
|
||||||
Network,
|
Network,
|
||||||
@ -24,7 +25,12 @@ import { ConversationList } from "../conversation";
|
|||||||
const data = {
|
const data = {
|
||||||
navMain: [
|
navMain: [
|
||||||
{
|
{
|
||||||
title: "Conversation",
|
title: "Inbox",
|
||||||
|
url: "/home/inbox",
|
||||||
|
icon: Inbox,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Chat",
|
||||||
url: "/home/conversation",
|
url: "/home/conversation",
|
||||||
icon: MessageSquare,
|
icon: MessageSquare,
|
||||||
},
|
},
|
||||||
@ -38,11 +44,6 @@ const data = {
|
|||||||
url: "/home/space",
|
url: "/home/space",
|
||||||
icon: Columns3,
|
icon: Columns3,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "Activity",
|
|
||||||
url: "/home/logs",
|
|
||||||
icon: Activity,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "Integrations",
|
title: "Integrations",
|
||||||
url: "/home/integrations",
|
url: "/home/integrations",
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import { ContributionGraph } from "~/components/activity/contribution-graph";
|
|||||||
export default function LogsAll() {
|
export default function LogsAll() {
|
||||||
const [selectedSource, setSelectedSource] = useState<string | undefined>();
|
const [selectedSource, setSelectedSource] = useState<string | undefined>();
|
||||||
const [selectedStatus, setSelectedStatus] = useState<string | undefined>();
|
const [selectedStatus, setSelectedStatus] = useState<string | undefined>();
|
||||||
const contributionFetcher = useFetcher<any>();
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
logs,
|
logs,
|
||||||
@ -26,35 +25,10 @@ export default function LogsAll() {
|
|||||||
status: selectedStatus,
|
status: selectedStatus,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fetch contribution data on mount
|
|
||||||
useEffect(() => {
|
|
||||||
if (contributionFetcher.state === "idle" && !contributionFetcher.data) {
|
|
||||||
contributionFetcher.load("/api/v1/activity/contribution");
|
|
||||||
}
|
|
||||||
}, [contributionFetcher]);
|
|
||||||
|
|
||||||
// Get contribution data from fetcher
|
|
||||||
const contributionData = contributionFetcher.data?.success
|
|
||||||
? contributionFetcher.data.data.contributionData
|
|
||||||
: [];
|
|
||||||
const totalActivities = contributionFetcher.data?.success
|
|
||||||
? contributionFetcher.data.data.totalActivities
|
|
||||||
: 0;
|
|
||||||
const isContributionLoading =
|
|
||||||
contributionFetcher.state === "loading" || !contributionFetcher.data;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageHeader title="Logs" />
|
<PageHeader title="Inbox" />
|
||||||
<div className="flex h-[calc(100vh_-_56px)] w-full flex-col items-center space-y-6 py-4">
|
<div className="flex h-[calc(100vh_-_56px)] w-full flex-col items-center space-y-6 py-4">
|
||||||
{/* Contribution Graph */}
|
|
||||||
<div className="mb-0 w-full max-w-5xl px-4">
|
|
||||||
{isContributionLoading ? (
|
|
||||||
<LoaderCircle className="text-primary h-4 w-4 animate-spin" />
|
|
||||||
) : (
|
|
||||||
<ContributionGraph data={contributionData} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{isInitialLoad ? (
|
{isInitialLoad ? (
|
||||||
<>
|
<>
|
||||||
<LoaderCircle className="text-primary h-4 w-4 animate-spin" />
|
<LoaderCircle className="text-primary h-4 w-4 animate-spin" />
|
||||||
@ -24,7 +24,7 @@ import { parse } from "@conform-to/zod";
|
|||||||
import { type RawTriplet } from "~/components/graph/type";
|
import { type RawTriplet } from "~/components/graph/type";
|
||||||
import { addToQueue } from "~/lib/ingest.server";
|
import { addToQueue } from "~/lib/ingest.server";
|
||||||
import { EpisodeType } from "@core/types";
|
import { EpisodeType } from "@core/types";
|
||||||
import { activityPath } from "~/utils/pathBuilder";
|
import { inboxPath } from "~/utils/pathBuilder";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
answers: z.string(),
|
answers: z.string(),
|
||||||
@ -34,7 +34,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
|||||||
const user = await requireUser(request);
|
const user = await requireUser(request);
|
||||||
|
|
||||||
if (user.onboardingComplete) {
|
if (user.onboardingComplete) {
|
||||||
return redirect(activityPath());
|
return redirect(inboxPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
return json({ user });
|
return json({ user });
|
||||||
@ -76,7 +76,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
|||||||
userId,
|
userId,
|
||||||
);
|
);
|
||||||
|
|
||||||
return redirect("/home/logs");
|
return redirect("/home/inbox");
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
return json({ errors: { body: e.message } }, { status: 400 });
|
return json({ errors: { body: e.message } }, { status: 400 });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,3 +43,44 @@ export async function getEpisodeFacts(episodeUuid: string, userId: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getDocumentFacts(documentId: string, userId: string) {
|
||||||
|
try {
|
||||||
|
const facts = await getEpisodeStatements({
|
||||||
|
episodeUuid,
|
||||||
|
userId,
|
||||||
|
});
|
||||||
|
|
||||||
|
const invalidFacts = await getStatementsInvalidatedByEpisode({
|
||||||
|
episodeUuid,
|
||||||
|
userId,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
facts: facts.map((fact) => ({
|
||||||
|
uuid: fact.uuid,
|
||||||
|
fact: fact.fact,
|
||||||
|
createdAt: fact.createdAt.toISOString(),
|
||||||
|
validAt: fact.validAt.toISOString(),
|
||||||
|
invalidAt: fact.invalidAt ? fact.invalidAt.toISOString() : null,
|
||||||
|
attributes: fact.attributes,
|
||||||
|
})),
|
||||||
|
invalidFacts: invalidFacts.map((fact) => ({
|
||||||
|
uuid: fact.uuid,
|
||||||
|
fact: fact.fact,
|
||||||
|
createdAt: fact.createdAt.toISOString(),
|
||||||
|
validAt: fact.validAt.toISOString(),
|
||||||
|
invalidAt: fact.invalidAt ? fact.invalidAt.toISOString() : null,
|
||||||
|
attributes: fact.attributes,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error fetching episode facts:", error);
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
error: "Failed to fetch episode facts",
|
||||||
|
facts: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -297,6 +297,8 @@ export class KnowledgeGraphService {
|
|||||||
previousEpisodes,
|
previousEpisodes,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(extractedNodes.map((node) => node.name));
|
||||||
|
|
||||||
const extractedTime = Date.now();
|
const extractedTime = Date.now();
|
||||||
logger.log(`Extracted entities in ${extractedTime - normalizedTime} ms`);
|
logger.log(`Extracted entities in ${extractedTime - normalizedTime} ms`);
|
||||||
|
|
||||||
@ -440,6 +442,7 @@ export class KnowledgeGraphService {
|
|||||||
let entities: EntityNode[] = [];
|
let entities: EntityNode[] = [];
|
||||||
|
|
||||||
const outputMatch = responseText.match(/<output>([\s\S]*?)<\/output>/);
|
const outputMatch = responseText.match(/<output>([\s\S]*?)<\/output>/);
|
||||||
|
|
||||||
if (outputMatch && outputMatch[1]) {
|
if (outputMatch && outputMatch[1]) {
|
||||||
responseText = outputMatch[1].trim();
|
responseText = outputMatch[1].trim();
|
||||||
const extractedEntities = JSON.parse(responseText || "{}").entities || [];
|
const extractedEntities = JSON.parse(responseText || "{}").entities || [];
|
||||||
|
|||||||
@ -113,7 +113,6 @@ You are given a conversation context and a CURRENT EPISODE. Your task is to extr
|
|||||||
- Text: "authentication system" → ❌ Extract: "authentication system" (should be "Authentication", "System")
|
- Text: "authentication system" → ❌ Extract: "authentication system" (should be "Authentication", "System")
|
||||||
- Text: "payment service" → ❌ Extract: "payment service" (should be "Payment", "Service")
|
- Text: "payment service" → ❌ Extract: "payment service" (should be "Payment", "Service")
|
||||||
|
|
||||||
Format your response as a JSON object with the following structure:
|
|
||||||
<output>
|
<output>
|
||||||
{
|
{
|
||||||
"entities": [
|
"entities": [
|
||||||
|
|||||||
@ -14,8 +14,8 @@ export function dashboardPath() {
|
|||||||
return `/home/dashboard`;
|
return `/home/dashboard`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function activityPath() {
|
export function inboxPath() {
|
||||||
return `/home/logs`;
|
return `/home/inbox`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function conversationPath() {
|
export function conversationPath() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user