Skip to content

fix(frontend): fix agent creation UX wizard — all ACs (EVO-995)#45

Merged
dpaes merged 2 commits into
developfrom
fix/EVO-995
May 13, 2026
Merged

fix(frontend): fix agent creation UX wizard — all ACs (EVO-995)#45
dpaes merged 2 commits into
developfrom
fix/EVO-995

Conversation

@marcelogorutuba

@marcelogorutuba marcelogorutuba commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

Addresses all 5 ACs from EVO-995 and all review corrections from @daniel.paes.

AC Coverage

# AC Status
1 Role field required; selected value always in submit payload
2 Instructions field has optional AI helper (Generate / Review) ✅ (previous commit)
3 "Add tool" has inline "Create new tool" — no navigation away
4 Agent-type cards with clear differentiators in all 6 locales ✅ (previous commit)
5 Field-level validation surfaced inline in all wizard steps

Review Corrections Applied

  • AC feat: Add guided tours system with Joyride across all main sections #1: Step4_RoleGoal — role is now required; inline error + disabled Continue button prevent empty-role 500
  • AC feat: implement tour status tracking (completed/skipped) #3: CustomToolsSelectionDialog — "Create new tool" opens a sub-dialog (CustomToolForm) on top of the selection dialog, preserving wizard state; all navigate() calls removed
  • AC feat(dashboard): add inline tooltips with tour copy to all dashboard … #5: validation already existed in Steps 1, 2, 5, 6; Step 4 now covered
  • Accessibility: removed <span tabIndex> wrappers in Step5_Instructions; added aria-disabled directly on Button elements
  • Translation pt-BR/pt: "chata""conversa" in LLM card description
  • Translation consistency: Sequential → Sequencial/Secuencial/Séquentiel/Sequenziale; Parallel → Paralelo/Parallèle/Parallelo across pt-BR, pt, es, fr, it
  • Dead code: removed redundant onClick guard on Generate button in Step5
  • Tests: added Step5_Instructions.spec.tsx (5 tests) and CustomToolsSelectionDialog.spec.tsx (3 tests) — 8/8 passing
  • Story file: added _evo-output/implementation-artifacts/EVO-995-agent-creation-ux.md

Validation

  • evo-ai-frontend-community: pnpm exec tsc -b --noEmit — ✅ no errors
  • evo-ai-frontend-community: pnpm exec eslint <changed files> — ✅ no errors
  • evo-ai-frontend-community: pnpm test Step5_Instructions.spec.tsx CustomToolsSelectionDialog.spec.tsx — ✅ 8/8

Changed Files

  • src/pages/Customer/Agents/Agent/wizard/Step4_RoleGoal.tsx
  • src/pages/Customer/Agents/Agent/wizard/Step5_Instructions.tsx
  • src/pages/Customer/Agents/Agent/wizard/Step5_Instructions.spec.tsx
  • src/components/ai_agents/Dialogs/CustomToolsSelectionDialog.tsx
  • src/components/ai_agents/Dialogs/CustomToolsSelectionDialog.spec.tsx
  • src/i18n/locales/pt-BR/aiAgents.json
  • src/i18n/locales/pt/aiAgents.json
  • src/i18n/locales/es/aiAgents.json
  • src/i18n/locales/fr/aiAgents.json
  • src/i18n/locales/it/aiAgents.json
  • _evo-output/implementation-artifacts/EVO-995-agent-creation-ux.md

Linked Issue

  • EVO-995

🤖 Generated with Claude Code

- Always render AI helper buttons (Generate/Review) in Step5; disable
  with tooltip when OpenAI is not configured instead of hiding them
- Move 'Create new tool' button to dialog header in
  CustomToolsSelectionDialog so it is always visible alongside search
- Rewrite agent-type card descriptions in all 6 locales (en, pt-BR, pt,
  es, fr, it) to clearly differentiate LLM, Task, Sequential, Parallel,
  Loop and External types
- Add aiNotConfigured tooltip i18n key to all 6 locales

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented May 7, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates the agent creation wizard to always show AI helper buttons with disabled-state tooltips when AI is not configured, relocates the custom tool creation action into the tools selection dialog header, and revises i18n strings across all supported locales for clearer agent-type descriptions and an AI-not-configured tooltip message.

Sequence diagram for custom tool creation from selection dialog header

sequenceDiagram
  actor User
  participant AgentWizard
  participant CustomToolsSelectionDialog
  participant Router
  participant CustomToolsPage

  User->>AgentWizard: Open_custom_tools_selection_dialog
  AgentWizard->>CustomToolsSelectionDialog: render_dialog

  User->>CustomToolsSelectionDialog: Click_create_new_tool_button
  CustomToolsSelectionDialog->>CustomToolsSelectionDialog: onOpenChange_false
  CustomToolsSelectionDialog->>Router: navigate_agents_custom_tools
  Router->>CustomToolsPage: render_custom_tools_page
Loading

File-Level Changes

Change Details Files
Always render AI helper buttons in Step 5 and show an explanatory tooltip when AI actions are unavailable.
  • Wrap the Generate and Review buttons in Tooltip components controlled by TooltipProvider so they are always present in the UI.
  • Disable the Review button when AI actions are unavailable or a review is in progress, while still allowing focus for tooltip accessibility.
  • Disable the Generate-with-AI button and guard its onClick handler behind the AI-availability flag, keeping the tooltip accessible when disabled.
  • Introduce use of the new i18n key wizard.step5.aiNotConfigured to display the tooltip message when OpenAI is not configured.
