mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-31 19:15:17 +02:00
Reorganize agent sections
This commit is contained in:
parent
c867015366
commit
b52e4b952b
1 changed files with 286 additions and 297 deletions
|
|
@ -31,7 +31,7 @@ const sectionHeaderStyles = "block text-xs font-medium uppercase tracking-wider
|
||||||
const textareaStyles = "rounded-lg p-3 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-750 focus:shadow-inner focus:ring-2 focus:ring-indigo-500/20 dark:focus:ring-indigo-400/20 placeholder:text-gray-400 dark:placeholder:text-gray-500";
|
const textareaStyles = "rounded-lg p-3 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-750 focus:shadow-inner focus:ring-2 focus:ring-indigo-500/20 dark:focus:ring-indigo-400/20 placeholder:text-gray-400 dark:placeholder:text-gray-500";
|
||||||
|
|
||||||
// Add this type definition after the imports
|
// Add this type definition after the imports
|
||||||
type TabType = 'instructions' | 'examples' | 'configurations' | 'rag';
|
type TabType = 'instructions' | 'configurations';
|
||||||
|
|
||||||
export function AgentConfig({
|
export function AgentConfig({
|
||||||
projectId,
|
projectId,
|
||||||
|
|
@ -195,7 +195,7 @@ export function AgentConfig({
|
||||||
<div className="flex flex-col gap-6 p-4 h-[calc(100vh-100px)] min-h-0 flex-1">
|
<div className="flex flex-col gap-6 p-4 h-[calc(100vh-100px)] min-h-0 flex-1">
|
||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
<div className="flex border-b border-gray-200 dark:border-gray-700">
|
<div className="flex border-b border-gray-200 dark:border-gray-700">
|
||||||
{(['instructions', 'examples', 'configurations', 'rag'] as TabType[]).map((tab) => (
|
{(['instructions', 'configurations'] as TabType[]).map((tab) => (
|
||||||
<button
|
<button
|
||||||
key={tab}
|
key={tab}
|
||||||
onClick={() => setActiveTab(tab)}
|
onClick={() => setActiveTab(tab)}
|
||||||
|
|
@ -206,7 +206,7 @@ export function AgentConfig({
|
||||||
: "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
: "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{tab === 'rag' ? 'RAG' : tab.charAt(0).toUpperCase() + tab.slice(1)}
|
{tab.charAt(0).toUpperCase() + tab.slice(1)}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -215,60 +215,23 @@ export function AgentConfig({
|
||||||
<div className="mt-4 flex-1 flex flex-col min-h-0 h-0">
|
<div className="mt-4 flex-1 flex flex-col min-h-0 h-0">
|
||||||
{activeTab === 'instructions' && (
|
{activeTab === 'instructions' && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between mb-4">
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<label className={sectionHeaderStyles}>
|
|
||||||
Instructions
|
|
||||||
</label>
|
|
||||||
<CustomButton
|
|
||||||
variant="secondary"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setIsInstructionsMaximized(!isInstructionsMaximized)}
|
|
||||||
showHoverContent={true}
|
|
||||||
hoverContent={isInstructionsMaximized ? "Minimize" : "Maximize"}
|
|
||||||
>
|
|
||||||
{isInstructionsMaximized ? (
|
|
||||||
<Minimize2 className="w-4 h-4" />
|
|
||||||
) : (
|
|
||||||
<Maximize2 className="w-4 h-4" />
|
|
||||||
)}
|
|
||||||
</CustomButton>
|
|
||||||
</div>
|
|
||||||
<CustomButton
|
|
||||||
variant="primary"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setShowGenerateModal(true)}
|
|
||||||
startContent={<Sparkles className="w-4 h-4" />}
|
|
||||||
>
|
|
||||||
Generate
|
|
||||||
</CustomButton>
|
|
||||||
</div>
|
|
||||||
{isInstructionsMaximized ? (
|
{isInstructionsMaximized ? (
|
||||||
<div className="fixed inset-0 z-50 bg-white dark:bg-gray-900">
|
<div className="fixed inset-0 z-50 bg-white dark:bg-gray-900">
|
||||||
<div className="h-full flex flex-col">
|
<div className="h-full flex flex-col">
|
||||||
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">
|
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<label className={sectionHeaderStyles}>
|
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">{agent.name}</span>
|
||||||
Instructions
|
<span className="text-sm text-gray-500 dark:text-gray-400">/</span>
|
||||||
</label>
|
<span className="text-sm text-gray-500 dark:text-gray-400">Instructions</span>
|
||||||
<CustomButton
|
|
||||||
variant="secondary"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setIsInstructionsMaximized(false)}
|
|
||||||
showHoverContent={true}
|
|
||||||
hoverContent="Minimize"
|
|
||||||
>
|
|
||||||
<Minimize2 className="w-4 h-4" />
|
|
||||||
</CustomButton>
|
|
||||||
</div>
|
</div>
|
||||||
<CustomButton
|
<button
|
||||||
variant="primary"
|
type="button"
|
||||||
size="sm"
|
className="p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
onClick={() => setShowGenerateModal(true)}
|
style={{ lineHeight: 0 }}
|
||||||
startContent={<Sparkles className="w-4 h-4" />}
|
onClick={() => setIsInstructionsMaximized(false)}
|
||||||
>
|
>
|
||||||
Generate
|
<Minimize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
</CustomButton>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 overflow-hidden p-4">
|
<div className="flex-1 overflow-hidden p-4">
|
||||||
<EditableField
|
<EditableField
|
||||||
|
|
@ -292,6 +255,34 @@ export function AgentConfig({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
<div className="space-y-6">
|
||||||
|
{/* Instructions Section */}
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<label className={sectionHeaderStyles}>Instructions</label>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
|
style={{ lineHeight: 0 }}
|
||||||
|
onClick={() => setIsInstructionsMaximized(!isInstructionsMaximized)}
|
||||||
|
>
|
||||||
|
{isInstructionsMaximized ? (
|
||||||
|
<Minimize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
|
) : (
|
||||||
|
<Maximize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<CustomButton
|
||||||
|
variant="primary"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setShowGenerateModal(true)}
|
||||||
|
startContent={<Sparkles className="w-4 h-4" />}
|
||||||
|
>
|
||||||
|
Generate
|
||||||
|
</CustomButton>
|
||||||
|
</div>
|
||||||
<EditableField
|
<EditableField
|
||||||
key="instructions"
|
key="instructions"
|
||||||
value={agent.instructions}
|
value={agent.instructions}
|
||||||
|
|
@ -307,52 +298,43 @@ export function AgentConfig({
|
||||||
mentionsAtValues={atMentions}
|
mentionsAtValues={atMentions}
|
||||||
showSaveButton={true}
|
showSaveButton={true}
|
||||||
showDiscardButton={true}
|
showDiscardButton={true}
|
||||||
className="h-full min-h-0 overflow-auto"
|
className="h-full min-h-0 overflow-auto !mb-0 !mt-0"
|
||||||
/>
|
/>
|
||||||
)}
|
</div>
|
||||||
</>
|
{/* Examples Section */}
|
||||||
)}
|
<div className="space-y-2">
|
||||||
|
|
||||||
{activeTab === 'examples' && (
|
|
||||||
<>
|
|
||||||
<div className="flex items-center justify-between mb-4">
|
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<label className={sectionHeaderStyles}>
|
<label className={sectionHeaderStyles}>Examples</label>
|
||||||
Examples
|
<button
|
||||||
</label>
|
type="button"
|
||||||
<CustomButton
|
className="p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
variant="secondary"
|
style={{ lineHeight: 0 }}
|
||||||
size="sm"
|
|
||||||
onClick={() => setIsExamplesMaximized(!isExamplesMaximized)}
|
onClick={() => setIsExamplesMaximized(!isExamplesMaximized)}
|
||||||
showHoverContent={true}
|
|
||||||
hoverContent={isExamplesMaximized ? "Minimize" : "Maximize"}
|
|
||||||
>
|
>
|
||||||
{isExamplesMaximized ? (
|
{isExamplesMaximized ? (
|
||||||
<Minimize2 className="w-4 h-4" />
|
<Minimize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
) : (
|
) : (
|
||||||
<Maximize2 className="w-4 h-4" />
|
<Maximize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
)}
|
)}
|
||||||
</CustomButton>
|
</button>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{isExamplesMaximized ? (
|
{isExamplesMaximized ? (
|
||||||
<div className="fixed inset-0 z-50 bg-white dark:bg-gray-900">
|
<div className="fixed inset-0 z-50 bg-white dark:bg-gray-900">
|
||||||
<div className="h-full flex flex-col">
|
<div className="h-full flex flex-col">
|
||||||
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">
|
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<label className={sectionHeaderStyles}>
|
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">{agent.name}</span>
|
||||||
Examples
|
<span className="text-sm text-gray-500 dark:text-gray-400">/</span>
|
||||||
</label>
|
<span className="text-sm text-gray-500 dark:text-gray-400">Examples</span>
|
||||||
<CustomButton
|
|
||||||
variant="secondary"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setIsExamplesMaximized(false)}
|
|
||||||
showHoverContent={true}
|
|
||||||
hoverContent="Minimize"
|
|
||||||
>
|
|
||||||
<Minimize2 className="w-4 h-4" />
|
|
||||||
</CustomButton>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800"
|
||||||
|
style={{ lineHeight: 0 }}
|
||||||
|
onClick={() => setIsExamplesMaximized(false)}
|
||||||
|
>
|
||||||
|
<Minimize2 className="w-4 h-4" style={{ width: 16, height: 16 }} />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 overflow-hidden p-4">
|
<div className="flex-1 overflow-hidden p-4">
|
||||||
<EditableField
|
<EditableField
|
||||||
|
|
@ -371,7 +353,7 @@ export function AgentConfig({
|
||||||
mentionsAtValues={atMentions}
|
mentionsAtValues={atMentions}
|
||||||
showSaveButton={true}
|
showSaveButton={true}
|
||||||
showDiscardButton={true}
|
showDiscardButton={true}
|
||||||
className="h-full min-h-0 overflow-auto"
|
className="h-full min-h-0 overflow-auto !mb-0 !mt-0"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -393,12 +375,17 @@ export function AgentConfig({
|
||||||
mentionsAtValues={atMentions}
|
mentionsAtValues={atMentions}
|
||||||
showSaveButton={true}
|
showSaveButton={true}
|
||||||
showDiscardButton={true}
|
showDiscardButton={true}
|
||||||
className="h-full min-h-0 overflow-auto"
|
className="h-full min-h-0 overflow-auto !mb-0 !mt-0"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{activeTab === 'configurations' && (
|
{activeTab === 'configurations' && (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
{!agent.locked && (
|
{!agent.locked && (
|
||||||
|
|
@ -634,16 +621,15 @@ export function AgentConfig({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{activeTab === 'rag' && useRag && (
|
{useRag && (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex flex-col gap-3">
|
<div className="space-y-4">
|
||||||
<div className="space-y-2">
|
<div className="flex items-center">
|
||||||
<label className={sectionHeaderStyles}>
|
<label className={sectionHeaderStyles}>
|
||||||
DATA SOURCES
|
RAG DATA SOURCES
|
||||||
</label>
|
</label>
|
||||||
|
</div>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<Select
|
<Select
|
||||||
variant="bordered"
|
variant="bordered"
|
||||||
|
|
@ -810,8 +796,11 @@ export function AgentConfig({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PreviewModalProvider>
|
<PreviewModalProvider>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue