Git Product home page Git Product logo

elyra-ai / pipeline-editor Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 18.0 3.66 MB

Common pipeline-editor components used in different clients (e.g. Elyra application, Web browser extensions, etc)

Home Page: https://elyra.readthedocs.io/

License: Apache License 2.0

JavaScript 1.86% Makefile 0.20% TypeScript 96.22% Python 1.70% MDX 0.03%
ai airflow apache-airflow kubeflow-pipelines machine-learning pipeline pipeline-editor

pipeline-editor's People

Contributors

ajbozarth avatar akchinstc avatar bourdakos1 avatar dependabot[bot] avatar fresende avatar karlaspuldaro avatar lresende avatar marthacryan avatar ptitzler avatar rachaelhouse avatar vna818-rpi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pipeline-editor's Issues

Only highlight object key when missing field

Currently, the language server highlights the entire object when missing a property value. We should only highlight the key so it's less distracting.

Do this:

"key": { 
   "key": "value",
   "key": "value",
   "key": "value"
}

instead of this:

"key": { 
   "key": "value",
   "key": "value",
   "key": "value"
}

Label bug

When the filename is not undefined, but is an empty string, it uses the filename instead of falling back to the default label

Serialization preprocessing

We should do some preprocessing before we serialize property values.

Examples

Number:

  • "123" -> 123
  • "1.23e2" -> 123
  • "123.00" -> 123
  • "" -> undefined
  • " " -> undefined
  • "one" -> undefined

String:

  • "" -> undefined
  • " " -> undefined
  • " hello " -> " hello "

Issue

If we clean data before storing, we run into problems. This is because there is a 1-to-1 binding between data and UI. A change to the data changes the ui and vice-versa. Take number serialization as an example:

user types: "1", 1 is stored, ui updates to render "1"
user types: "12", 12 is stored, ui updates to render "12"
user types: "12.", 12 is stored, ui updates to render "12"

oh no we can't type decimals because string -> number is a lossy conversion!

Solution

We will need to introduce a new data binding model that uses a local state to track what the user has actually typed so far, so we don't blow away whatever they are inputting every key press.

Only use local state when input control is focused, when blurred clear local state and show actual data

Update StringArrayControl to handle plain lists

Currently, string array properties in a pipeline file are just a plain array of strings. However, we need stable IDs for our string/file array form control to safely render/edit values. This is a breaking change, so we need to increment the current pipeline version from 3 to 4.

Put more thought into the context menus

current context menus:

background:

New comment
Select All
-----------------
Edit > Cut
       Copy
       Paste
-----------------
# Undo
# Redo
-----------------
# Unhighlight

Node:

Disconnect
-----------------
Edit > Cut
       Copy
-----------------
Delete
-----------------
Create supernode
-----------------
Highlight > Highlight Branch
            Highlight Upstream
            Highlight Downstream
            -----------------
            # Unhighlight
Open File
Properties

Link:

Delete

Comment:

Disconnect
-----------------
Edit > Cut
       Copy
-----------------
Delete
-----------------
Create supernode

Small issues:

  • There is a mix of casing style One two three vs One Two Three
  • There seems to be no logic of when an item is completely hidden vs disabled
  • There doesn't seem to be a lot of logic behind the dividers, some things are grouped that don't make sense (highlight, open file, properties) where most of the time there is a divider between everything.
  • Context menus don't disappear on blur

Questions:

  • Is the highlight menu useful? I didn't realize what it did until today. I always thought it had something to do with git so I just ignored it. Additionally, I would assume highlighting something would act as selection, but highlighting a branch and then deleting only deletes the selected node, not the highlight. I motion to delete this menu in vscode release to see if it's something people actually want, because to me, it just adds confusion.
  • Do we need the three dot button on the nodes? It seems to do the exact same thing as right click? Is there an accessibility reason? If so why don't we have the same on links, comments, etc...

