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

Consider using variable fields rather than text input fields - Marlowe blocks editor #71

Open
1 of 2 tasks
BeksOmega opened this issue Mar 24, 2021 · 0 comments
Open
1 of 2 tasks
Assignees

Comments

@BeksOmega
Copy link
Contributor

Diagnostic info:

  • I was using the:
    • Plutus Playground
    • Marlowe Playground
  • Link to gist with saved setup that reproduces the issue:

Description

The Marlowe text-based language requires certain values to be strings. For example, roles, parameters, and choices are all input as strings. The issue with this is that it makes it easy for users to make typos that change the meaning of their contract. I don't think there's any way to improve this situtation in the text editor, but it may be possible to improve in the blocks editor.

Blockly provides a special field called a variable field, which is normally used to represent variables, but what it actually is is a powerful way to allow the user to define identifiers.

They act like dropdowns, so it is impossible for the user to make typos when selecting identifiers.
variable-dropdown

But they differ from dropdowns in that all of the options are dynamically defined by the user (the variables page documents the common way of doing this).
variables-user-defined

They also support very powerful renaming and collision handling:
rename-variable

And they have a "type" property which can be used to create namespaces (eg separating role identifiers from choice identifiers).

I think that moving from text input fields to variable fields would make working with Marlowe a smoother, more intuitive, and less typo-prone experience.

Possible Problem

The issue with moving to variable fields is that Blockly does not provide a versioning system. So if you do things like change the name of an input, and try to deserialize XML including the old name, Blockly will fail (afaik unrecoverably). However, it seems like you peoples aren't actually storing the XML, you're storing the Marlowe representation, which means this is not a problem.

@palas palas self-assigned this May 10, 2021
@michaelpj michaelpj transferred this issue from IntersectMBO/plutus Oct 21, 2021
@nhenin nhenin transferred this issue from input-output-hk/marlowe-cardano Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants