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

feat(editor): Easy $fromAI Button for AI Tools #12587

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

Conversation

CharlieKolb
Copy link
Contributor

@CharlieKolb CharlieKolb commented Jan 13, 2025

Summary

Introduce infrastructure for parameterInputs to have overrides and provide an $fromAI override button for applicable fields in tools.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-3034/feature-add-fieldoverride-functionality-to-parameterinputfull

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)

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 13, 2025
packages/editor-ui/src/components/AiStarsIcon.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/AiStarsIcon.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/AiStarsIcon.vue Outdated Show resolved Hide resolved
@@ -1505,7 +1551,14 @@ onUpdated(async () => {
<InlineExpressionTip />
</div>
</div>

<div
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to only render this wrapper div if there's a slot

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 some reason the slot exists even if the v-if condition for its template provider is not met:

<template v-if="showOverrideButton && isSingleLineInput" #overrideButton>

even with this $slots.overrideButton is truthy :/

packages/editor-ui/src/components/ParameterInputFull.vue Outdated Show resolved Hide resolved
};
}

const isContentOverride = computed(() => isOverrideValue(props.value?.toString() ?? ''));
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - typo isContentOverriden

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, this is meant as "is (a) Content Override.", not "is (this) content overridden?". Definitely want a better name here

@@ -90,6 +91,7 @@ type Props = {
hideIssues?: boolean;
errorHighlight?: boolean;
isForCredential?: boolean;
canBeOverride?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this prop? Can we simply check if the slot is set or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not for the edge case where we have the button in the options above, but need a 90deg top right corner for the (multi-line) expr editor

packages/editor-ui/src/components/ParameterInputFull.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/ParameterInputFull.vue Outdated Show resolved Hide resolved
packages/workflow/src/TelemetryHelpers.ts Outdated Show resolved Hide resolved
packages/workflow/src/TelemetryHelpers.ts Outdated Show resolved Hide resolved
packages/workflow/src/TelemetryHelpers.ts Show resolved Hide resolved
packages/workflow/src/TelemetryHelpers.ts Outdated Show resolved Hide resolved
@CharlieKolb CharlieKolb changed the title feat(editor): Easy $fromAI Button for Agent Tools feat(editor): Easy $fromAI Button for AI Tools Feb 4, 2025
mutdmour
mutdmour previously approved these changes Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

Copy link

cypress bot commented Feb 4, 2025

n8n    Run #9123

Run Properties:  status check passed Passed #9123  •  git commit 972928c12c: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 CharlieKolb 🗃️ e2e/*
Project n8n
Branch Review ADO-3034
Run status status check passed Passed #9123
Run duration 04m 56s
Commit git commit 972928c12c: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 CharlieKolb 🗃️ e2e/*
Committer Charlie Kolb
View all properties for this run ↗︎

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

Copy link
Contributor

github-actions bot commented Feb 4, 2025

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

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Copy link
Contributor

github-actions bot commented Feb 4, 2025

✅ All Cypress E2E specs passed

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.

4 participants