Add tooltips and change section headings

This commit is contained in:
akhisud3195 2025-02-17 16:37:54 +05:30
parent b8ac0482fc
commit bfdc58fa40
5 changed files with 71 additions and 39 deletions

View file

@ -98,7 +98,10 @@ export function App({
} }
return ( return (
<Pane title="Chat" actions={[ <Pane
title="PLAYGROUND"
tooltip="Test your agents and see their responses in this interactive chat interface"
actions={[
<ActionButton <ActionButton
key="new-chat" key="new-chat"
icon={<MessageSquarePlusIcon size={16} />} icon={<MessageSquarePlusIcon size={16} />}
@ -113,7 +116,8 @@ export function App({
> >
Simulate Simulate
</ActionButton>, </ActionButton>,
]}> ]}
>
<div className="h-full overflow-auto"> <div className="h-full overflow-auto">
{loadingChat && <div className="flex justify-center items-center h-full"> {loadingChat && <div className="flex justify-center items-center h-full">
<Spinner /> <Spinner />

View file

@ -529,7 +529,11 @@ export function Copilot({
setResponseError: (error: string | null) => void; setResponseError: (error: string | null) => void;
}) { }) {
return ( return (
<Pane fancy title="Copilot" actions={[ <Pane
fancy
title="COPILOT"
tooltip="Get AI assistance for creating and improving your multi-agent system"
actions={[
<ActionButton <ActionButton
key="ask" key="ask"
primary primary
@ -542,7 +546,8 @@ export function Copilot({
> >
New New
</ActionButton> </ActionButton>
]}> ]}
>
<App <App
projectId={projectId} projectId={projectId}
workflow={workflow} workflow={workflow}

View file

@ -105,7 +105,10 @@ export function EntityList({
}, [selectedEntity]); }, [selectedEntity]);
return ( return (
<Pane title="Index"> <Pane
title="WORKFLOW"
tooltip="Browse and manage your agents, tools, and prompts in this sidebar"
>
<div className="overflow-auto flex flex-col gap-1 justify-start"> <div className="overflow-auto flex flex-col gap-1 justify-start">
{/* Agents Section */} {/* Agents Section */}
<SectionHeader title="Agents" onAdd={() => onAddAgent({})} /> <SectionHeader title="Agents" onAdd={() => onAddAgent({})} />

View file

@ -1,27 +1,45 @@
import clsx from "clsx"; import clsx from "clsx";
import { InfoIcon } from "lucide-react";
import { Tooltip } from "@nextui-org/react";
export function Pane({ export function Pane({
title, title,
actions = null, actions = null,
children, children,
fancy = false, fancy = false,
tooltip = null,
}: { }: {
title: React.ReactNode; title: React.ReactNode;
actions?: React.ReactNode[] | null; actions?: React.ReactNode[] | null;
children: React.ReactNode; children: React.ReactNode;
fancy?: boolean; fancy?: boolean;
tooltip?: string | null;
}) { }) {
return <div className={clsx("h-full flex flex-col overflow-auto rounded-md p-1", { return <div className={clsx("h-full flex flex-col overflow-auto rounded-md p-1", {
"bg-gray-100": !fancy, "bg-gray-100": !fancy,
"bg-blue-100": fancy, "bg-blue-100": fancy,
})}> })}>
<div className="shrink-0 flex justify-between items-center gap-2 px-2 py-1 rounded-t-sm"> <div className="shrink-0 flex justify-between items-center gap-2 px-2 py-1 rounded-t-sm">
<div className="flex items-center gap-1">
<div className={clsx("text-xs font-semibold uppercase", { <div className={clsx("text-xs font-semibold uppercase", {
"text-gray-400": !fancy, "text-gray-400": !fancy,
"text-blue-500": fancy, "text-blue-500": fancy,
})}> })}>
{title} {title}
</div> </div>
{tooltip && (
<Tooltip
content={tooltip}
placement="right"
className="cursor-help"
>
<InfoIcon size={12} className={clsx({
"text-gray-400": !fancy,
"text-blue-500": fancy,
})} />
</Tooltip>
)}
</div>
{!actions && <div className="w-4 h-4" />} {!actions && <div className="w-4 h-4" />}
{actions && <div className={clsx("rounded-md hover:text-gray-800 px-2 text-sm flex items-center gap-2", { {actions && <div className={clsx("rounded-md hover:text-gray-800 px-2 text-sm flex items-center gap-2", {
"text-blue-600": fancy, "text-blue-600": fancy,

View file

@ -29,6 +29,8 @@ import { BackIcon, HamburgerIcon, WorkflowIcon } from "../../../lib/components/i
import { CopyIcon, Layers2Icon, RadioIcon, RedoIcon, Sparkles, UndoIcon } from "lucide-react"; import { CopyIcon, Layers2Icon, RadioIcon, RedoIcon, Sparkles, UndoIcon } from "lucide-react";
import { EntityList } from "./entity_list"; import { EntityList } from "./entity_list";
import { CopilotMessage } from "../../../lib/types/copilot_types"; import { CopilotMessage } from "../../../lib/types/copilot_types";
import { InfoIcon } from "lucide-react";
import { clsx } from "clsx";
enablePatches(); enablePatches();
@ -760,7 +762,7 @@ export function WorkflowEditor({
</div>} </div>}
{!isLive && <> {!isLive && <>
<button <button
className="p-1 text-gray-400 hover:text-black" className="p-1 text-gray-400 hover:text-black hover:cursor-pointer"
title="Undo" title="Undo"
disabled={state.currentIndex <= 0} disabled={state.currentIndex <= 0}
onClick={() => dispatch({ type: "undo" })} onClick={() => dispatch({ type: "undo" })}
@ -768,7 +770,7 @@ export function WorkflowEditor({
<UndoIcon size={16} /> <UndoIcon size={16} />
</button> </button>
<button <button
className="p-1 text-gray-400 hover:text-black" className="p-1 text-gray-400 hover:text-black hover:cursor-pointer"
title="Redo" title="Redo"
disabled={state.currentIndex >= state.patches.length} disabled={state.currentIndex >= state.patches.length}
onClick={() => dispatch({ type: "redo" })} onClick={() => dispatch({ type: "redo" })}
@ -776,7 +778,7 @@ export function WorkflowEditor({
<RedoIcon size={16} /> <RedoIcon size={16} />
</button> </button>
<button <button
className="p-1 text-blue-600 hover:text-blue-800" className="p-1 text-blue-600 hover:text-blue-800 hover:cursor-pointer"
title="Toggle Copilot" title="Toggle Copilot"
onClick={() => setShowCopilot(!showCopilot)} onClick={() => setShowCopilot(!showCopilot)}
> >