-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Execute Script V2 - UX #15461
base: execute-script-v2
Are you sure you want to change the base?
Execute Script V2 - UX #15461
Conversation
…script-v2-frontend
…script-v2-frontend
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
…script-v2-frontend
…script-v2-frontend
…ready. Passing uninitialised stores to the derived store was causing issues
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
…ly. Rows were being misrepresented as 'Multi Select'
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
…script-v2-frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work Dean - this is a massive improvement. It worked flawlessly and passed all my checks:
- All bindings work
- Helpers work
- Snippets work
- Full evaluation context
I've noted a few minor code things but nothing major.
One question I do have - it looks like you made changes to the existing binding panels, but then ended up making your own one (CodeEditorField)? Was it not possible to reuse the existing components for this use case? It's totally fine if not, I just noticed there's a fair bit of duplication between BindingPanel and CodeEditorField which might make maintenance harder in future.
@@ -140,6 +144,7 @@ | |||
? [hbAutocomplete([...bindingsToCompletions(bindings, codeMode)])] | |||
: [] | |||
|
|||
// TODO: check if it inputData != newInputData (memo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if these are done and left in by accident, or still need done, so just flagging them!
@@ -156,6 +161,7 @@ | |||
} | |||
|
|||
const setDefaultEnumValues = () => { | |||
// TODO: Update this for memoisation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
@@ -71,6 +69,10 @@ | |||
let expressionError: string | undefined | |||
let evaluating = false | |||
|
|||
// Ensure these values are not stale | |||
$: jsValue = initialValueJS ? value : null | |||
$: hbsValue = initialValueJS ? null : value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little apprehensive about this change just because it's so core, but I can't see any immediate issues with it. Right now this component is intended to be in charge of it's own value after mounting, which is why none of the initial value variables here are dynamic.
I'm not actually sure how this makes a difference, because initialValueJS
itself is not reactive and is only set once on mount, so I can't see how making the assignment of jsValue
and hbsValue
reactive would change functionality. They would re-evaluate when value
changes (but they are also updated by the component itself further down on chance), probably causing a wasted double update, but they reference initialValueJS
which means they could potentially incorrectly set a JS value into HBS and vice versa if the current mode is different to the initial mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aptkingston and I discussed this and decided that the more appropriate approach to this was to better manage the state on blur for the editor field, rather than make a global change to the reactivity of the base editor values.
Updated behaviour: #15545
Thanks again for taking a look! Yep, regarding the |
…omponent to ensure they are kept in sync
Pull out new code editor field and drawer bindable slot into single component
…script-v2-frontend
…script-v2-frontend
Description
UX updates to accomodate the new version of the
JavaScript
automation type.JavaScript
step type (EXECUTE_SCRIPT2
)CodeEditorField
- extracted theCodeEditor
UX from deep with theBindingPanel
so that it can be used as a standalone UX. Supports JS only for the momentCodeEditor
in theBindingPanel
entirely. That is beyond the scope of this ticket.Update Row
binding UX switched back from modal to drawer mode to keep it in line with the other steps.Trigger
,User
,Step
andSettings
data. When selecting a suggestion in the dropdown, it will display any available data in the UI!JavaScript
(EXECUTE_SCRIPT
) step has been deprecated. Any automations still using the legacy step will function as before and no action is required.Fixes
Fix
- Binding icons inAttachment|Signature
drawers were all defaulted toShareAndroid
. They reflect the correct category now.Fix
- Timing issue with the Bindable drawer across the builder.CodeEditor
would get stuck with the initiating value. This caused a timing issue for all bindable inputs if they had an "update on blur" UX.Fix
- Added support for using spaces when configuring fields forApp Action
triggers. This has been an annoyance for a while.My field
encodes astrigger.fields.[My field]
and is displayed astrigger.fields.My field
.Fix
- Blurring a field name input in anApp Action
step, without altering it, would trigger an empty update and throw an errorFix
- Webhooks that have no test data would throw errors when modifying.Fix
- Minor adjustment to theApp Action
trigger field UX adding a little flexibility when configuringFix
- Addedtable
parameter to theRow action
in the test endpoint as it was missing from the test results.Fix
- Automation icons panel was displaying the incorrect icons. The list would display the icon associated with the first automation in the group. Now they reflect their corresponding automation definition typesFix
- Row types mislabelled as 'Multi select' in the bindings drawer.Addresses
Screenshots
JavaScript V2 UX. The code is directly visible and editable in the step, with suggestions and snippets . Suggestions will also render/evaluate any data in your test results or some default data
![Screenshot 2025-01-31 at 14 44 14](https://private-user-images.githubusercontent.com/5913006/408606851-472975d8-1ad4-4fd7-ab23-1beb6e7d6ddc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjQ1NjIsIm5iZiI6MTczOTU2NDI2MiwicGF0aCI6Ii81OTEzMDA2LzQwODYwNjg1MS00NzI5NzVkOC0xYWQ0LTRmZDctYWIyMy0xYmViNmU3ZDZkZGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMjAxNzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YThhZDZjNGNhZDRmOWNkM2RkZTE2MjgzNzEwOTA3NjczNGU4YWI2M2MzOGRkM2M5YjJlM2VkNjc4OGRkZjM4OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.I_0OKfd3wiTIre-PcLlkaeRQDZaS3HJG5rYGfJYGfLc)
Live binding evaluation in all fields!
![Screenshot 2025-01-31 at 14 49 54](https://private-user-images.githubusercontent.com/5913006/408608459-63745815-1933-4b69-b417-a5ca823b4321.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjQ1NjIsIm5iZiI6MTczOTU2NDI2MiwicGF0aCI6Ii81OTEzMDA2LzQwODYwODQ1OS02Mzc0NTgxNS0xOTMzLTRiNjktYjQxNy1hNWNhODIzYjQzMjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMjAxNzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2ZmYWY5NDZjOWMwOTVhZGMwMDYzMjU4YmY3MTIxOTI3ZTJkZmY4MDM2YmJkYWJhYzRjOTE5YTA0YTUzMDlmZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.HGSO-7aQ03KM_zrVMueh_sv8wKU9hm4OXpFqfk7W7FU)
Launchcontrol
Automation Execute Script V2 and general Automation fixes
Feature branch env
Feature Branch Link