Revert "Convert conversationId int to string before making api request to bulk update file filters"

This reverts commit c9665fb20b.

Revert "Fix handling for new conversation in agents page"

This reverts commit 3466f04992.

Revert "Add a unique_id field for identifiying conversations (#914)"

This reverts commit ece2ec2d90.
This commit is contained in:
sabaimran
2024-09-18 20:34:04 -07:00
parent bb2bd77a64
commit 0a568244fd
12 changed files with 29 additions and 178 deletions

View File

@@ -67,9 +67,7 @@ interface ChatHistory {
compressed: boolean;
created: string;
updated: string;
unique_id: string;
showSidePanel: (isEnabled: boolean) => void;
selectedConversationId: string | null;
}
import {
@@ -400,7 +398,6 @@ interface SessionsAndFilesProps {
conversationId: string | null;
uploadedFiles: string[];
isMobileWidth: boolean;
selectedConversationId: string | null;
}
function SessionsAndFiles(props: SessionsAndFilesProps) {
@@ -438,10 +435,6 @@ function SessionsAndFiles(props: SessionsAndFilesProps) {
agent_avatar={chatHistory.agent_avatar}
agent_name={chatHistory.agent_name}
showSidePanel={props.setEnabled}
unique_id={chatHistory.unique_id}
selectedConversationId={
props.selectedConversationId
}
/>
),
)}
@@ -453,7 +446,6 @@ function SessionsAndFiles(props: SessionsAndFilesProps) {
<ChatSessionsModal
data={props.organizedData}
showSidePanel={props.setEnabled}
selectedConversationId={props.selectedConversationId}
/>
)}
</div>
@@ -648,18 +640,20 @@ function ChatSessionActionMenu(props: ChatSessionActionMenuProps) {
function ChatSession(props: ChatHistory) {
const [isHovered, setIsHovered] = useState(false);
const [title, setTitle] = useState(props.slug || "New Conversation 🌱");
var currConversationId =
props.conversation_id &&
props.selectedConversationId &&
parseInt(props.conversation_id) === parseInt(props.selectedConversationId);
var currConversationId = parseInt(
new URLSearchParams(window.location.search).get("conversationId") || "-1",
);
return (
<div
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
key={props.conversation_id}
className={`${styles.session} ${props.compressed ? styles.compressed : "!max-w-full"} ${isHovered ? `${styles.sessionHover}` : ""} ${currConversationId ? "dark:bg-neutral-800 bg-white" : ""}`}
className={`${styles.session} ${props.compressed ? styles.compressed : "!max-w-full"} ${isHovered ? `${styles.sessionHover}` : ""} ${currConversationId === parseInt(props.conversation_id) && currConversationId != -1 ? "dark:bg-neutral-800 bg-white" : ""}`}
>
<Link href={`/chat?v=${props.unique_id}`} onClick={() => props.showSidePanel(false)}>
<Link
href={`/chat?conversationId=${props.conversation_id}`}
onClick={() => props.showSidePanel(false)}
>
<p className={styles.session}>{title}</p>
</Link>
<ChatSessionActionMenu conversationId={props.conversation_id} setTitle={setTitle} />
@@ -670,14 +664,9 @@ function ChatSession(props: ChatHistory) {
interface ChatSessionsModalProps {
data: GroupedChatHistory | null;
showSidePanel: (isEnabled: boolean) => void;
selectedConversationId: string | null;
}
function ChatSessionsModal({
data,
showSidePanel,
selectedConversationId,
}: ChatSessionsModalProps) {
function ChatSessionsModal({ data, showSidePanel }: ChatSessionsModalProps) {
return (
<Dialog>
<DialogTrigger className="flex text-left text-medium text-gray-500 hover:text-gray-300 cursor-pointer my-4 text-sm p-[0.5rem]">
@@ -709,8 +698,6 @@ function ChatSessionsModal({
agent_avatar={chatHistory.agent_avatar}
agent_name={chatHistory.agent_name}
showSidePanel={showSidePanel}
unique_id={chatHistory.unique_id}
selectedConversationId={selectedConversationId}
/>
))}
</div>
@@ -832,7 +819,6 @@ export default function SidePanel(props: SidePanelProps) {
userProfile={authenticatedData}
conversationId={props.conversationId}
isMobileWidth={props.isMobileWidth}
selectedConversationId={props.conversationId}
/>
</div>
) : (
@@ -901,7 +887,6 @@ export default function SidePanel(props: SidePanelProps) {
userProfile={authenticatedData}
conversationId={props.conversationId}
isMobileWidth={props.isMobileWidth}
selectedConversationId={props.conversationId}
/>
</div>
)}

View File

@@ -408,7 +408,7 @@ export const suggestionsData: Suggestion[] = [
link: "",
},
{
type: SuggestionType.Interviewing,
type: SuggestionType.Code,
color: suggestionToColorMap[SuggestionType.Interviewing] || DEFAULT_COLOR,
description: "Provide tips for writing an effective resume.",
link: "",