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): Inline expression editor #4814

Merged
merged 85 commits into from
Dec 14, 2022
Merged

feat(editor): Inline expression editor #4814

merged 85 commits into from
Dec 14, 2022

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Dec 5, 2022

image

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Dec 5, 2022
* ⚡ Extract `ExpressionFunctionIcon`

* ⚡ Simplify syntax

* ⚡ Move to mixin

* 🎨 Format

* 📘 Unify types

* ⚡ Dedup double brace handler

* ⚡ Consolidate resolvable highlighter

* 🎨 Format

* ⚡ Consolidate language pack

* ✏️ Add comment

* ⚡ Move completions to plugins

* ⚡ Partially deduplicate themes
…4846)

* 🎨 Adjust styling for expression parameter input

* 🎨 Style outputs differently

* ⚡ Set single line for RLC

* 🎨 Style both openers identically

* 🐛 Prevent defocus on resize

* ⚡ Adjust line height
@@ -40,6 +40,7 @@
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/vue-fontawesome": "^2.0.2",
"axios": "^0.21.1",
"codemirror-lang-n8n-expression": "^0.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we publish this under n8n? so @n8n_io/codemirror-expression-lang maybe?

Copy link
Contributor Author

@ivov ivov Dec 13, 2022

Choose a reason for hiding this comment

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

Moving story to P3, should not block release. Btw codemirror-lang-* is the convention.

packages/editor-ui/src/Interface.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/mixins/telemetryUtils.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/components/NDVDraggablePanels.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/ParameterInput.vue Outdated Show resolved Hide resolved
>
<ExpressionFunctionIcon />
</div>
<InlineExpressionEditorInput
Copy link
Contributor

Choose a reason for hiding this comment

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

reminder to switch to kebab case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is what I wanted and argued for and was overruled on because guidelines say the opposite.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

ops my bad sorry.. this is good :)

this.$emit('focus');
},
getPaneWidth() {
const key = [LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH, this.currentNodePaneType].join('_');
Copy link
Contributor

Choose a reason for hiding this comment

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

you can see another approach of how to set this here, which might a little better https://github.com/n8n-io/n8n/blob/master/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue#L433

Copy link
Contributor Author

@ivov ivov Dec 13, 2022

Choose a reason for hiding this comment

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

The only purpose of tracking pane width was to prevent blur on resize, but seeing as this requires adding to state, watching, comparing to prior width, and possible issues with NDV-to-NDV jumps, I refactored this to rely only on the presence of the resizer class. This no longer tracks anything and does not fire events on resize, which also (apparently?) even makes dragging to resize snappier than before because we are no longer triggering state changes. Let me know what you think.


Vue.component('ExpressionFunctionIcon', ExpressionFunctionIcon);

export default Vue.extend({
Copy link
Contributor

Choose a reason for hiding this comment

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

forgot yesterday.. not must now that you have already implemented this.. but would be great if you can use the composition api for new components..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally best to start simpler and smaller in future. Unfamiliar with composition API so not trivial to refactor all this now.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes for new components please use composition api

mutdmour
mutdmour previously approved these changes Dec 14, 2022
packages/editor-ui/src/components/RunDataSchema.vue Outdated Show resolved Hide resolved
@ivov ivov merged commit a125989 into master Dec 14, 2022
@ivov ivov deleted the inline-expression-editor branch December 14, 2022 13:43
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Dec 14, 2022
MiloradFilipovic added a commit that referenced this pull request Dec 14, 2022
* master:
  ci: Block all external network calls in tests (no-changelog) (#4930)
  feat: Update workflow overwriting message (#4917)
  feat(editor): Update user management setup message when sharing is disabled (#4928)
  feat(editor): Inline expression editor (#4814)
  fix: Update permission for showing workflow caller policy (#4916)
  feat: Update last credential accessor removal message (no-changelog) (#4925)
  feat: Update credential sharing messages (no-changelog) (#4927)
  fix: Improve VSCode debugging setup (no-changelog) (#4922)
@janober
Copy link
Member

janober commented Dec 16, 2022

Got released with [email protected]

@janober janober removed the Upcoming Release Will be part of the upcoming release label Dec 16, 2022
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.

3 participants