Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Hide fromAI button in old workflow tool #13552

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

CharlieKolb
Copy link
Contributor

Summary

We show the button here even though it won't work.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-3282/bug-fromai-button-displays-on-old-workflow-tool

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@CharlieKolb CharlieKolb marked this pull request as ready for review February 27, 2025 08:10
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Feb 27, 2025
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rontend/editor-ui/src/utils/fromAIOverrideUtils.ts 93.75% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@@ -44,7 +45,8 @@ function sanitizeFromAiParameterName(s: string) {
return s;
}

const NODE_DENYLIST = ['toolCode', 'toolHttpRequest'];
// nodeName | [nodeName, highestUnsupportedVersion]
const NODE_DENYLIST = ['toolCode', 'toolHttpRequest', ['toolWorkflow', 1.2]] as const;
Copy link
Contributor

Choose a reason for hiding this comment

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

really would have loved to see this at the node description level instead of the UI. Sorry if I am repeating a conversation we already have.
What's blocking us from refactoring this to be more generic like that?

Copy link
Contributor Author

@CharlieKolb CharlieKolb Feb 28, 2025

Choose a reason for hiding this comment

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

I don't think there's significant upside here, it's not like we're gonna keep growing this list in the future. This solution works and doesn't introduce more permanent configuration flags on our node descriptions.

For handling the workflow tool for example we'd need realistically want to support the @version displayOptions syntax for a "proper" implementation.
Otherwise we'd end up with maxVersionWithFromAIUnsupported or similar?
I guess the versioned node saves us here. Begs the question if this applies in general though

In contrast we might well end up with a flag on node properties if we happen upon use cases where expressions make sense but fromAI is disallowed for whatever reason, since in that case we can expect that we'll keep adding more in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like we are already adding more nodes and might continue.
Like you suggested, we could solve this in a generic way. Maybe similar to display options.
hideFromAIButton: { lte: 1.5 } might work.
This could be a lightweight implementation, it does not need to support all possible variations of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a very finite amount of tools that don't support fromAI, and we don't intend to produce more. This seems like a lot of effort for little practical upside 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel it would be cleaner and more generic and better in touch with how n8n is supposed to be. So I guess it's more code hygiene for me here.
It's your call though.

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Feb 28, 2025

n8n    Run #9568

Run Properties:  status check failed Failed #9568  •  git commit 30ab36928f: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 CharlieKolb 🗃️ e2e/*
Project n8n
Branch Review ADO-3282
Run status status check failed Failed #9568
Run duration 05m 52s
Commit git commit 30ab36928f: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 CharlieKolb 🗃️ e2e/*
Committer Charlie Kolb
View all properties for this run ↗︎

Test results
Tests that failed  Failures 3
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 4
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 437
View all changes introduced in this branch ↗︎

Tests for review

Failed  e2e/1-workflows.cy.ts • 3 failed tests

View Output Video

Test Artifacts
Workflows > should delete all the workflows Test Replay Screenshots Video
Workflows > should respect tag querystring filter when listing workflows Test Replay Screenshots Video
Workflows > should preserve filters and pagination in URL Test Replay Screenshots Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants