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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/datasets/page.tsx → app/(routes)/datasets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useState, useEffect } from "react";

import { useAuth } from "@/app/lib/context/AuthContext";
import { useApp } from "@/app/lib/context/AppContext";
import type { APIKey } from "@/app/keystore/page";
import { APIKey } from "@/app/lib/types/credentials";
import Sidebar from "@/app/components/Sidebar";
import { useToast } from "@/app/components/Toast";

Expand Down
2 changes: 1 addition & 1 deletion app/document/page.tsx → app/(routes)/document/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useState, useEffect } from "react";
import { useAuth } from "@/app/lib/context/AuthContext";
import { useApp } from "@/app/lib/context/AppContext";
import type { APIKey } from "@/app/keystore/page";
import { APIKey } from "@/app/lib/types/credentials";
import Sidebar from "@/app/components/Sidebar";
import { useToast } from "@/app/components/Toast";
import { formatDate } from "@/app/components/utils";
Expand Down Expand Up @@ -940,7 +940,7 @@
</p>
</div>
) : (
<img

Check warning on line 943 in app/(routes)/document/page.tsx

View workflow job for this annotation

GitHub Actions / lint-and-build

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
src={document.signed_url}
alt={document.fname}
className="max-w-full h-auto rounded"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { useState, useEffect, useCallback, Suspense } from "react";
import { colors } from "@/app/lib/colors";
import { useSearchParams } from "next/navigation";
import { Dataset } from "@/app/datasets/page";
import { Dataset } from "@/app/(routes)/datasets/page";
import Sidebar from "@/app/components/Sidebar";
import TabNavigation from "@/app/components/TabNavigation";
import { useToast } from "@/app/components/Toast";
Expand Down Expand Up @@ -38,6 +38,11 @@ function SimplifiedEvalContent() {
const { sidebarCollapsed, setSidebarCollapsed } = useApp();
const { apiKeys } = useAuth();
const [selectedKeyId, setSelectedKeyId] = useState<string>("");
const [mounted, setMounted] = useState(false);

useEffect(() => {
setMounted(true);
}, []);

// Dataset creation state
const [datasetName, setDatasetName] = useState("");
Expand Down Expand Up @@ -355,7 +360,7 @@ function SimplifiedEvalContent() {
/>

{/* Tab Content */}
{apiKeys.length === 0 ? (
{!mounted || apiKeys.length === 0 ? (
<div
className="flex-1 flex items-center justify-center"
style={{ backgroundColor: colors.bg.secondary }}
Expand Down
11 changes: 2 additions & 9 deletions app/keystore/page.tsx → app/(routes)/keystore/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@
"use client";

import { useState, useEffect } from "react";
import Sidebar from "../components/Sidebar";
import Sidebar from "@/app/components/Sidebar";
import { useAuth } from "@/app/lib/context/AuthContext";
import { useApp } from "@/app/lib/context/AppContext";

export interface APIKey {
id: string;
label: string;
key: string;
provider: string;
createdAt?: string;
}
import { APIKey } from "@/app/lib/types/credentials";

export const STORAGE_KEY = "kaapi_api_keys";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useToast } from "@/app/components/Toast";
import { useAuth } from "@/app/lib/context/AuthContext";
import { useApp } from "@/app/lib/context/AppContext";
import { apiFetch } from "@/app/lib/apiClient";
import type { APIKey } from "@/app/keystore/page";
import { APIKey } from "@/app/lib/types/credentials";
import WaveformVisualizer from "@/app/components/speech-to-text/WaveformVisualizer";
import { computeWordDiff } from "@/app/components/speech-to-text/TranscriptionDiffViewer";
import ErrorModal from "@/app/components/ErrorModal";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useToast } from "@/app/components/Toast";
import { useAuth } from "@/app/lib/context/AuthContext";
import { useApp } from "@/app/lib/context/AppContext";
import { apiFetch } from "@/app/lib/apiClient";
import type { APIKey } from "@/app/keystore/page";
import { APIKey } from "@/app/lib/types/credentials";
import ErrorModal from "@/app/components/ErrorModal";

type Tab = "datasets" | "evaluations";
Expand Down
2 changes: 0 additions & 2 deletions app/components/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* Matches the design system with smooth animations
*/

import React from "react";

interface LoaderProps {
size?: "sm" | "md" | "lg";
message?: string;
Expand Down
4 changes: 2 additions & 2 deletions app/components/evaluations/DatasetsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { useState, useEffect, useRef } from "react";
import { colors } from "@/app/lib/colors";
import { APIKey } from "@/app/keystore/page";
import { Dataset } from "@/app/datasets/page";
import { APIKey } from "@/app/lib/types/credentials";
import { Dataset } from "@/app/(routes)/datasets/page";
import { useToast } from "@/app/components/Toast";
import EvalDatasetDescription from "./EvalDatasetDescription";

Expand Down
4 changes: 2 additions & 2 deletions app/components/evaluations/EvaluationsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { useState, useEffect, useCallback } from "react";
import { colors } from "@/app/lib/colors";
import { APIKey } from "@/app/keystore/page";
import { Dataset } from "@/app/datasets/page";
import { Dataset } from "@/app/(routes)/datasets/page";
import { EvalJob, AssistantConfig } from "@/app/components/types";
import ConfigSelector from "@/app/components/ConfigSelector";
import Loader from "@/app/components/Loader";
import EvalRunCard from "./EvalRunCard";
import EvalDatasetDescription from "./EvalDatasetDescription";
import { APIKey } from "@/app/lib/types/credentials";

type Tab = "datasets" | "evaluations";

Expand Down
2 changes: 1 addition & 1 deletion app/components/prompt-editor/ABTestTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Commit,
LegacyVariant,
TestResult,
} from "@/app/configurations/prompt-editor/types";
} from "@/app/(routes)/configurations/prompt-editor/types";

interface ABTestTabProps {
variants: LegacyVariant[];
Expand Down
2 changes: 1 addition & 1 deletion app/components/prompt-editor/BranchModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { colors } from "@/app/lib/colors";
import { UnifiedCommit } from "@/app/configurations/prompt-editor/types";
import { UnifiedCommit } from "@/app/(routes)/configurations/prompt-editor/types";

interface BranchModalProps {
isOpen: boolean;
Expand Down
4 changes: 2 additions & 2 deletions app/components/prompt-editor/CommitNode.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { colors } from "@/app/lib/colors";
import { UnifiedCommit } from "@/app/configurations/prompt-editor/types";
import { UnifiedCommit } from "@/app/(routes)/configurations/prompt-editor/types";
import {
getUnifiedBranchColor,
formatTime,
} from "@/app/configurations/prompt-editor/utils";
} from "@/app/(routes)/configurations/prompt-editor/utils";

interface CommitNodeProps {
commit: UnifiedCommit;
Expand Down
2 changes: 1 addition & 1 deletion app/components/prompt-editor/ConfigDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Commit,
LegacyVariant,
TestResult,
} from "@/app/configurations/prompt-editor/types";
} from "@/app/(routes)/configurations/prompt-editor/types";
import CurrentConfigTab from "./CurrentConfigTab";
import HistoryTab from "./HistoryTab";
import ABTestTab from "./ABTestTab";
Expand Down
5 changes: 4 additions & 1 deletion app/components/prompt-editor/ConfigEditorPane.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useState } from "react";
import { colors } from "@/app/lib/colors";
import { ConfigBlob, Tool } from "@/app/configurations/prompt-editor/types";
import {
ConfigBlob,
Tool,
} from "@/app/(routes)/configurations/prompt-editor/types";
import { SavedConfig, ConfigVersionItems } from "@/app/lib/types/configs";
import { ConfigPublic } from "@/app/lib/configTypes";
import { formatRelativeTime } from "@/app/lib/utils";
Expand Down
5 changes: 4 additions & 1 deletion app/components/prompt-editor/CurrentConfigTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useState } from "react";
import { colors } from "@/app/lib/colors";
import { Config, Tool } from "@/app/configurations/prompt-editor/types";
import {
Config,
Tool,
} from "@/app/(routes)/configurations/prompt-editor/types";

interface CurrentConfigTabProps {
configs: Config[];
Expand Down
4 changes: 2 additions & 2 deletions app/components/prompt-editor/EditorView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { colors } from "@/app/lib/colors";
import { Commit } from "@/app/configurations/prompt-editor/types";
import { getBranchColor } from "@/app/configurations/prompt-editor/utils";
import { Commit } from "@/app/(routes)/configurations/prompt-editor/types";
import { getBranchColor } from "@/app/(routes)/configurations/prompt-editor/utils";

interface EditorViewProps {
currentBranch: string;
Expand Down
2 changes: 1 addition & 1 deletion app/components/prompt-editor/HistoryTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { colors } from "@/app/lib/colors";
import { Config } from "@/app/configurations/prompt-editor/types";
import { Config } from "@/app/(routes)/configurations/prompt-editor/types";

interface HistoryTabProps {
configs: Config[];
Expand Down
4 changes: 2 additions & 2 deletions app/components/prompt-editor/MergeModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { colors } from "@/app/lib/colors";
import { UnifiedCommit } from "@/app/configurations/prompt-editor/types";
import { UnifiedCommit } from "@/app/(routes)/configurations/prompt-editor/types";
import {
getAllUnifiedBranches,
getUnifiedBranchColor,
} from "@/app/configurations/prompt-editor/utils";
} from "@/app/(routes)/configurations/prompt-editor/utils";

interface MergeModalProps {
isOpen: boolean;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/context/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";

import { APIKey } from "@/app/keystore/page";
import {
createContext,
useContext,
useState,
useCallback,
useEffect,
} from "react";
import { APIKey } from "@/app/lib/types/credentials";

const STORAGE_KEY = "kaapi_api_keys";

Expand Down
8 changes: 8 additions & 0 deletions app/lib/types/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ export const PROVIDERS: ProviderDef[] = [
],
},
];

export interface APIKey {
id: string;
label: string;
key: string;
provider: string;
createdAt?: string;
}
Loading