Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 31, 2025

This PR replaces the text labels in the collapsed auto-approve menu with their corresponding icons, providing a more compact and visually consistent interface.

FocuSee.Project.2025-08-19.18-17-55.mp4

Changes

  • Updated AutoApproveMenu component to display icons instead of text labels when collapsed
  • Added enabledIcons computed value to extract icon names from enabled toggles
  • Modified the display span to render icons with proper styling
  • Updated tests to check for icon presence instead of text content
  • Removed unused displayText and enabledActionsList variables

Visual Changes

  • When collapsed, the auto-approve menu now shows icons (eye, edit, terminal, etc.) instead of text labels like "Read, Write, Execute"
  • Icons are displayed with proper spacing and styling
  • The "None selected" text is still shown when no options are enabled

Testing

  • All existing tests have been updated and are passing
  • The functionality remains unchanged, only the visual representation is different

Important

Replaces text labels with icons in the collapsed AutoApproveMenu for a more compact UI, updating tests accordingly.

  • UI Update:
    • AutoApproveMenu now displays icons instead of text labels in collapsed view.
    • Icons include eye, edit, terminal, etc., with proper spacing and styling.
    • "None selected" text is shown only when no options are enabled.
  • Code Changes:
    • Added enabledIcons computed value to extract icon names from enabled toggles.
    • Removed unused displayText and enabledActionsList variables.
  • Testing:
    • Updated tests in AutoApproveMenu.spec.tsx to check for icon presence instead of text content.
    • Tests ensure icons are displayed and toggled correctly, and tooltips are shown.

This description was created by Ellipsis for e5b41c8. You can customize this summary. It will automatically update as commits are pushed.

- Updated AutoApproveMenu component to display icons instead of text labels when collapsed
- Added enabledIcons computed value to extract icon names from enabled toggles
- Modified the display span to render icons with proper styling
- Updated tests to check for icon presence instead of text content
- Removed unused displayText and enabledActionsList variables
- Maintains the same functionality while providing a more compact visual representation
@roomote roomote bot requested review from cte and mrubens as code owners July 31, 2025 18:22
@roomote roomote bot requested a review from jr as a code owner July 31, 2025 18:22
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused labels Jul 31, 2025
? t("chat:autoApprove.none")
: enabledIcons.map((icon, index) => (
<span
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the toggle key (e.g., the key string) as the unique key instead of the index, and add an aria-label attribute to each icon span for accessibility.

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this UI improvement! The refactoring successfully replaces text labels with icons for a more compact interface. I've identified a few areas that could be enhanced for better robustness and accessibility.

? t("chat:autoApprove.none")
: enabledIcons.map((icon, index) => (
<span
key={index}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enabledIcons array could contain duplicate icons if multiple settings share the same icon, causing React key warnings. Consider using the setting key + index as the key instead of just index, or filter out duplicates if that's the intended behavior.

{!effectiveAutoApprovalEnabled || !hasEnabledOptions
? t("chat:autoApprove.none")
: enabledIcons.map((icon, index) => (
<span
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better accessibility, consider adding aria-label attributes to these icon spans. Screen readers won't be able to interpret the meaning of these icons without text labels or proper ARIA attributes.

{displayText}
{!effectiveAutoApprovalEnabled || !hasEnabledOptions
? t("chat:autoApprove.none")
: enabledIcons.map((icon, index) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With many enabled options, icons could overflow the container. Consider adding a maximum display count (e.g., show first 3-4 icons + '...' indicator) or implementing horizontal scrolling for better UX.

gap: "6px",
}}>
{displayText}
{!effectiveAutoApprovalEnabled || !hasEnabledOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline conditional logic could be extracted to a helper function for better readability. Something like renderEnabledIcons() would make the JSX cleaner.

return Object.entries(toggles)
.filter(([_key, value]) => !!value)
.map(([key]) => autoApproveSettingsConfig[key as AutoApproveSetting].icon)
}, [toggles])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency array includes the entire toggles object. For better performance, consider memoizing based on just the enabled state values or using a more specific dependency array.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 31, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 1, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 1, 2025
@daniel-lxs daniel-lxs marked this pull request as draft August 5, 2025 21:38
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Draft / In Progress] in Roo Code Roadmap Aug 5, 2025
@daniel-lxs
Copy link
Member

@roomote-agent Add tooltips to the icons so they are more easily identifiable, do not create a new PR, push to this one

@roomote
Copy link
Contributor Author

roomote bot commented Aug 5, 2025

I see your request to add tooltips to the icons in the collapsed view. I'll work on implementing this now and push the changes to this PR branch.

- Wrapped each icon in StandardTooltip component
- Tooltips display the label for each auto-approve option
- Added test to verify tooltips appear on hover
- Helps users identify icons more easily in collapsed state
@roomote
Copy link
Contributor Author

roomote bot commented Aug 5, 2025

I've successfully added tooltips to the icons in the collapsed auto-approve menu! 🎉

Changes made:

  • Wrapped each icon in the StandardTooltip component
  • The tooltips display the corresponding label for each auto-approve option (e.g., "Read-only operations", "Write operations", etc.)
  • Added a test case to verify that tooltips appear when hovering over the icons

The implementation uses the existing autoApproveSettingsConfig to map icons to their labels, ensuring consistency with the rest of the application.

The changes have been pushed to this PR branch and CI checks are currently running.

@daniel-lxs
Copy link
Member

@hannesrudolph This looks a bit weird

@hannesrudolph
Copy link
Collaborator

@hannesrudolph This looks a bit weird

image

@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 19, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Aug 19, 2025
@hannesrudolph hannesrudolph reopened this Aug 19, 2025
@github-project-automation github-project-automation bot moved this from Done to Triage in Roo Code Roadmap Aug 19, 2025
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Aug 19, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Aug 19, 2025
const tooltipContent = config ? t(config.labelKey) : ""

return (
<StandardTooltip key={index} content={tooltipContent}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a stable unique key (e.g. the icon name) instead of the array index in the map() to avoid potential key collisions if the order changes.

Suggested change
<StandardTooltip key={index} content={tooltipContent}>
<StandardTooltip key={icon} content={tooltipContent}>

Merge Resolver added 2 commits August 19, 2025 17:39
…irectly

- Icons in collapsed view are now clickable buttons that toggle their respective options
- Added hover effect for better UX feedback
- Clicking an icon directly toggles the auto-approve option without expanding the menu
- Updated tests to verify the new clickable behavior
- Maintains tooltips on all icon buttons
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to PR [Needs Prelim Review] in Roo Code Roadmap Aug 20, 2025
@hannesrudolph hannesrudolph marked this pull request as ready for review August 20, 2025 00:26
Copilot AI review requested due to automatic review settings August 20, 2025 00:26
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 20, 2025
@dosubot
Copy link

dosubot bot commented Aug 20, 2025

Related Documentation

No published documentation to review for changes on this repository.
Write your first living document

How did I do? Any feedback?  Join Discord

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the auto-approve menu interface by replacing text labels with icons in the collapsed view, creating a more compact and visually appealing design. The functionality remains unchanged while improving the visual representation.

  • Replace text labels with corresponding icons (eye, edit, terminal, etc.) in collapsed view
  • Add interactive tooltips and hover states for better user experience
  • Update test suite to verify icon presence and tooltip functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
AutoApproveMenu.tsx Replaces text display with icon buttons, adds tooltips and hover effects
AutoApproveMenu.spec.tsx Updates tests to check for icon presence, highlighting, and tooltip functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

alignItems: "center",
gap: "6px",
}}
onClick={(e) => e.stopPropagation()}>
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onClick handler e.stopPropagation() on the span element is redundant since each individual button already handles its own click events. This could be removed to simplify the code.

Suggested change
onClick={(e) => e.stopPropagation()}>
>

Copilot uses AI. Check for mistakes.
}}
onMouseLeave={(e) => {
e.currentTarget.style.backgroundColor = "transparent"
}}
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The inline mouse event handlers for hover effects could be extracted to improve readability and maintainability. Consider using CSS hover pseudo-selectors or extracting these into named functions.

Suggested change
}}

Copilot uses AI. Check for mistakes.
const isEnabled = !!toggles[key]
return (
<StandardTooltip key={key} content={t(labelKey)}>
<button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an accessible aria-label to the icon button (e.g., aria-label={t(labelKey)}) to ensure screen reader users can understand its purpose.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 21, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 21, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 26, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants