Skip to content

Commit e447a1c

Browse files
committed
fix(ui): fix React hooks crash and watch node display
- Move useState before conditional early return in ToolDisplay to fix hooks order violation when rendering human_interact tool - Handle watch node description field in EditableStepNode to prevent [object Object] display in workflow editor - Upgrade jarvis-agent to 0.3.1 (watch_trigger text model support)
1 parent 051a500 commit e447a1c

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-browser",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "DeepFundAI Browser - AI-Powered Intelligent Browser",
55
"author": "Shuai Liu <lsustc@mail.ustc.edu.cn>",
66
"license": "MIT",
@@ -32,8 +32,8 @@
3232
"@ant-design/cssinjs": "^1.23.0",
3333
"@ant-design/icons": "5.x",
3434
"@ant-design/nextjs-registry": "^1.3.0",
35-
"@jarvis-agent/core": "^0.3.0",
36-
"@jarvis-agent/electron": "^0.3.0",
35+
"@jarvis-agent/core": "^0.3.1",
36+
"@jarvis-agent/electron": "^0.3.1",
3737
"@jest/globals": "^30.1.2",
3838
"@react-spring/web": "^10.0.1",
3939
"@types/react-syntax-highlighter": "^15.5.13",

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/chat/message/EditableStepNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const EditableStepNode: React.FC<EditableStepNodeProps> = ({
2929

3030
const nodeText = typeof node === 'string'
3131
? node
32-
: (node?.text ?? String(node ?? ''));
32+
: (node?.text ?? node?.description ?? (typeof node === 'object' ? JSON.stringify(node) : String(node ?? '')));
3333

3434
// Auto-edit mode for newly added empty nodes
3535
const [editing, setEditing] = useState(!!node?._isNew);

src/components/chat/message/ToolMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const ToolDisplay: React.FC<ToolDisplayProps> = ({
2626
onFileClick
2727
}) => {
2828
const { t } = useTranslation('chat');
29+
const [expanded, setExpanded] = useState(false);
2930

3031
// Special handling for human_interact tool
3132
if (message.toolName === 'human_interact' && message.params) {
@@ -139,7 +140,6 @@ export const ToolDisplay: React.FC<ToolDisplayProps> = ({
139140
onFileClick(fileAttachment);
140141
};
141142

142-
const [expanded, setExpanded] = useState(false);
143143
const hasDetail = message.status === 'completed' && (message.params || message.result);
144144

145145
// Format detail content for display

0 commit comments

Comments
 (0)