Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit mapping in labels + frontend improvements #137

Merged
merged 6 commits into from
Nov 2, 2024
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
6 changes: 3 additions & 3 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
--primary-foreground: 16 0% 91%;

--secondary: 240 4% 16%;
--secondary-foreground: 0 4% 70%;
--secondary-foreground: 215 16% 65%;

--muted: 240 6% 16%;
--muted-foreground: 215 20.2% 65.1%;
--muted-foreground: 215 16% 65%;

--accent: 232 9% 17%;
--accent-foreground: 210 100% 100%;

--destructive: 0 62.8% 30.6%;
--destructive: 0 60% 50%;
--destructive-foreground: 210 40% 98%;

--border: 240 6% 18%;
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/dataset/dataset-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useProjectContext } from '@/contexts/project-context';
import { ChevronsRight, Loader, Loader2 } from 'lucide-react';
import { ChevronsRight, Loader2 } from 'lucide-react';
import { Skeleton } from '../ui/skeleton';
import { Label } from '../ui/label';
import { ScrollArea } from '../ui/scroll-area';
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dataset/dataset-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { uploadFile } from '@/lib/dataset/utils';
import { useToast } from '@/lib/hooks/use-toast';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';

interface DatasetUploadProps {
datasetId: string;
Expand All @@ -31,7 +31,7 @@ export default function DatasetUpload({
className="mt-4 w-32"
onClick={() => hiddenInput.current?.click()}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Select file
</Button>
<input
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dataset/delete-datapoints-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { Button } from '../ui/button';
import { Label } from '../ui/label';
import { useState } from 'react';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';

export interface DeleteDatapointsDialogProps {
selectedDatapointIds: string[];
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function DeleteDatapointsDialog({
setOpen(false);
}}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Delete
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dataset/index-dataset-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
DialogTitle,
DialogTrigger
} from '@/components/ui/dialog';
import { Loader, NotepadText } from 'lucide-react';
import { Loader2, NotepadText } from 'lucide-react';
import { useProjectContext } from '@/contexts/project-context';
import { Label } from '@/components/ui/label';
import { Input } from '../ui/input';
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function IndexDatasetDialog({
onClick={async () => await indexDataset()}
handleEnter
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Index
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dataset/manual-add-datapoint-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
DialogTrigger
} from '../ui/dialog';
import { Button } from '../ui/button';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';
import CodeEditor from '../ui/code-editor';

const DEFAULT_DATA = '{\n "data": {},\n "target": {}\n}';
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function ManualAddDatapointDialog({
disabled={isLoading}
onClick={async () => await addDatapoint()}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Add datapoint
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/dataset/unstructured-file-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { uploadFile } from '@/lib/dataset/utils';
import { useToast } from '@/lib/hooks/use-toast';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';

interface UnstructuredFileUploadProps {
datasetId: string;
Expand Down Expand Up @@ -37,7 +37,7 @@ export default function UnstructuredFileUpload({
className="mt-4 w-32"
onClick={() => hiddenInput.current?.click()}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Select file
</Button>
<input
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/datasets/create-dataset-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Loader, Plus } from 'lucide-react';
import { Loader2, Plus } from 'lucide-react';
import { cn, fetcher } from '@/lib/utils';
import { useState } from 'react';
import { useProjectContext } from '@/contexts/project-context';
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function CreateDatasetDialog({}: CreateDatasetDialogProps) {
disabled={!newDatasetName || isLoading}
handleEnter
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/datasets/datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { swrFetcher } from '@/lib/utils';

import { useProjectContext } from '@/contexts/project-context';
import { useRouter } from 'next/navigation';
import { Loader, Loader2, MoreVertical, Trash2 } from 'lucide-react';
import { Loader2, MoreVertical, Trash2 } from 'lucide-react';
import { cn } from '@/lib/utils';
import { ColumnDef } from '@tanstack/react-table';
import { Dataset } from '@/lib/dataset/types';
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/datasets/update-dataset-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Loader, Pencil } from 'lucide-react';
import { Loader2, Pencil } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useState } from 'react';
import { DropdownMenuItem } from '../ui/dropdown-menu';
Expand Down Expand Up @@ -75,7 +75,7 @@ export default function UpdateDatasetDialog({
}}
disabled={!dataset || isLoading}
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/evaluations/create-evaluation-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Info, Loader, Plus } from 'lucide-react';
import { Info, Loader2, Plus } from 'lucide-react';
import { cn, getLocalDevSessions, getLocalEnvVars } from '@/lib/utils';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function CreateEvaluationDialog() {
onClick={createNewEvaluation}
disabled={!isEvaluationComplete() || isLoading}
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/evaluator/evaluator-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function EvaluatorEditor({
<div className="flex flex-col space-y-2">
<Label className="text-secondary-foreground">Expected output</Label>
<div className="flex space-x-1">
{labelClass.valueMap.map((value, index) => (
{Object.keys(labelClass.valueMap).map((value, index) => (
<div
key={index}
className="border rounded-md p-0.5 px-2 text-sm"
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/event/edit-event-template-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
Expand Down Expand Up @@ -105,7 +105,7 @@ export default function EditEventTemplateDialog({
</div>
<DialogFooter>
<Button onClick={updateEvent} disabled={isLoading || !isReady()}>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/events/create-event-template-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Loader } from 'lucide-react';
import { Loader2 } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
Expand Down Expand Up @@ -97,7 +97,7 @@ export default function CreateEventTemplateDialog() {
</div>
<DialogFooter>
<Button onClick={createNewEvent} disabled={isLoading || !isReady()}>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/commit-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '../ui/label';
import { Input } from '../ui/input';
import { Loader, PlusCircle } from 'lucide-react';
import { Loader2, PlusCircle } from 'lucide-react';
import { PipelineVersionInfo } from '@/lib/pipeline/types';
import { useProjectContext } from '@/contexts/project-context';
import useStore from '@/lib/flow/store';
Expand Down Expand Up @@ -120,7 +120,7 @@ export default function CommitButton({
handleEnter={true}
onClick={commitPipelineVersion}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Commit
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/delete-version-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useState } from 'react';
import { ProjectContext } from '@/contexts/project-context';
import { Loader, MoreVertical, Trash2 } from 'lucide-react';
import { Loader2, MoreVertical, Trash2 } from 'lucide-react';
import { Button } from '@/components/ui/button';
import {
Dialog,
Expand Down Expand Up @@ -100,7 +100,7 @@ export default function DeletePipelineVersionButton({
disabled={deleteVersionInputText != selectedPipelineVersion.name}
onClick={deletePipelineVersion}
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isDeleting ? 'animate-spin block' : ''
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/deploy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '../ui/label';
import { Input } from '../ui/input';
import { Loader, Rocket } from 'lucide-react';
import { Loader2, Rocket } from 'lucide-react';
import { PipelineVersionInfo } from '@/lib/pipeline/types';
import { useProjectContext } from '@/contexts/project-context';
import EndpointSelect from '../ui/endpoint-select';
Expand Down Expand Up @@ -178,7 +178,7 @@ export default function DeployButton({
}
onClick={deployPipelineVersion}
>
{isDeploying && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isDeploying && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Deploy
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/fork-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@/components/ui/dialog';
import { Label } from '../ui/label';
import { Input } from '../ui/input';
import { Loader, GitFork } from 'lucide-react';
import { Loader2, GitFork } from 'lucide-react';
import { PipelineVersionInfo } from '@/lib/pipeline/types';
import { useRouter } from 'next/navigation';
import { useProjectContext } from '@/contexts/project-context';
Expand Down Expand Up @@ -109,7 +109,7 @@ export default function ForkButton({
handleEnter={true}
onClick={forkPipelineVersion}
>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Fork
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/overwrite-workshop-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DialogTrigger
} from '@/components/ui/dialog';
import { Label } from '../ui/label';
import { Loader, Pencil, ShieldQuestion } from 'lucide-react';
import { Loader2, Pencil, ShieldQuestion } from 'lucide-react';
import { PipelineVersionInfo } from '@/lib/pipeline/types';
import { useProjectContext } from '@/contexts/project-context';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function OverwriteWorkshopButton({
Cancel
</Button>
<Button handleEnter={true} onClick={overwriteWorkshopVersion}>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Overwrite
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/stream-trace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Clock3,
Coins,
FastForward,
Loader,
Loader2,
Play
} from 'lucide-react';
import { StreamMessage } from './pipeline-outputs';
Expand Down Expand Up @@ -334,7 +334,7 @@ function StreamTraceCard({
</div>
{showSpinner && (
<div>
<Loader
<Loader2
className="text-secondary-foreground animate-spin"
size={12}
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipeline/target-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DialogTrigger
} from '@/components/ui/dialog';
import { Label } from '../ui/label';
import { Loader, Pencil, ShieldQuestion } from 'lucide-react';
import { Loader2, Pencil, ShieldQuestion } from 'lucide-react';
import { PipelineVersionInfo } from '@/lib/pipeline/types';
import { useProjectContext } from '@/contexts/project-context';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function SetTargetVersionButton({
Cancel
</Button>
<Button handleEnter={true} onClick={overwriteWorkshopVersion}>
{isLoading && <Loader className="animate-spin h-4 w-4 mr-2" />}
{isLoading && <Loader2 className="animate-spin h-4 w-4 mr-2" />}
Confirm
</Button>
</DialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipelines/create-pipeline-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Input } from '@/components/ui/input';
import { useEffect, useState } from 'react';
import { useProjectContext } from '@/contexts/project-context';
import { useRouter } from 'next/navigation';
import { Loader, Plus } from 'lucide-react';
import { Loader2, Plus } from 'lucide-react';
import { cn } from '@/lib/utils';
import { TemplateInfo } from '@/lib/pipeline/types';
import { Skeleton } from '../ui/skeleton';
Expand Down Expand Up @@ -141,7 +141,7 @@ export function CreatePipelineDialog({ onUpdate }: CreatePipelineDialogProps) {
handleEnter={true}
disabled={selectedTemplateId === undefined || isLoading}
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/pipelines/update-pipeline-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { useState } from 'react';
import { useProjectContext } from '@/contexts/project-context';
import { Loader, Pencil, Plus } from 'lucide-react';
import { Loader2, Pencil, Plus } from 'lucide-react';
import { cn } from '@/lib/utils';
import { Pipeline } from '@/lib/pipeline/types';
import { DropdownMenuItem } from '../ui/dropdown-menu';
Expand Down Expand Up @@ -98,7 +98,7 @@ export function UpdatePipelineDialog({
disabled={!pipeline.name || isLoading}
handleEnter
>
<Loader
<Loader2
className={cn(
'mr-2 hidden',
isLoading ? 'animate-spin block' : ''
Expand Down
Loading