Skip to content

fix: Remove conditional rendering from Build with AI button#2078

Open
everettbu wants to merge 1 commit intomasterfrom
fix-build-with-ai-unconditional-render
Open

fix: Remove conditional rendering from Build with AI button#2078
everettbu wants to merge 1 commit intomasterfrom
fix-build-with-ai-unconditional-render

Conversation

@everettbu
Copy link
Copy Markdown

Mirror of n8n-io/n8n#20879
Original author: Ajmalshk04


Summary

This PR removes the conditional highlighting logic from the "Build with AI" button in the canvas choice prompt, making it render consistently without depending on the chat window state.

Changes Made

  1. Removed unnecessary imports: Removed the computed import from Vue since it's no longer needed
  2. Removed conditional logic: Removed the isChatWindowOpen computed property that was tracking chat panel state
  3. Simplified template: Changed the Build with AI button's class binding from [$style.selectedButtonHighlight, { [$style.highlighted]: isChatWindowOpen }] to just $style.selectedButtonHighlight

Benefits

  • The "Build with AI" button now renders consistently without any conditional visual states
  • Simplified code by removing unnecessary computed property and reactive dependencies
  • Button functionality remains unchanged - it still opens the AI chat panel when clicked
  • Maintains the same visual appearance as before, just without conditional highlighting

Testing

  • The button still functions correctly when clicked
  • No conditional highlighting based on chat window state
  • Consistent rendering across different application states

File Changed

  • packages/frontend/editor-ui/src/features/canvas/components/elements/nodes/render-types/CanvasNodeChoicePrompt.vue

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)
  • This change requires a documentation update

This change removes the conditional highlighting logic from the 'Build with AI' button, making it render consistently without depending on the chat window state.

Changes:
- Removed the `computed` import from Vue
- Removed the `isChatWindowOpen` computed property
- Simplified the Build with AI button's class binding to remove conditional highlighting
@everettbu everettbu added community Authored by a community member in linear Issue or PR has been created in Linear for internal review labels Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Authored by a community member in linear Issue or PR has been created in Linear for internal review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants