Skip to content

refactor: improve Agent Settings popup UI components#12901

Merged
kangfenmao merged 14 commits intomainfrom
refactor/agent-settings-popup
Feb 14, 2026
Merged

refactor: improve Agent Settings popup UI components#12901
kangfenmao merged 14 commits intomainfrom
refactor/agent-settings-popup

Conversation

@kangfenmao
Copy link
Collaborator

What this PR does

Before this PR:

  • Agent settings popup used a complex ToolingSettings component (574 lines) that handled both permission modes and MCP tools in a single monolithic component
  • Permission mode settings had verbose descriptions and lacked clear visual feedback for selected modes
  • Some UI layouts were not optimally responsive

After this PR:

  • Split ToolingSettings into two focused components: PermissionModeSettings and ToolsAndMCPSettings for better separation of concerns
  • Permission mode selection now uses a cleaner card-based UI with CheckCircle icons for visual feedback
  • Added comprehensive i18n support for permission modes and tools settings across 11 languages
  • Improved layout responsiveness in NameSetting and PromptSettings components
  • Simplified modal handling in permission settings using window.modal.confirm

Why we need it and why it was done in this way

The following tradeoffs were made:

  • Chose to split the monolithic component into smaller focused components for better maintainability, at the cost of slightly more files
  • Removed detailed behavior descriptions from permission mode UI to reduce visual clutter while keeping essential information

The following alternatives were considered:

  • Keeping the single component but it was becoming too complex to maintain
  • Different UI patterns for permission mode selection, but the card-based approach provides the clearest visual hierarchy

Breaking changes

None. This is a pure refactor with UI improvements and i18n additions.

Special notes for your reviewer

  • The overall functionality remains the same, this is primarily a refactoring and UI polish effort
  • i18n files for non-English locales may need review from native speakers
  • Total: +816 lines, -1006 lines (net reduction of ~190 lines)

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: Left the code cleaner than found it (Boy Scout Rule)
  • Upgrade: N/A - no upgrade flow impact
  • Documentation: N/A - internal refactor, no user-facing documentation needed

Release note

Refactor Agent Settings popup with improved UI components, better permission mode selection, and comprehensive i18n support for 11 languages.

…ion files

### What this commit does
- Introduces new localization entries for "Permission Mode" and "Tools & MCP" in English, Chinese (Simplified and Traditional), German, Greek, Spanish, French, Japanese, Portuguese, Romanian, and Russian.
- Updates the UI components to reflect these changes, including the addition of `PermissionModeSettings` and `ToolsAndMCPSettings` components.

### Why this change is necessary
This enhancement improves the user experience by providing localized support for new settings related to permission management and tool configurations, ensuring that users can navigate and utilize these features in their preferred language.

### Checklist
- [x] Localization files updated
- [x] New settings components implemented
- [x] UI updated to incorporate new settings

### Release note
```release-note
Add localization support for new permission mode and tools & MCP settings across multiple languages.
```
### What this commit does
- Modifies the layout of the `PromptSettings` component to use a flexbox structure, enhancing its responsiveness and ensuring proper overflow handling.
- Adjusts the `TextAreaContainer` to include `min-height: 0` and `overflow: hidden` for better layout management.

### Why this change is necessary
These changes improve the user interface by ensuring that the settings panel adapts more effectively to varying screen sizes and content, preventing overflow issues.

### Checklist
- [x] Layout updated for better responsiveness
- [x] Overflow handling improved

### Release note
```release-note
Refactor PromptSettings layout for enhanced responsiveness and overflow management.
```
…gs description display

### What this commit does
- Refactors the `NameSetting` component to improve the layout by wrapping the avatar and name input in separate `SettingsItem` components, enhancing visual clarity.
- Updates the `PermissionModeSettings` component to include the behavior description in the display, ensuring users have complete context for each permission mode.

