Skip to content

Commit 231f2c2

Browse files
authored
Merge Multi-Turn Feature with New Dashboard UI Design – Conflict Resolution and Integration Updates (#546)
2 parents 614b90c + 53e54c4 commit 231f2c2

File tree

128 files changed

+6890
-2287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6890
-2287
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"dependencies": {
3232
"@electron/notarize": "^2.5.0",
3333
"@fontsource/inter": "^5.2.5",
34+
"@gsap/react": "^2.1.2",
3435
"@microsoft/fetch-event-source": "^2.0.1",
3536
"@monaco-editor/loader": "^1.5.0",
3637
"@monaco-editor/react": "^4.7.0",
@@ -72,9 +73,10 @@
7273
"lucide-react": "^0.509.0",
7374
"mammoth": "^1.9.1",
7475
"monaco-editor": "^0.52.2",
75-
"motion": "^12.23.22",
76+
"motion": "^12.23.23",
7677
"next-themes": "^0.4.6",
7778
"papaparse": "^5.5.3",
79+
"postprocessing": "^6.37.8",
7880
"react-markdown": "^10.1.0",
7981
"react-resizable-panels": "^3.0.4",
8082
"react-router-dom": "^7.6.0",
@@ -83,6 +85,7 @@
8385
"tailwind-merge": "^3.3.0",
8486
"tailwindcss-animate": "^1.0.7",
8587
"tar": "^7.4.3",
88+
"three": "^0.180.0",
8689
"tree-kill": "^1.2.2",
8790
"tw-animate-css": "^1.2.9",
8891
"unzipper": "^0.12.3",
File renamed without changes.

src/components/AddWorker/IntegrationList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ export default function IntegrationList({
373373
"Reddit",
374374
"Github",
375375
].includes(item.name)
376-
? t("setting.coming-soon")
376+
? t("layout.coming-soon")
377377
: isInstalled
378-
? t("setting.uninstall")
379-
: t("setting.install")}
378+
? t("layout.uninstall")
379+
: t("layout.install")}
380380
</Button>
381381
)}
382382
</div>

src/components/AddWorker/ToolSelect.tsx

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Badge } from "@/components/ui/badge";
99
import { CircleAlert, Store, X } from "lucide-react";
1010
import { proxyFetchGet, proxyFetchPost, fetchPost } from "@/api/http";
1111
import { Input } from "../ui/input";
12+
import { Textarea } from "../ui/textarea";
1213
import { Button } from "../ui/button";
1314
import githubIcon from "@/assets/github.svg";
1415
import { TooltipSimple } from "../ui/tooltip";
@@ -140,13 +141,13 @@ const ToolSelect = forwardRef<
140141
toolkit: value.toolkit,
141142
desc:
142143
value.env_vars && value.env_vars.length > 0
143-
? `Environmental variables required: ${value.env_vars.join(
144+
? `${t("layout.environmental-variables-required")} ${value.env_vars.join(
144145
", "
145146
)}`
146147
: key.toLowerCase() === 'notion'
147-
? "Notion workspace integration for reading and managing Notion pages"
148+
? t("layout.notion-workspace-integration")
148149
: key.toLowerCase() === 'google calendar'
149-
? "Google Calendar integration for managing events and schedules"
150+
? t("layout.google-calendar-integration")
150151
: "",
151152
onInstall,
152153
};
@@ -157,7 +158,7 @@ const ToolSelect = forwardRef<
157158
};
158159

159160
// Refs
160-
const inputRef = useRef<HTMLInputElement>(null);
161+
const inputRef = useRef<HTMLTextAreaElement>(null);
161162
const debounceTimerRef = useRef<NodeJS.Timeout | null>(null);
162163
const containerRef = useRef<HTMLDivElement>(null);
163164

@@ -360,10 +361,10 @@ const ToolSelect = forwardRef<
360361
};
361362

362363
const getInstallButtonText = (itemId: number) => {
363-
if (installedIds.includes(itemId)) return t("setting.installed");
364-
if (installing[itemId]) return t("setting.installing");
365-
if (installed[itemId]) return t("setting.installed");
366-
return t("setting.install");
364+
if (installedIds.includes(itemId)) return t("layout.installed");
365+
if (installing[itemId]) return t("layout.installing");
366+
if (installed[itemId]) return t("layout.installed");
367+
return t("layout.install");
367368
};
368369

369370
// Effects
@@ -521,36 +522,43 @@ const ToolSelect = forwardRef<
521522
className="leading-17 text-xs font-bold text-button-secondary-text-default h-6 px-sm py-xs bg-button-secondary-fill-default hover:bg-button-tertiery-text-default rounded-md shadow-sm"
522523
disabled={true}
523524
>
524-
{t("setting.installed")}
525+
{t("layout.installed")}
525526
</Button>
526527
</div>
527528
</div>
528529
);
529530
return (
530531
<div className="w-full relative" ref={containerRef}>
531-
<div className="flex flex-wrap gap-1 min-h-[40px] border rounded-lg bg-white">
532+
<div className="flex flex-wrap gap-1.5 min-h-[40px] border rounded-lg bg-white">
533+
<div className="text-text-body text-sm leading-normal font-bold flex items-center gap-1">
534+
{t("workforce.agent-tool")}
535+
<TooltipSimple content={t("workforce.agent-tool-tooltip")}>
536+
<CircleAlert size={16} className="text-icon-primary" />
537+
</TooltipSimple>
538+
</div>
532539
<div
533540
onClick={() => {
534541
inputRef.current?.focus();
535542
setIsOpen(true);
536543
}}
537-
className="flex flex-wrap gap-1 justify-start px-[6px] py-1 min-h-[60px] max-h-[120px] overflow-y-auto w-full rounded-sm border border-solid border-input-border-default bg-input-bg-default !shadow-none text-sm leading-normal"
544+
className="flex flex-wrap gap-1 justify-start px-[6px] py-1 min-h-[60px] max-h-[120px] overflow-y-auto w-full rounded-lg border border-solid border-input-border-default bg-input-bg-default"
538545
>
539546
{renderSelectedItems()}
540-
<Input
547+
<Textarea
548+
variant="none"
541549
value={keyword}
542550
onChange={(e) => setKeyword(e.target.value)}
543551
onFocus={() => setIsOpen(true)}
544552
ref={inputRef}
545-
className="bg-transparent border-none !shadow-none text-sm leading-normal !ring-0 !ring-offset-0 w-auto !h-[20px] p-0"
553+
className="bg-transparent border-none !shadow-none text-sm leading-normal !ring-0 !ring-offset-0 w-auto !h-[20px] p-0 resize-none"
546554
/>
547555
</div>
548556
</div>
549557

550558
{/* floating dropdown */}
551559
{isOpen && (
552-
<div className="absolute top-full left-0 right-0 z-50 mt-1 bg-dropdown-bg">
553-
<div className="border rounded-lg shadow-lg bg-white max-h-[192px] overflow-y-auto">
560+
<div className="absolute top-full left-0 right-0 z-50 mt-1 bg-dropdown-bg rounded-lg border border-solid border-input-border-default overflow-y-auto">
561+
<div className="max-h-[192px] overflow-y-auto">
554562
<IntegrationList
555563
onShowEnvConfig={onShowEnvConfig}
556564
addOption={addOption}

src/components/AddWorker/index.tsx

Lines changed: 61 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {
33
Dialog,
44
DialogClose,
55
DialogContent,
6+
DialogContentSection,
67
DialogFooter,
78
DialogHeader,
8-
DialogTitle,
99
DialogTrigger,
1010
} from "@/components/ui/dialog";
1111
import { Input } from "@/components/ui/input";
@@ -319,33 +319,19 @@ export function AddWorker({
319319
</Button>
320320
)}
321321
</DialogTrigger>
322-
<DialogContent className="sm:max-w-[425px] p-0 !bg-popup-surface gap-0 !rounded-xl border border-zinc-300 shadow-sm">
323-
<DialogHeader className="!bg-popup-surface !rounded-t-xl p-md">
324-
<DialogTitle className="m-0">
325-
<div className="flex gap-xs items-center justify-start">
326-
{showEnvConfig && (
327-
<ChevronLeft
328-
onClick={handleCloseMcpEnvSetting}
329-
size={16}
330-
className="text-icon-primary cursor-pointer"
331-
/>
332-
)}
333-
<div className="text-base font-bold leading-10 text-text-action">
334-
{showEnvConfig
335-
? t("workforce.configure-mcp-server")
336-
: t("workforce.add-your-agent")}
337-
</div>
338-
<TooltipSimple content="Configure your MCP worker node here.">
339-
<CircleAlert size={16} />
340-
</TooltipSimple>
341-
</div>
342-
</DialogTitle>
343-
</DialogHeader>
322+
<DialogContent size="sm" className="p-0 gap-0">
323+
<DialogHeader
324+
title={showEnvConfig ? t("workforce.configure-mcp-server") : t("workforce.add-your-agent")}
325+
tooltip={t("layout.configure-your-mcp-worker-node-here")}
326+
showTooltip={true}
327+
showBackButton={showEnvConfig}
328+
onBackClick={handleCloseMcpEnvSetting}
329+
/>
344330

345331
{showEnvConfig ? (
346332
// environment configuration interface
347333
<>
348-
<div className="flex flex-col gap-3 bg-white-100% p-md">
334+
<DialogContentSection className="flex flex-col gap-3 bg-white-100% p-md">
349335
<div className="flex gap-md items-center">
350336
{getCategoryIcon(activeMcp?.category?.name)}
351337
<div>
@@ -394,19 +380,19 @@ export function AddWorker({
394380
)
395381
)}
396382
</div>
397-
</div>
398-
<DialogFooter className="bg-white-100% !rounded-b-xl p-md">
399-
<Button
400-
onClick={handleCloseMcpEnvSetting}
401-
variant="ghost"
402-
size="sm"
403-
>
404-
{t("workforce.cancel")}
405-
</Button>
406-
<Button size="sm" onClick={handleConfigureMcpEnvSetting}>
407-
<span>{t("Connect")}</span>
408-
<ArrowRight size={16} />
409-
</Button>
383+
</DialogContentSection>
384+
<DialogFooter
385+
className="bg-white-100% !rounded-b-xl p-md"
386+
showCancelButton={true}
387+
showConfirmButton={true}
388+
cancelButtonText={t("workforce.cancel")}
389+
confirmButtonText={t("layout.connect")}
390+
onCancel={handleCloseMcpEnvSetting}
391+
onConfirm={handleConfigureMcpEnvSetting}
392+
cancelButtonVariant="ghost"
393+
confirmButtonVariant="primary"
394+
>
395+
<ArrowRight size={16} />
410396
</DialogFooter>
411397
{/* hidden but keep rendering ToolSelect component */}
412398
<div style={{ display: "none" }}>
@@ -421,72 +407,64 @@ export function AddWorker({
421407
) : (
422408
// default add interface
423409
<>
424-
<div className="flex flex-col gap-3 bg-white-100% p-md">
425-
<div className="flex flex-col gap-2">
426-
<div className="flex items-center gap-sm pb-md border-[0px] border-b border-solid border-border-secondary">
410+
<DialogContentSection className="flex flex-col gap-3 bg-white-100% p-md">
411+
<div className="flex flex-col gap-4">
412+
<div className="flex items-center gap-sm">
413+
<div className="flex w-16 h-16 items-center justify-center">
427414
<Bot size={32} className="text-icon-primary" />
415+
</div>
428416
<Input
429-
placeholder="Agent Name"
417+
size="sm"
418+
title={t("layout.name-your-agent")}
419+
placeholder={t("layout.add-an-agent-name")}
430420
value={workerName}
431421
onChange={(e) => {
432422
setWorkerName(e.target.value);
433423
// when user starts input, clear error
434424
if (nameError) setNameError("");
435425
}}
436-
className={`!border-none !bg-transparent !shadow-none text-xl leading-2xl font-bold !ring-0 !ring-offset-0 ${
437-
nameError ? "border-red-500" : ""
438-
}`}
426+
state={nameError ? "error" : "default"}
427+
note={nameError || ""}
428+
backIcon={<RefreshCw size={16} className="text-button-transparent-icon-disabled" />}
429+
onBackIconClick={() => {
430+
// Handle refresh/regenerate logic here
431+
console.log("Refresh agent name");
432+
}}
439433
required
440434
/>
441-
<RefreshCw
442-
size={16}
443-
className="text-button-transparent-icon-disabled"
444-
/>
445435
</div>
446-
{nameError && (
447-
<div className="text-red-500 text-sm font-medium">
448-
{nameError}
449-
</div>
450-
)}
451436
</div>
452-
<div className="flex flex-col gap-sm ">
453-
<div className="text-text-body text-sm leading-normal font-bold">
454-
{t("workforce.description-optional")}
455-
</div>
456-
<Textarea
457-
placeholder="I'm an agent specially designed for..."
437+
438+
<Textarea
439+
variant="enhanced"
440+
size="sm"
441+
title={t("workforce.description-optional")}
442+
placeholder={t("layout.im-an-agent-specially-designed-for")}
458443
value={workerDescription}
459444
onChange={(e) => setWorkerDescription(e.target.value)}
460-
className="rounded-sm border border-solid border-input-border-default bg-input-bg-default !shadow-none text-sm leading-normal !ring-0 !ring-offset-0 resize-none"
461-
/>
462-
</div>
463-
<div>
464-
<div className="flex items-center gap-sm ">
465-
<div className="text-text-body text-sm leading-normal font-bold">
466-
{t("workforce.agent-tool")}
467-
</div>
468-
<TooltipSimple content="Select MCP tools for your worker node.">
469-
<CircleAlert size={16} />
470-
</TooltipSimple>
471-
</div>
472-
</div>
445+
/>
446+
473447
<ToolSelect
474448
onShowEnvConfig={handleShowEnvConfig}
475449
onSelectedToolsChange={handleSelectedToolsChange}
476450
initialSelectedTools={selectedTools}
477451
ref={toolSelectRef}
478452
/>
479-
</div>
480-
<DialogFooter className="bg-white-100% !rounded-b-xl p-md">
481-
<DialogClose asChild>
482-
<Button onClick={resetForm} variant="ghost" size="sm">
483-
{t("workforce.cancel")}
484-
</Button>
485-
</DialogClose>
486-
<Button size="sm" onClick={handleAddWorker} type="submit">
487-
<span>{t("workforce.save-changes")}</span>
488-
</Button>
489-
</DialogFooter>
453+
</DialogContentSection>
454+
<DialogFooter
455+
className="bg-white-100% !rounded-b-xl p-md"
456+
showCancelButton={true}
457+
showConfirmButton={true}
458+
cancelButtonText={t("workforce.cancel")}
459+
confirmButtonText={t("workforce.save-changes")}
460+
onCancel={() => {
461+
resetForm();
462+
setDialogOpen(false);
463+
}}
464+
onConfirm={handleAddWorker}
465+
cancelButtonVariant="ghost"
466+
confirmButtonVariant="primary"
467+
/>
490468
</>
491469
)}
492470
</DialogContent>

src/components/BottomBar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { WorkSpaceMenu } from "@/components/WorkSpaceMenu";
22

33
function BottomBar() {
44
return (
5-
<div className="flex h-12 items-center justify-center px-2 py-1 z-50 relative">
5+
<div className="flex h-12 items-center justify-center pb-2 z-50 relative">
66
<WorkSpaceMenu />
77
</div>
88
);

0 commit comments

Comments
 (0)