Skip to content

Commit

Permalink
[OPIK-536]: merge problems fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha committed Dec 13, 2024
1 parent e6de167 commit 8de2176
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
import last from "lodash/last";
import PlaygroundPromptMessages from "@/components/pages/PlaygroundPage/PlaygroundPrompt/PlaygroundPromptMessages/PlaygroundPromptMessages";
import PromptModelSelect from "@/components/pages/PlaygroundPage/PlaygroundPrompt/PromptModelSelect";
import PromptModelSettings from "@/components/pages/PlaygroundPage/PlaygroundPrompt/PromptModelSettings/PromptModelSettings";
import { getAlphabetLetter } from "@/lib/utils";
import TooltipWrapper from "@/components/shared/TooltipWrapper/TooltipWrapper";
import PromptModelSettings from "@/components/pages/PlaygroundPage/PlaygroundPrompt/PromptModelSettings/PromptModelSettings";

interface PlaygroundPromptProps extends PlaygroundPromptType {
index: number;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

interface PromptModelSettingsTooltipContentProps {
text: string;
}

const PromptModelSettingsTooltipContent = ({
text,
}: PromptModelSettingsTooltipContentProps) => {
return <p className="max-w-72 p-1">{text}</p>;
};

export default PromptModelSettingsTooltipContent;
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";

type TooltipWrapperProps = {
content: string;
export type TooltipWrapperProps = {
content: string | React.ReactElement;
children?: React.ReactNode;
side?: "top" | "right" | "bottom" | "left";
hotkey?: React.ReactNode;
Expand Down
26 changes: 26 additions & 0 deletions apps/opik-frontend/src/components/ui/slider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as React from "react";
import * as SliderPrimitive from "@radix-ui/react-slider";

import { cn } from "@/lib/utils";

const Slider = React.forwardRef<
React.ElementRef<typeof SliderPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
>(({ className, ...props }, ref) => (
<SliderPrimitive.Root
ref={ref}
className={cn(
"relative flex w-full touch-none select-none items-center",
className,
)}
{...props}
>
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-[#F1F5F9]">
<SliderPrimitive.Range className="absolute h-full bg-primary" />
</SliderPrimitive.Track>
<SliderPrimitive.Thumb className="block size-4 rounded-full border-2 border-white bg-primary ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
</SliderPrimitive.Root>
));
Slider.displayName = SliderPrimitive.Root.displayName;

export { Slider };
8 changes: 4 additions & 4 deletions apps/opik-frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export const getAlphabetLetter = (i: number) => {
return characters.charAt(i % characters.length);
};

export const snakeCaseObj = <T extends object>(obj: T) => {
return mapKeys(obj, (_, key) => snakeCase(key));
};

export const calculateWorkspaceName = (
workspaceName: string,
defaultName = "Personal",
) => (workspaceName === DEFAULT_WORKSPACE_NAME ? defaultName : workspaceName);

export const snakeCaseObj = <T extends object>(obj: T) => {
return mapKeys(obj, (_, key) => snakeCase(key));
};
9 changes: 9 additions & 0 deletions apps/opik-frontend/src/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,13 @@
display: none;
}
}

.comet-no-scrollbar::-webkit-scrollbar {
display: none;
}

.comet-no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
}
1 change: 1 addition & 0 deletions apps/opik-frontend/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ const routeTree = rootRoute.addChildren([
redirectProjectsRoute,
redirectDatasetsRoute,
]),
playgroundRoute,
]),
]),
]);
Expand Down
6 changes: 0 additions & 6 deletions apps/opik-frontend/src/types/playgroundPrompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,3 @@ export interface ProviderStreamingMessageType {
choices: ProviderStreamingMessageChoiceType[];
usage: UsageType;
}

export interface PlaygroundOutputType {
id: string;
promptId: string;
text: string;
}

0 comments on commit 8de2176

Please sign in to comment.