Skip to content

Commit 3f35071

Browse files
committed
🎨 remove guide to give user bigger interface
1 parent 43c2142 commit 3f35071

File tree

3 files changed

+46
-113
lines changed

3 files changed

+46
-113
lines changed

‎frontend/app/[locale]/chat/components/chatHeader.tsx‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,6 @@ export function ChatHeader({
143143
<Button variant="ghost" className="h-8 w-12 rounded-full" onClick={() => setMemoryModalVisible(true)}>
144144
<BrainCircuit className="size-5" stroke="url(#brainCogGradient)" />
145145
</Button>
146-
{/* Dropdown Menu */}
147-
<DropdownMenu>
148-
<DropdownMenuTrigger asChild>
149-
<Button variant="ghost" className="h-8 w-12 rounded-full">
150-
<MoreHorizontal className="size-5" />
151-
</Button>
152-
</DropdownMenuTrigger>
153-
<DropdownMenuContent align="end">
154-
<DropdownMenuItem className="cursor-pointer">
155-
<Bookmark className="mr-2 h-4 w-4" />
156-
<span>{t("chatHeader.bookmark")}</span>
157-
</DropdownMenuItem>
158-
<DropdownMenuItem className="cursor-pointer" onClick={onShare}>
159-
<Share className="mr-2 h-4 w-4" />
160-
<span>{t("chatHeader.share")}</span>
161-
</DropdownMenuItem>
162-
</DropdownMenuContent>
163-
</DropdownMenu>
164146
</div>
165147
</div>
166148
</div>

‎frontend/app/[locale]/setup/agentSetup/components/AgentManagementConfig.tsx‎

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export interface BusinessLogicConfigProps {
3131
setBusinessLogic: (value: string) => void;
3232
selectedTools: Tool[];
3333
setSelectedTools: (tools: Tool[]) => void;
34-
setSystemPrompt: (value: string) => void;
3534
isCreatingNewAgent: boolean;
3635
setIsCreatingNewAgent: (value: boolean) => void;
3736
mainAgentModel: OpenAIModel;
@@ -54,14 +53,12 @@ export interface BusinessLogicConfigProps {
5453
setConstraintContent: (value: string) => void;
5554
fewShotsContent: string;
5655
setFewShotsContent: (value: string) => void;
57-
// Add new props for agent name and description
5856
agentName?: string;
5957
setAgentName?: (value: string) => void;
6058
agentDescription?: string;
6159
setAgentDescription?: (value: string) => void;
6260
agentDisplayName?: string;
6361
setAgentDisplayName?: (value: string) => void;
64-
// Add new prop for generating agent state
6562
isGeneratingAgent?: boolean;
6663
// SystemPromptDisplay related props
6764
onDebug?: () => void;
@@ -82,7 +79,6 @@ export default function BusinessLogicConfig({
8279
setBusinessLogic,
8380
selectedTools,
8481
setSelectedTools,
85-
setSystemPrompt,
8682
isCreatingNewAgent,
8783
setIsCreatingNewAgent,
8884
mainAgentModel,
@@ -105,14 +101,12 @@ export default function BusinessLogicConfig({
105101
setConstraintContent,
106102
fewShotsContent,
107103
setFewShotsContent,
108-
// Add new props for agent name and description
109104
agentName,
110105
setAgentName,
111106
agentDescription,
112107
setAgentDescription,
113108
agentDisplayName,
114109
setAgentDisplayName,
115-
// Add new prop for generating agent state
116110
isGeneratingAgent = false,
117111
// SystemPromptDisplay related props
118112
onDebug,
@@ -234,7 +228,6 @@ export default function BusinessLogicConfig({
234228
if (!isEditingAgent) {
235229
// Only clear and get new Agent configuration in creating mode
236230
setBusinessLogic('');
237-
setSystemPrompt(''); // Also clear the system prompt
238231
fetchSubAgentIdAndEnableToolList(t);
239232
} else {
240233
// In edit mode, data is loaded in handleEditAgent, here validate the form
@@ -245,7 +238,6 @@ export default function BusinessLogicConfig({
245238
// Only refresh list when exiting creation mode in non-editing mode to avoid flicker when exiting editing mode
246239
if (!isEditingAgent && hasInitialized.current) {
247240
setBusinessLogic('');
248-
setSystemPrompt(''); // Also clear the system prompt
249241
setMainAgentModel(OpenAIModel.MainModel);
250242
setMainAgentMaxStep(5);
251243
// Delay refreshing agent list to avoid jumping
@@ -406,7 +398,6 @@ export default function BusinessLogicConfig({
406398
setBusinessLogic('');
407399
setSelectedTools([]);
408400
setEnabledToolIds([]);
409-
setSystemPrompt('');
410401
// Clear right-side name description box
411402
setAgentName?.('');
412403
setAgentDescription?.('');
@@ -518,8 +509,6 @@ export default function BusinessLogicConfig({
518509
setSelectedTools([]);
519510
setEnabledToolIds([]);
520511
}
521-
522-
message.success(t('businessLogic.config.message.agentInfoLoaded'));
523512
} catch (error) {
524513
console.error(t('debug.console.loadAgentDetailsFailed'), error);
525514
message.error(t('businessLogic.config.error.agentDetailFailed'));
@@ -684,11 +673,11 @@ export default function BusinessLogicConfig({
684673

685674
return (
686675
<TooltipProvider>
687-
<div className="flex flex-col h-full w-full gap-0 justify-between relative">
676+
<div className="flex flex-col h-full gap-0 justify-between relative ml-2 mr-2">
688677
{/* Lower part: Agent pool + Agent capability configuration + System Prompt */}
689-
<div className="flex flex-col lg:flex-row gap-4 flex-1 min-h-0 pb-4 pr-4 pl-4">
690-
{/* Left column: Always show SubAgentPool - 30% width */}
691-
<div className="w-full lg:w-[30%] h-full lg:flex-shrink-0">
678+
<div className="flex flex-col lg:flex-row gap-4 flex-1 min-h-0 max-w-full">
679+
{/* Left column: Always show SubAgentPool - Equal flex width */}
680+
<div className="w-full lg:w-auto lg:flex-1 h-full overflow-hidden">
692681
<SubAgentPool
693682
onEditAgent={(agent) => handleEditAgent(agent, t)}
694683
onCreateNewAgent={handleCreateNewAgent}
@@ -703,8 +692,8 @@ export default function BusinessLogicConfig({
703692
/>
704693
</div>
705694

706-
{/* Middle column: Agent capability configuration - 40% width */}
707-
<div className="w-full lg:w-[40%] min-h-0 flex flex-col h-full">
695+
{/* Middle column: Agent capability configuration - Equal flex width */}
696+
<div className="w-full lg:w-auto lg:flex-1 h-full flex flex-col overflow-hidden">
708697
{/* Header: Configure Agent Capabilities */}
709698
<div className="flex justify-between items-center mb-2">
710699
<div className="flex items-center">
@@ -716,7 +705,7 @@ export default function BusinessLogicConfig({
716705
</div>
717706

718707
{/* Content: ScrollArea with two sections */}
719-
<div className="flex-1 min-h-0 overflow-hidden border-t pt-2">
708+
<div className="flex-1 overflow-hidden border-t pt-2">
720709
<div className="flex flex-col h-full" style={{ gap: '16px' }}>
721710
{/* Upper section: Collaborative Agent Display - fixed area */}
722711
<CollaborativeAgentDisplay
@@ -731,7 +720,7 @@ export default function BusinessLogicConfig({
731720
/>
732721

733722
{/* Lower section: Tool Pool - flexible area */}
734-
<div className="flex-1 min-h-0 overflow-hidden">
723+
<div className="flex-1 overflow-hidden">
735724
<MemoizedToolPool
736725
selectedTools={isLoadingTools ? [] : selectedTools}
737726
onSelectTool={(tool, isSelected) => {
@@ -755,8 +744,8 @@ export default function BusinessLogicConfig({
755744
</div>
756745
</div>
757746

758-
{/* Right column: System Prompt Display - 30% width */}
759-
<div className="w-full lg:w-[30%] h-full lg:flex-shrink-0">
747+
{/* Right column: System Prompt Display - Equal flex width */}
748+
<div className="w-full lg:w-auto lg:flex-1 h-full overflow-hidden">
760749
<PromptManager
761750
onDebug={onDebug || (() => {})}
762751
agentId={getCurrentAgentId ? getCurrentAgentId() : (isEditingAgent && editingAgent ? Number(editingAgent.id) : (isCreatingNewAgent && mainAgentId ? Number(mainAgentId) : undefined))}

‎frontend/app/[locale]/setup/agentSetup/config.tsx‎

Lines changed: 36 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import { useState, useEffect, useRef } from 'react'
44
import { useTranslation } from 'react-i18next'
55
import BusinessLogicConfig from './components/AgentManagementConfig'
66
import DebugConfig from './components/DebugConfig'
7-
import GuideSteps from './components/GuideSteps'
8-
import { Row, Col, Drawer, App } from 'antd'
7+
8+
import { Drawer, App } from 'antd'
99
import { fetchTools, fetchAgentList, exportAgent, deleteAgent } from '@/services/agentConfigService'
1010
import { generatePromptStream } from '@/services/promptService'
1111
import { OpenAIModel } from '@/types/agent'
1212
import { updateToolList } from '@/services/mcpService'
1313
import {
1414
SETUP_PAGE_CONTAINER,
15-
THREE_COLUMN_LAYOUT,
1615
STANDARD_CARD,
1716
} from '@/lib/layoutConstants'
1817
import '../../i18n'
@@ -26,12 +25,13 @@ const LAYOUT_CONFIG = {
2625

2726
/**
2827
* Agent configuration main component
28+
* Provides a full-width interface for agent business logic configuration
29+
* Follows SETUP_PAGE_CONTAINER layout standards for consistent height and spacing
2930
*/
3031
export default function AgentConfig() {
3132
const { t } = useTranslation('common')
3233
const { message } = App.useApp()
3334
const [businessLogic, setBusinessLogic] = useState("")
34-
const [systemPrompt, setSystemPrompt] = useState("")
3535
const [selectedTools, setSelectedTools] = useState<any[]>([])
3636
const [isDebugDrawerOpen, setIsDebugDrawerOpen] = useState(false)
3737
const [isCreatingNewAgent, setIsCreatingNewAgent] = useState(false)
@@ -43,7 +43,7 @@ export default function AgentConfig() {
4343
const [loadingAgents, setLoadingAgents] = useState(false)
4444

4545
const [enabledAgentIds, setEnabledAgentIds] = useState<number[]>([])
46-
const [currentGuideStep, setCurrentGuideStep] = useState<number | undefined>(undefined)
46+
4747
const [isEditingAgent, setIsEditingAgent] = useState(false)
4848
const [editingAgent, setEditingAgent] = useState<any>(null)
4949

@@ -335,9 +335,7 @@ export default function AgentConfig() {
335335
}
336336

337337
// Always reset these states regardless of creation mode
338-
setSystemPrompt('');
339338
setSelectedTools([]);
340-
setCurrentGuideStep(undefined);
341339

342340
// Reset the main agent configuration related status
343341
if (!isCreatingNewAgent) {
@@ -441,47 +439,16 @@ export default function AgentConfig() {
441439

442440
return (
443441
<App>
444-
<div className="w-full h-full mx-auto" style={{
442+
<div className="w-full mx-auto" style={{
445443
maxWidth: SETUP_PAGE_CONTAINER.MAX_WIDTH,
446-
padding: `0 ${SETUP_PAGE_CONTAINER.HORIZONTAL_PADDING}`
444+
height: SETUP_PAGE_CONTAINER.MAIN_CONTENT_HEIGHT
447445
}}>
448-
<div className="w-full h-full">
449-
<Row gutter={THREE_COLUMN_LAYOUT.GUTTER} className="h-full">
450-
{/* Left Timeline Guide */}
451-
<Col xs={24} md={24} lg={4} xl={4} className="h-full">
452-
<div className="bg-white border border-gray-200 rounded-md flex flex-col overflow-hidden h-[300px] lg:h-[82vh]" style={{
453-
padding: STANDARD_CARD.PADDING,
454-
overflowY: "auto",
455-
overflowX: "hidden"
456-
}}>
457-
<GuideSteps
458-
isCreatingNewAgent={isCreatingNewAgent}
459-
systemPrompt={systemPrompt}
460-
businessLogic={businessLogic}
461-
selectedTools={selectedTools}
462-
currentStep={currentGuideStep}
463-
isEditingAgent={isEditingAgent}
464-
dutyContent={dutyContent}
465-
constraintContent={constraintContent}
466-
fewShotsContent={fewShotsContent}
467-
enabledAgentIds={enabledAgentIds}
468-
/>
469-
</div>
470-
</Col>
471-
472-
{/* Middle and Right Panel Container */}
473-
<Col xs={24} md={24} lg={20} xl={20}>
474-
<div className="bg-white border border-gray-200 rounded-md flex flex-col overflow-hidden h-[calc(100vh-200px)] lg:h-[82vh]" style={{
475-
overflowY: "auto",
476-
overflowX: "hidden"
477-
}}>
478-
{/* Middle Panel - Business Logic Configuration */}
479-
<div className="flex-1 min-h-0" style={{
480-
padding: STANDARD_CARD.PADDING,
481-
overflowY: "auto",
482-
overflowX: "hidden"
483-
}}>
484-
<BusinessLogicConfig
446+
<div className={STANDARD_CARD.BASE_CLASSES} style={{
447+
height: "100%",
448+
...STANDARD_CARD.CONTENT_SCROLL
449+
}}>
450+
<div style={{ padding: STANDARD_CARD.PADDING, height: "100%" }}>
451+
<BusinessLogicConfig
485452
businessLogic={businessLogic}
486453
setBusinessLogic={(value) => {
487454
setBusinessLogic(value);
@@ -491,7 +458,6 @@ export default function AgentConfig() {
491458
}}
492459
selectedTools={selectedTools}
493460
setSelectedTools={setSelectedTools}
494-
setSystemPrompt={setSystemPrompt}
495461
isCreatingNewAgent={isCreatingNewAgent}
496462
setIsCreatingNewAgent={setIsCreatingNewAgent}
497463
mainAgentModel={mainAgentModel}
@@ -554,7 +520,6 @@ export default function AgentConfig() {
554520
// SystemPromptDisplay related props
555521
onDebug={() => {
556522
setIsDebugDrawerOpen(true);
557-
setCurrentGuideStep(isCreatingNewAgent ? 5 : 5);
558523
}}
559524
getCurrentAgentId={getCurrentAgentId}
560525
onGenerateAgent={handleGenerateAgent}
@@ -563,34 +528,31 @@ export default function AgentConfig() {
563528
editingAgent={editingAgent}
564529
onExitCreation={handleExitCreation}
565530
/>
566-
</div>
567-
</div>
568-
</Col>
569-
</Row>
570-
</div>
571-
572-
{/* Commissioning drawer */}
573-
<Drawer
574-
title={t('agent.debug.title')}
575-
placement="right"
576-
onClose={() => setIsDebugDrawerOpen(false)}
577-
open={isDebugDrawerOpen}
578-
width={LAYOUT_CONFIG.DRAWER_WIDTH}
579-
styles={{
580-
body: {
581-
padding: 0,
582-
height: '100%',
583-
overflow: 'hidden'
584-
}
585-
}}
586-
>
587-
<div className="h-full">
588-
<DebugConfig
589-
agentId={getCurrentAgentId()}
590-
/>
591531
</div>
592-
</Drawer>
532+
</div>
593533
</div>
534+
535+
{/* Commissioning drawer */}
536+
<Drawer
537+
title={t('agent.debug.title')}
538+
placement="right"
539+
onClose={() => setIsDebugDrawerOpen(false)}
540+
open={isDebugDrawerOpen}
541+
width={LAYOUT_CONFIG.DRAWER_WIDTH}
542+
styles={{
543+
body: {
544+
padding: 0,
545+
height: '100%',
546+
overflow: 'hidden'
547+
}
548+
}}
549+
>
550+
<div className="h-full">
551+
<DebugConfig
552+
agentId={getCurrentAgentId()}
553+
/>
554+
</div>
555+
</Drawer>
594556
</App>
595557
)
596558
}

0 commit comments

Comments
 (0)