Skip to content

Conversation

mateuscamaccho
Copy link

@mateuscamaccho mateuscamaccho commented Oct 2, 2025

Pull Request

📋 Description

Add tooltip on card title and cog icon, truncate long titles

🔗 Related Issues

  • Fixes #
  • Related to #

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Style/UI changes
  • ♻️ Code refactoring (no functional changes)
  • ⚡ Performance improvements
  • 🔧 Build/CI changes
  • 🧪 Tests

🧪 Testing

Test Environment

  • Local development
  • Staging environment
  • Production-like environment

Test Cases

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Cross-browser testing (if applicable)
  • Mobile testing (if applicable)

Test Instructions

📸 Screenshots

Before

image

After

image image

✅ Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have run npm run lint and fixed any issues

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested the changes in multiple browsers (if applicable)
  • I have tested the changes on mobile devices (if applicable)

Documentation

  • I have made corresponding changes to the documentation
  • I have updated the README.md if necessary
  • I have added/updated JSDoc comments for new functions
  • I have updated type definitions if necessary

Internationalization

  • I have added translations for new text strings
  • I have tested the changes in different languages (if applicable)

Breaking Changes

  • This PR introduces breaking changes
  • I have documented the breaking changes in the description
  • I have updated the migration guide (if applicable)

🔄 Migration Guide

Before

// Old code example

After

// New code example

📝 Additional Notes

🤝 Reviewer Guidelines

Focus Areas

  • Code logic and correctness
  • Performance implications
  • Security considerations
  • User experience
  • Accessibility
  • Browser compatibility

Testing Checklist for Reviewers

  • Pull and test the branch locally
  • Verify the fix/feature works as described
  • Check for edge cases
  • Verify no regressions in existing functionality

Thank you for contributing to Evolution Manager! 🚀

Summary by Sourcery

Introduce a reusable TooltipWrapper component for themed tooltips and apply it to dashboard card titles and settings icons while truncating long titles.

New Features:

  • Add TooltipWrapper component with theme-aware styling and configurable placement
  • Wrap dashboard card titles and settings icon with tooltips using TooltipWrapper

Enhancements:

  • Truncate long instance names in dashboard cards to prevent overflow

Build:

  • Add @radix-ui/react-tooltip dependency

Copy link

sourcery-ai bot commented Oct 2, 2025

Reviewer's Guide

This PR introduces a reusable, theme-aware TooltipWrapper component based on Radix UI and integrates it into the Dashboard page to provide tooltips for truncated instance names and the settings icon, while adding the necessary dependency and localization entries.

Class diagram for the new TooltipWrapper component

classDiagram
    class TooltipWrapper {
      +content: string
      +children: ReactNode
      +side: "top" | "right" | "bottom" | "left"
      +TooltipWrapper(props: TooltipWrapperProps)
    }
    class TooltipWrapperProps {
      +content: string
      +children: ReactNode
      +side?: "top" | "right" | "bottom" | "left"
    }
    TooltipWrapper --> TooltipWrapperProps
Loading

File-Level Changes

Change Details Files
Introduce TooltipWrapper component with theme support
  • Implement TooltipWrapper using Radix UI Provider, Root, Trigger, Content, Portal, and Arrow
  • Accept content, children, and side props
  • Apply light/dark CSS classes for tooltip styling
src/components/ui/tooltip.tsx
Wrap Dashboard title and settings icon with TooltipWrapper and truncate titles
  • Import and wrap instance.name h3 element in TooltipWrapper
  • Import and wrap Cog button in TooltipWrapper using t('dashboard.settings')
  • Add truncate class to h3 to limit long titles
src/pages/Dashboard/index.tsx
Add @radix-ui/react-tooltip dependency
  • Add @radix-ui/react-tooltip to package.json
  • Install dependency and update package-lock.json
package.json
package-lock.json
Update localization files for new tooltip key
  • Add 'dashboard.settings' translation in en-US, es-ES, fr-FR, pt-BR JSON files
src/translate/languages/en-US.json
src/translate/languages/es-ES.json
src/translate/languages/fr-FR.json
src/translate/languages/pt-BR.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Add the “dashboard.settings” translation key to all locale files so the settings tooltip doesn’t break in other languages.
  • Make non-interactive tooltip triggers (like the h3) keyboard-focusable (e.g. add tabIndex=0) to ensure the tooltip is accessible on focus.
  • Consider moving Tooltip.Provider higher in the component tree (e.g. at App level) to avoid remounting it for every TooltipWrapper and improve performance.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Add the “dashboard.settings” translation key to all locale files so the settings tooltip doesn’t break in other languages.
- Make non-interactive tooltip triggers (like the h3) keyboard-focusable (e.g. add tabIndex=0) to ensure the tooltip is accessible on focus.
- Consider moving Tooltip.Provider higher in the component tree (e.g. at App level) to avoid remounting it for every TooltipWrapper and improve performance.

## Individual Comments

### Comment 1
<location> `src/components/ui/tooltip.tsx:4-8` </location>
<code_context>
+import { ReactNode } from "react";
+
+interface TooltipWrapperProps {
+  content: string; // o texto que vai aparecer no tooltip
+  children: ReactNode; // o trigger (qualquer elemento)
+  side?: "top" | "right" | "bottom" | "left"; // posição opcional
+}
</code_context>

<issue_to_address>
**suggestion:** Tooltip content type could be more flexible.

Consider changing the content prop type to ReactNode to support tooltips with rich formatting or icons.

```suggestion
interface TooltipWrapperProps {
  content: ReactNode; // conteúdo do tooltip (pode ser texto, ícone, ou formatação rica)
  children: ReactNode; // o trigger (qualquer elemento)
  side?: "top" | "right" | "bottom" | "left"; // posição opcional
}
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant