fix(dashboard): auto-refresh file tree after file-modifying tool operations#1579
fix(dashboard): auto-refresh file tree after file-modifying tool operations#1579Bernardxu123 wants to merge 2 commits into
Conversation
…ations (esengine#1564) When tools like delete_file, write_file, edit_file etc. complete, the dashboard's file tree panel now automatically refreshes to reflect the current filesystem state. Changes: - Add refresh() function to useProjectTree() hook - Add manual refresh button (↻) in file tree header - Listen to SSE tool.end events and auto-refresh when file-modifying tools complete (delete_file, write_file, edit_file, etc.) - Pass onToolComplete callback from ChangesPanel to ChatPane Fixes esengine#1564
…witch (esengine#1217) When a session switch happens while a turn is running, the old turn's cleanup code may still emit events (, , etc.) that arrive after the new session is active, causing UI lag and state corruption. Add a switching flag to the Tab interface: - Set tab.switching = true before aborting in session_load/new_chat - In runTurn's finally block, check tab.switching to suppress stale events - Reset tab.switching = false after processing This prevents the old turn from emitting events that would interfere with the new session's state. Fixes esengine#1217
|
Thanks for the work, but this one I need to close — there are a few separate problems and one of them is structural. 1. The dashboard portion targets files that no longer exist (blocker) The PR base is More fundamentally: the current React dashboard under 2. Two unrelated fixes in one PR
The PR title and description only mention the first. The second touches 3. The desktop.ts change on its own looks salvageable The Please pull that commit out into a standalone PR against current main, linked to #1217. I expect that one to land. 4. Commit author identity Both commits are authored by Summary of what to do
|
Summary
When file-modifying tools (delete_file, write_file, edit_file, etc.) complete in the TUI, the dashboard's file tree panel now automatically refreshes to reflect the current filesystem state.
Fixes #1564
Problem
The dashboard's file tree was fetched once on component mount and never refreshed. After the AI agent used file-modifying tools:
Solution
1. Refresh Function in useProjectTree()
Added a
efresh() function to the useProjectTree() hook that re-fetches the file tree from the server.
2. Manual Refresh Button
Added a refresh button (↻) in the file tree header for manual refresh.
3. Auto-Refresh on Tool Completion
The dashboard's SSE connection now listens for ool events. When a file-modifying tool completes, the file tree automatically refreshes after a 300ms delay.
Supported tools:
Files Changed
dashboard/src/lib/file-tree.tsrefresh()function andrefreshKeystatedashboard/src/panels/changes.tsonToolCompleteprop to ChatPane, auto-refresh logicdashboard/src/i18n/en.tsrefreshTreetranslation keydashboard/src/i18n/zh-CN.tsTesting
npm run lint✅npm run typecheck✅