### Why this change is necessary
These changes improve the user interface by providing a clearer structure in the settings panel and ensuring that all relevant information is presented to the user.

### Checklist
- [x] Layout of NameSetting improved for better organization
- [x] PermissionModeSettings updated to display behavior descriptions

### Release note
```release-note
Refactor NameSetting layout for clarity and enhance PermissionModeSettings to include behavior descriptions.
```
…UI elements

### What this commit does
- Removes the use of the `Modal` component from Ant Design in favor of a direct call to `window.modal.confirm`.
- Introduces a new `CheckCircle` icon to indicate selected permission modes, enhancing visual feedback.
- Adjusts layout and styling for better spacing and organization within the `PermissionModeSettings` component.

### Why this change is necessary
These changes streamline the modal confirmation process and improve the user interface by providing clearer visual cues for selected modes, contributing to a more intuitive user experience.

### Release note
```release-note
Refactor PermissionModeSettings to simplify modal handling and enhance UI with new icons and improved layout.
```
…rity

- Removes unnecessary behavior descriptions from the `PermissionModeSettings` and `PermissionModeDisplay` components to streamline the user interface.
- Updates the fallback titles and descriptions for various permission modes in the localization files to enhance clarity and user understanding.
- Adjusts layout and styling in the `PermissionModeSettings` component for improved visual organization.

These changes improve the user experience by simplifying the information presented in the settings, ensuring that users can easily understand the functionality of each permission mode without overwhelming details.

```release-note
Refactor permission mode descriptions and UI elements for enhanced clarity and user experience.
```
- Move duplicated `computeModeDefaults` function to shared.tsx
- Replace custom `unique` function with lodash `uniq` for consistency
- Both PermissionModeSettings and ToolsAndMCPSettings now import from shared
The tooltip now displays which permission mode is auto-approving the tool,
making it clearer why the switch is disabled.
The tooltip for auto-approved tools has been modified across multiple languages to include the current permission mode, enhancing user understanding of why the tool cannot be disabled.
- Move AgentConfigurationState type and defaultConfiguration to shared.tsx
- Extract cardStyles constant to reduce duplication in ToolsAndMCPSettings
- Remove redundant Card body description (tooltip already shows mode info)
- Change "Tools & MCP" tab to "Tools"
- Change "Pre-approved Tools" title to "Tools"
@kangfenmao kangfenmao force-pushed the refactor/agent-settings-popup branch from cf1e1cb to 31879a9 Compare February 13, 2026 08:23
- Add i18n entries for all 13 builtin tools (Bash, Edit, Glob, etc.)
- Translate tool names and descriptions in zh-cn and zh-tw
- Update ToolsAndMCPSettings to use translated names/descriptions for builtin tools
- Added and updated translations for builtin tools (Bash, Edit, Glob, etc.) in German, Greek, Spanish, French, Japanese, Portuguese, Romanian, and Russian.
- Ensured tool names and descriptions are accurately translated to enhance user experience across different languages.
…rences

- Renamed the ToolsAndMCPSettings component to ToolsSettings for clarity.
- Updated all references in AgentSettingsPopup and SessionSettingsPopup to use the new ToolsSettings component.
- This change improves code readability and consistency in the settings management.
… improved modularity

- Refactored AgentSettingsPopup and SessionSettingsPopup to utilize a new BaseSettingsPopup component, enhancing code reusability and maintainability.
- Removed the AvatarSetting component as it was deemed unnecessary.
- Introduced several new components (e.g., AdvancedSettings, EssentialSettings, PermissionModeSettings) to better organize settings management.
- Updated the handling of menu items and tab content rendering to streamline the user interface and improve user experience.
- Enhanced type definitions for better clarity and consistency across settings components.
@kangfenmao kangfenmao merged commit 1035b3f into main Feb 14, 2026
5 checks passed
@kangfenmao kangfenmao deleted the refactor/agent-settings-popup branch February 14, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments