Skip to content

Commit

Permalink
Revert "[Ahuna] Test assistants in side modal from gallery (#3011)"
Browse files Browse the repository at this point in the history
This reverts commit d9dc8c9.
  • Loading branch information
philipperolet authored Dec 25, 2023
1 parent d9dc8c9 commit 73686ee
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 438 deletions.
26 changes: 2 additions & 24 deletions front/components/assistant/AssistantPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Chip,
DashIcon,
MoreIcon,
PlayIcon,
PlusIcon,
} from "@dust-tt/sparkle";
import {
Expand All @@ -29,7 +28,6 @@ interface AssistantPreviewProps {
onUpdate: () => void;
variant: AssistantPreviewVariant;
flow: AssistantPreviewFlow;
setTestModalAssistant?: (agentConfiguration: AgentConfigurationType) => void;
}

function getDescriptionClassName(variant: AssistantPreviewVariant): string {
Expand Down Expand Up @@ -57,7 +55,6 @@ export function AssistantPreview({
onUpdate,
variant,
flow,
setTestModalAssistant,
}: AssistantPreviewProps) {
const [isUpdatingList, setIsUpdatingList] = useState<boolean>(false);
// TODO(flav) Move notification logic to the caller. This maintains the purity of the component by
Expand Down Expand Up @@ -203,24 +200,7 @@ export function AssistantPreview({
default:
assertNever(flow);
}
let testButton = null;
if (
setTestModalAssistant &&
((flow === "workspace" && agentConfiguration.scope === "published") ||
(flow === "personal" &&
agentConfiguration.userListStatus === "not-in-list"))
) {
testButton = (
<Button
key="test"
variant="tertiary"
icon={PlayIcon}
size="xs"
label={"Test"}
onClick={() => setTestModalAssistant(agentConfiguration)}
/>
);
}

const showAssistantButton = (
<Button
key="show_details"
Expand Down Expand Up @@ -288,9 +268,7 @@ export function AssistantPreview({

// Define button groups with JSX elements, including default buttons
const buttonGroups: Record<AssistantPreviewVariant, JSX.Element[]> = {
gallery: [addButton, testButton, showAssistantButton].filter(
Boolean
) as JSX.Element[],
gallery: [addButton, showAssistantButton].filter(Boolean) as JSX.Element[],
home: defaultButtons,
};

Expand Down
121 changes: 0 additions & 121 deletions front/components/assistant/TryAssistantModal.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function AssistantInputBar({
onSubmit,
conversationId,
stickyMentions,
additionalAgentConfigurations,
}: {
owner: WorkspaceType;
onSubmit: (
Expand All @@ -55,7 +54,6 @@ export function AssistantInputBar({
) => void;
conversationId: string | null;
stickyMentions?: AgentMention[];
additionalAgentConfigurations?: AgentConfigurationType[];
}) {
const [contentFragmentBody, setContentFragmentBody] = useState<
string | undefined
Expand All @@ -67,8 +65,6 @@ export function AssistantInputBar({
workspaceId: owner.sId,
agentsGetView: conversationId ? { conversationId } : "list",
});
agentConfigurations.push(...(additionalAgentConfigurations ?? []));

const sendNotification = useContext(SendNotificationsContext);

const [isAnimating, setIsAnimating] = useState<boolean>(false);
Expand Down Expand Up @@ -269,7 +265,6 @@ export function FixedAssistantInputBar({
onSubmit,
stickyMentions,
conversationId,
additionalAgentConfigurations,
}: {
owner: WorkspaceType;
onSubmit: (
Expand All @@ -279,7 +274,6 @@ export function FixedAssistantInputBar({
) => void;
stickyMentions?: AgentMention[];
conversationId: string | null;
additionalAgentConfigurations?: AgentConfigurationType[];
}) {
return (
<div className="4xl:px-0 fixed bottom-0 left-0 right-0 z-20 flex-initial lg:left-80">
Expand All @@ -289,7 +283,6 @@ export function FixedAssistantInputBar({
onSubmit={onSubmit}
conversationId={conversationId}
stickyMentions={stickyMentions}
additionalAgentConfigurations={additionalAgentConfigurations}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit 73686ee

Please sign in to comment.