Skip to content

Commit

Permalink
feat(playground)!: release playground feature (#5576)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking authored Dec 2, 2024
1 parent 32e4e64 commit d3f8370
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/src/contexts/FeatureFlagsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useHotkeys } from "react-hotkeys-hook";

import { Dialog, DialogContainer, Switch, View } from "@arizeai/components";

type FeatureFlag = "playground";
type FeatureFlag = "__RESET__";
export type FeatureFlagsContextType = {
featureFlags: Record<FeatureFlag, boolean>;
setFeatureFlags: (featureFlags: Record<FeatureFlag, boolean>) => void;
Expand All @@ -12,7 +12,7 @@ export type FeatureFlagsContextType = {
export const LOCAL_STORAGE_FEATURE_FLAGS_KEY = "arize-phoenix-feature-flags";

const DEFAULT_FEATURE_FLAGS: Record<FeatureFlag, boolean> = {
playground: false,
__RESET__: false,
};

function getFeatureFlags(): Record<FeatureFlag, boolean> {
Expand Down
18 changes: 7 additions & 11 deletions app/src/pages/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
TopNavbar,
} from "@phoenix/components/nav";
import { useNotifyError } from "@phoenix/contexts";
import { useFeatureFlag } from "@phoenix/contexts/FeatureFlagsContext";
import { useFunctionality } from "@phoenix/contexts/FunctionalityContext";
import { prependBasename } from "@phoenix/utils/routingUtils";

Expand Down Expand Up @@ -97,7 +96,6 @@ function SideNav() {
message: "Failed to log out: " + response.statusText,
});
}, [navigate, notifyError]);
const playgroundEnabled = useFeatureFlag("playground");
return (
<SideNavbar>
<Brand />
Expand Down Expand Up @@ -126,15 +124,13 @@ function SideNav() {
icon={<Icon svg={<Icons.DatabaseOutline />} />}
/>
</li>
{playgroundEnabled && (
<li>
<NavLink
to="/playground"
text="Playground"
icon={<Icon svg={<Icons.PlayCircleOutline />} />}
/>
</li>
)}
<li>
<NavLink
to="/playground"
text="Playground"
icon={<Icon svg={<Icons.PlayCircleOutline />} />}
/>
</li>
<li>
<NavLink
to="/apis"
Expand Down
24 changes: 10 additions & 14 deletions app/src/pages/trace/SpanDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import {
import { SpanKindIcon } from "@phoenix/components/trace";
import { SpanKindLabel } from "@phoenix/components/trace/SpanKindLabel";
import { useNotifySuccess, useTheme } from "@phoenix/contexts";
import { useFeatureFlag } from "@phoenix/contexts/FeatureFlagsContext";
import { usePreferencesContext } from "@phoenix/contexts/PreferencesContext";
import { useChatMessageStyles } from "@phoenix/hooks/useChatMessageStyles";
import {
Expand Down Expand Up @@ -147,7 +146,6 @@ export function SpanDetails({
spanNodeId: string;
projectId: string;
}) {
const isPromptPlaygroundEnabled = useFeatureFlag("playground");
const navigate = useNavigate();
const { span } = useLazyLoadQuery<SpanDetailsQuery>(
graphql`
Expand Down Expand Up @@ -245,18 +243,16 @@ export function SpanDetails({
<Text>{span.name}</Text>
</Flex>
<Flex flex="none" direction="row" alignItems="center" gap="size-100">
{isPromptPlaygroundEnabled ? (
<Button
variant="default"
icon={<Icon svg={<Icons.PlayCircleOutline />} />}
disabled={span.spanKind !== "llm"}
onClick={() => {
navigate(`/playground/spans/${span.id}`);
}}
>
Playground
</Button>
) : null}
<Button
variant="default"
icon={<Icon svg={<Icons.PlayCircleOutline />} />}
disabled={span.spanKind !== "llm"}
onClick={() => {
navigate(`/playground/spans/${span.id}`);
}}
>
Playground
</Button>
<SpanCodeDropdown
traceId={span.context.traceId}
spanId={span.context.spanId}
Expand Down

0 comments on commit d3f8370

Please sign in to comment.