Conditionally render test profiles in playground based on use testing flag

This commit is contained in:
akhisud3195 2025-04-07 17:07:06 +05:30
parent 01f16a11d3
commit f7a4afe49d
2 changed files with 15 additions and 14 deletions

View file

@ -131,15 +131,13 @@ export function App({
</div> </div>
} }
> >
{USE_TESTING_FEATURE && ( <ProfileSelector
<ProfileSelector projectId={projectId}
projectId={projectId} isOpen={isProfileSelectorOpen}
isOpen={isProfileSelectorOpen} onOpenChange={setIsProfileSelectorOpen}
onOpenChange={setIsProfileSelectorOpen} onSelect={handleTestProfileChange}
onSelect={handleTestProfileChange} selectedProfileId={testProfile?._id}
selectedProfileId={testProfile?._id} />
/>
)}
<div className="h-full overflow-auto px-4 py-4"> <div className="h-full overflow-auto px-4 py-4">
<Chat <Chat
key={`chat-${counter}`} key={`chat-${counter}`}

View file

@ -14,6 +14,7 @@ import { apiV1 } from "rowboat-shared";
import { TestProfile } from "@/app/lib/types/testing_types"; import { TestProfile } from "@/app/lib/types/testing_types";
import { WithStringId } from "@/app/lib/types/types"; import { WithStringId } from "@/app/lib/types/types";
import { ProfileContextBox } from "./profile-context-box"; import { ProfileContextBox } from "./profile-context-box";
import { USE_TESTING_FEATURE } from "@/app/lib/feature_flags";
export function Chat({ export function Chat({
chat, chat,
@ -225,11 +226,13 @@ export function Chat({
return <div className="relative max-w-3xl mx-auto h-full flex flex-col"> return <div className="relative max-w-3xl mx-auto h-full flex flex-col">
<div className="sticky top-0 z-10 bg-white dark:bg-zinc-900 pt-4 pb-4"> <div className="sticky top-0 z-10 bg-white dark:bg-zinc-900 pt-4 pb-4">
<ProfileContextBox {USE_TESTING_FEATURE && (
content={testProfile?.context || systemMessage || ''} <ProfileContextBox
onChange={onSystemMessageChange} content={testProfile?.context || systemMessage || ''}
locked={testProfile !== null} onChange={onSystemMessageChange}
/> locked={testProfile !== null}
/>
)}
</div> </div>
<div className="flex-1 overflow-auto pr-1 <div className="flex-1 overflow-auto pr-1