Suggestions:

  • Remove Undo, Redo, Select All. These types of actions normally live in an edit menu or toolbar
  • Remove the overflow for Edit, this should just be a group of Cut, Copy, Paste
  • Remove most of the dividers, the only divider should probably be the edit group. I think a good rule of thumb should be if you can't think of a generic name for the group it shouldn't have a divider (in most cases there shouldn't be groups of one item, because then the divider just creates noise, but there can be exceptions to this rule)

Jupyter vs VSCode

Jupyter:

  • uses their own context menu ui
  • uses icons to the left for a lot of menu items
  • has keyboard shortcut to the right
  • never uses dividers
  • rarely uses an overflow menu

VSCode:

  • uses system context menu, but doesn't expose the API to custom web editor views
  • uses dividers sparingly
  • rarely uses an overflow menu

Make file extensions an array

currently the file extension option for a file is a single file extension, but this should be an array

blocked by open PRs

Add support for number fields in property editor

Currently number fields can be added to the parameter definition of nodes, but the style is not quite right and the value doesn't save when edited. Maybe there should be a custom form control?

Add error description to properties

VS Code example:
image

Note: VS Code does not persist invalid values. For example, if the valid was 14 and you typed 130 the persisted value would be 13. Currently, this won't work with the fully controlled/data driven nature of our forms. If 130 isn't persisted we wouldn't be able to type 130. We would have to create a custom component with an error state that tracks the invalid value. Something like:

const [value, setValue] = useSelector() // 13
const [invalidValue, setInvalidValue] = useState() // 130

...

<input value={invalidValue ?? value} />

Add more cypress tests

We only have a placeholder cypress test at the moment. Write some more thorough integration tests

create a pipeline utilities package

For two main reasons:

  1. When an out-of-date pipeline is opened a notification is shown, asking if they want to migrate. The migration will only happen if the pipeline is the active editor. We should probably move the migration code to the backend so the migration action will happen regardless.
  2. For vscode we will need to build a language server to surface any pipeline issues.

Error handling

onError should be a callback with a signature of (title, body) => any so we have consistent copy across platforms

Use classnames for all styling

Make sure everything is styled by a classname so that the ui can be properly themed for their environments

  • pipeline
  • right panel
    • tabs
    • common properties
    • palette

String input should be trimmed before checking validity

Currently, simple string inputs aren't being trimmed, for example typing "     " is considered non-empty. We should use value.trim() === "" instead of value === "", This is more consistent with our string array inputs

Pipeline file should not persist invalidNodeError

	'pipelines': [{
		'id': '4170cd75-f40f-4417-a750-c8f9e2c32590',
		'nodes': [{
			'id': '0bc1f5db-daf2-4854-b524-4c77b9ac6e85',
			'type': 'execution_node',
			'op': 'execute-notebook-node',
			'app_data': {
				'filename': 'elyra-pipelines-sandbox/dashboard.ipynb',
				'runtime_image': 'continuumio/anaconda3:2020.07',
				'invalidNodeError': None,
				'ui_data': {
					'label': 'dashboard',
					'image': 'data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20viewBox%3D%220%200%2022%2022%22%3E%0A%20%20%3Cg%20class%3D%22jp-icon-warn0%20jp-icon-selectable%22%20fill%3D%22%23EF6C00%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M18.7%203.3v15.4H3.3V3.3h15.4m1.5-1.5H1.8v18.3h18.3l.1-18.3z%22%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M16.5%2016.5l-5.4-4.3-5.6%204.3v-11h11z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A',
					'x_pos': 465,
					'y_pos': 239,
					'description': 'Notebook file'
				}

File based nodes thoughts

  • We should validate that the file exists, how often? Do we need to watch the file somehow?
  • Should we change the file label to just be the basename? xxx.ipynb feels a bit noisy...
  • If a file is renamed should the node's file path also be updated?

Validate path of file field for nodes with filehandler parameter refs

This might be challenging to do. In order to enable this feature we would need to:

  1. Delegate verification of the file path to the caller of pipeline-service/validate which would need to be bubbled higher in the case of usage in pipeline-editor
  2. Set up file watchers to retrigger validation when file paths change

[VS Code] Make it more clear on how to add nodes to canvas

As an existing JupyterLab user:

  • One would expect to be able to drag a file onto the canvas from the left file panel (not possible in VS Code)
  • They might already have a pipeline file from JupyterLab so an empty canvas message won't help here
  • Since they are a current user, they might not be following along with any documentation/tutorials

As a new user:

  • Have no habits from other elyra platforms
  • More likely to have an new pipeline so they would see a help text on the empty canvas
  • Might be following along with documentation/tutorial with instructions on how to add nodes

Add a settings props for customization

We have a few established user experiences that are either too "opinionated" or too established to modify. We should introduce settings to test out alternatives. Some examples:

  • file extensions: This is 100% a user preference. The user should be able to decide if they want to show the full file name example.ipynb or the name without the extension example. (default: show file extension)
  • double click behavior: Double clicking on a file opens a node, but this is arguably not the best for various reasons (not all nodes have a file tied to them, clicking on a node changes the active properties, opening a flyout panel is an established pattern in other products, etc...). However, current Elyra users may be too accustomed to it opening a file. The user should be able to decide whether double click opens properties or opens the file. (default: open properties)
  • scroll to zoom: The user should be able to decide whether or not the canvas will zoom in/out when scrolling, this behavior might not be used by many and the effect of an accidental scroll can be a bit jarring for some users. (default: disabled)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.