diff --git a/src/components/HistorySidebar/index.tsx b/src/components/HistorySidebar/index.tsx index 2ec126ae..3047d4f5 100644 --- a/src/components/HistorySidebar/index.tsx +++ b/src/components/HistorySidebar/index.tsx @@ -271,6 +271,157 @@ export default function HistorySidebar() {
+
+ {/* Table view hidden + {history_type === "table" ? ( + // Table +
+ {Object.keys(chatStore.tasks) + .reverse() + .map((taskId) => { + const task = chatStore.tasks[taskId]; + return task.status != "finished" && !task.type ? ( +
{ + chatStore.setActiveTaskId(taskId); + navigate(`/`); + close(); + }} + className={`${ + chatStore.activeTaskId === taskId + ? "!bg-white-100%" + : "" + } max-w-full relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl backdrop-blur-xl w-[316px] h-[180px]`} + > +
+
+
+ folder-icon +
+
+ {task?.messages?.[0]?.content || t("layout.new-project")} +
+
+ +
+
+
+
+
+ {t("layout.tasks")} +
+
+ {task.taskRunning?.filter( + (taskItem) => + taskItem.status === "completed" || + taskItem.status === "failed" + ).length || 0} + /{task.taskRunning?.length || 0} +
+
+
+ {task.taskAssigning.map( + (taskAssigning) => + taskAssigning.status === "running" && ( +
+ handleClickAgent( + taskId, + taskAssigning.agent_id as AgentNameType + ) + } + className={`transition-all duration-300 flex justify-start items-center gap-1 px-sm py-xs bg-menutabs-bg-default hover:bg-white-100% rounded-lg border border-solid border-white-100% shadow-history-item ${ + agentMap[ + taskAssigning.type as keyof typeof agentMap + ]?.borderColor + }`} + > + +
+ {taskAssigning.name} +
+
+ ) + )} +
+
+
+
+ ) : ( + "" + ); + })} +
+ ) : ( + // List + */} +
+ {Object.keys(chatStore.tasks) + .reverse() + .map((taskId) => { + const task = chatStore.tasks[taskId]; + return task.status != "finished" && !task.type ? ( +
{ + chatStore.setActiveTaskId(taskId); + navigate(`/`); + close(); + }} + className={`${ + chatStore.activeTaskId === taskId + ? "!bg-white-100%" + : "" + } max-w-full flex w-full items-center border-radius-2xl bg-white-30% box-sizing-border-box p-3 relative h-14 gap-md transition-all duration-300 hover:bg-white-100% rounded-2xl cursor-pointer`} + > + folder-icon +
+ + {task?.messages?.[0]?.content || t("layout.new-project")} +

+ } + className="w-[300px] bg-surface-tertiary p-2 text-wrap break-words text-label-xs select-text pointer-events-auto shadow-perfect" + > + + {task?.messages?.[0]?.content || t("dashboard.new-project")} + +
+
+
+ ) : ( + "" + ); + })} +
+ {/* )} */} +
{historyOpen && (