From 4de8c4d6b1dddf60538f0123a576074f62cc1e36 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Wed, 16 Apr 2025 10:27:31 -0400 Subject: [PATCH] Update repo microagent docs with frontend action handling information (#7856) Co-authored-by: openhands --- .openhands/microagents/repo.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.openhands/microagents/repo.md b/.openhands/microagents/repo.md index b44bbe17b1..0b6be003a4 100644 --- a/.openhands/microagents/repo.md +++ b/.openhands/microagents/repo.md @@ -54,3 +54,20 @@ Frontend: ## Template for Github Pull Request If you are starting a pull request (PR), please follow the template in `.github/pull_request_template.md`. + +## Implementation Details + +These details may or may not be useful for your current task. + +### Frontend + +#### Action Handling: +- Actions are defined in `frontend/src/types/action-type.ts` +- The `HANDLED_ACTIONS` array in `frontend/src/state/chat-slice.ts` determines which actions are displayed as collapsible UI elements +- To add a new action type to the UI: + 1. Add the action type to the `HANDLED_ACTIONS` array + 2. Implement the action handling in `addAssistantAction` function in chat-slice.ts + 3. Add a translation key in the format `ACTION_MESSAGE$ACTION_NAME` to the i18n files +- Actions with `thought` property are displayed in the UI based on their action type: + - Regular actions (like "run", "edit") display the thought as a separate message + - Special actions (like "think") are displayed as collapsible elements only