[Feature] Show created and modified files in the context panel
Description
When the agent creates, edits, or updates a file during a task, the affected file should automatically appear in the context/editor panel.
Currently, file operations can complete successfully, but the created or modified files are not surfaced in the context panel. This makes it harder to immediately inspect what the agent changed.
The experience should be similar to VS Code: when a particular file is created or modified and the user selects it, the file should open in the editor/context panel so the changes can be reviewed immediately.
Expected Behavior
When the agent creates or modifies a file:
- Detect the affected file.
- Add it to the context panel.
- Allow the user to select the file and view its current contents in the editor.
- For modified files, show the latest version after the agent's changes.
For example:
Agent: Creates src/components/Button.tsx
The file should automatically become available in the context/editor panel, allowing the user to open and review Button.tsx without manually searching for it.
Actual Behavior
The agent creates or modifies the file successfully, but the file does not appear in the context/editor panel.
The user has to manually locate the file instead of being able to immediately inspect the changes from the UI.
Why This Matters
The context panel should provide a clear connection between the agent's actions and the files affected by those actions. Automatically surfacing created and modified files would make it much easier to review agent changes and understand what happened during a task.
Additional Context
This should apply to file creation, modification, and potentially deletion events where appropriate. The goal is to provide a VS Code-like workflow where files affected by the agent are immediately accessible for review.
Hi @akramcodez! I'd like to work on this feature. Here's my proposed approach:
Hook into file operation tools (write-file.tsx, string-replace.tsx, etc.) to track changes
Add file tracking state to useAppState hook
Create an Ink.js component to display affected files in the UI
Add /files and /show
Please assign if this sounds good!
sure @addyCooks go for it :)