src/pages/Customer/Agents/Agent/wizard/Step5_Instructions.tsx
Move the "Create new tool" affordance into the CustomToolsSelectionDialog header next to the search input.
  • Convert the search header container into a flex layout combining the search field and a new small outline Button.
  • Wire the new button to close the dialog via onOpenChange(false) and navigate to /agents/custom-tools.
  • Use the existing i18n key tools.customTools.create for the button label and add an inline Plus icon for visual clarity.
src/components/ai_agents/Dialogs/CustomToolsSelectionDialog.tsx
Refine agent-type descriptions and add a reusable tooltip string for missing AI configuration across all supported locales.
  • Update LLM, Task, Sequential, Parallel, Loop, and External agent-type description strings in each locale to better differentiate behaviors.
  • Add a new aiNotConfigured (or wizard.step5.aiNotConfigured) i18n key in all locales for the tooltip shown when AI helpers are unavailable.
  • Ensure key structure and naming remain consistent across en, pt-BR, pt, es, fr, and it locale files to avoid lookup errors.
src/i18n/locales/en/aiAgents.json
src/i18n/locales/pt-BR/aiAgents.json
src/i18n/locales/pt/aiAgents.json
src/i18n/locales/es/aiAgents.json
src/i18n/locales/fr/aiAgents.json
src/i18n/locales/it/aiAgents.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The aiNotConfigured tooltip logic is duplicated for both AI buttons in Step5_Instructions; consider extracting a small helper/Wrapper component or shared function to render the tooltip+trigger combo so behavior stays consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `aiNotConfigured` tooltip logic is duplicated for both AI buttons in `Step5_Instructions`; consider extracting a small helper/Wrapper component or shared function to render the tooltip+trigger combo so behavior stays consistent and easier to maintain.

## Individual Comments

### Comment 1
<location path="src/pages/Customer/Agents/Agent/wizard/Step5_Instructions.tsx" line_range="82-80" />
<code_context>
-                    </>
+                <Tooltip>
+                  <TooltipTrigger asChild>
+                    <span tabIndex={showAIActions ? undefined : 0}>
+                      <Button
+                        type="button"
+                        variant="outline"
</code_context>
<issue_to_address>
**suggestion:** Reconsider wrapping a disabled Button in a focusable span for better accessibility semantics.

The current pattern (focusable span + disabled Button + Tooltip) makes focus land on a non-control element while the actual Button is disabled, which is suboptimal for screen readers. Consider using `aria-disabled` instead of `disabled` on the Button and still gating `onClick` with `showAIActions`, so focus and semantics remain on the Button while preserving the tooltip behavior when AI actions are unavailable.

Suggested implementation:

```typescript
                <Tooltip>
                  <TooltipTrigger asChild>
                    <Button
                      type="button"
                      variant="outline"

```

```typescript
                        aria-disabled={!showAIActions}

```

```typescript
                      </Button>
                  </TooltipTrigger>

```

To fully implement the suggestion:
1. Ensure the `Button`'s `onClick` handler only triggers when `showAIActions` is true, e.g.:

   ```tsx
   onClick={showAIActions ? handleGenerateInstructions : undefined}
   ```

   or inside the handler:

   ```tsx
   const handleGenerateInstructionsClick = () => {
     if (!showAIActions) return;
     // existing logic...
   };
   ```

2. If any tests assert that the button is `disabled`, update them to check `aria-disabled` instead and verify click behavior via `showAIActions`.
</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.

Comment thread src/pages/Customer/Agents/Agent/wizard/Step5_Instructions.tsx
- Make role field required in Step4_RoleGoal: inline validation + disabled
  Continue button prevents empty role from reaching the backend (500 fix)
- Rework CustomToolsSelectionDialog: replace navigate-away with inline
  sub-dialog using CustomToolForm, preserving wizard state on create
- Fix Step5_Instructions accessibility: replace <span tabIndex> wrappers
  with aria-disabled on Button elements; remove redundant onClick guard
- Fix translation "chata" -> "conversa" in pt-BR and pt LLM card description
- Translate Sequential/Parallel labels in pt-BR, pt, es, fr, it locales
- Add Step5_Instructions.spec.tsx: 5 tests covering disabled/aria-disabled
  state per OpenAI config and Review button conditional visibility
- Add CustomToolsSelectionDialog.spec.tsx: 3 tests covering header button
  presence and inline sub-dialog open/cancel flow
- Add story file under _evo-output/implementation-artifacts/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marcelogorutuba marcelogorutuba changed the title fix(frontend): improve agent creation UX wizard (EVO-995) fix(frontend): fix agent creation UX wizard — all ACs (EVO-995) May 13, 2026

@dpaes dpaes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 2 aprovado. 4 dos 5 ACs do round 1 corrigidos com qualidade (AC1 com investigação confirmando que não existe dropdown; AC2 tooltip aria-disabled; AC3 inline sub-dialog preserva estado; AC4 traduções enriquecidas). AC5 parcial (Step4 com pattern completo; Step5 + demais viram follow-up Low). 8 testes adicionados. Detalhes completos no card Linear EVO-995. Follow-up Low aberto. Mergeando.

@dpaes dpaes merged commit 60e19ca into develop May 13, 2026
1 check passed
@dpaes dpaes deleted the fix/EVO-995 branch May 13, 2026 20:50
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