-
Notifications
You must be signed in to change notification settings - Fork 30
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
Smart Connector UIExtension #308
base: master
Are you sure you want to change the base?
Conversation
…t, right, up, down)
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.
Thanks for the PR! I did just a preliminary look through the code. After the server-side compiles correctly, I will try it out and look deeper into the code.
Can you also add some description to your PR and reference the other PRs you have created, something like:
This PR is part of my bachelor research conducted in TU Wien in the [Business Informatics Group](https://www.big.tuwien.ac.at/).
---
<Little Description>
<Other PR references>
packages/client/src/features/smart-connector/smart-connector-module.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
this.createTool(item); | ||
} | ||
if (event.ctrlKey) { | ||
// matchesKeystroke with Ctrl and Ctrl+F does not seem to work on Windows 11/Chrome |
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.
Reminder to find out why afterward
@haydar-metin, unfortunately, the server cannot build because of the missing packages from this PR. Is there a way to circumvent this issue? |
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.
Thank you very much, I just tested it and reviewed the code. Largely the code looks good. There are some small requests from me. Functionality wise it looks very good! Just small remarks.
Can you also add the finished solution as an image to the PR? Similar to the images provided here.
Styling
I think visually it would be more appealing if the boxes would have a top and bottom border. Otherwise it looks like there is more.
Usage
I think in those cases nothing should be shown?
We are almost there! Good job!
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
merge newest to fork
… change Smart Connector state, added top and bottom borders to Smart Connector
UI
Can you add a listener for Other
|
Hi, how are you running the project? I am running the client and then the theia integration and there are no issues here as you can see in a similar image: |
Hey, I also tested the |
this.hideSmartConnector(); | ||
// assumes that the graph is always the last child of base div | ||
// this focus is done to "reactivate" the key listener to re-open if needed | ||
document.getElementById(this.options.baseDiv)?.last().focus(); |
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.
Since the focus is lost when the connector is closed, the KeyListener does not react to any inputs. It does also not react when any tool is selected. Because of this, I just added a onkeydown event on every tool and when it closes, it refocuses on the base div (the graph). Is this assumption here correct? Or is there a better way to get the base div?
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 not sure what you mean, why is it bad that the focus is lost when you hide the connector?
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.
Because the KeyListener does not react anymore. So if I, for example, open the connector with space, close it again with escape and then try to open it again, it won't work
@haydar-metin Hi, is there any information regarding the status of the PR? Are there any more changes to be done? |
@yentelmanero I requested a second review internally. After that, we can merge it. |
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.
In general the code looks good to me and the SmartConnector
seems to work really well.
I have a couple of inline comments/suggestions.
As we discussed offline we would prefer to drop the concept of SmartConnector
in favor of a more generic SelectionPalette
and SelectionPaletteProvider
API.
Please rename the corresponding artifacts accordingly.
Also there seems to be some room for improvements regarding the positing of the smartconnector when moving/resizing a node and scrolling/zooming:
- Scrolling/zooming: When scrolling or zooming the smart connector gets hidden although the node is still selected
- Resize: The position of the
+
button is not recentered when resizing - Moving: The smart connector gets hidden during move (which is fine imo) but is not set visible again once the move is finished. (Node is still selected)
However, these are issue that can be addressed in a follow-up PR and don't necessarily have to be covered by you.
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
packages/client/src/features/smart-connector/smart-connector.ts
Outdated
Show resolved
Hide resolved
…actions for selection palette (are now handled as onSelectionChanged listener), moved SelectionPaletteState and action to new file, removed HTMLElement extensions
Hi @tortmayr, thanks for the feedback. I changed the code snippets as requested and also added that the selection palette does not disappear when panning and zooming, since that changed seemed simple enough to do it relatively quickly. Since I changed quite a bit of code there, because I am not using the DOM measurements anymore but the Viewport and GNode data, I would ask you to please review those parts once again. The reason I changed that is because element.getBoundingClientRect() was too slow in delivering the needed information, so I would calculate with the old frame, while already showing a new frame, resulting in wrong behaviour when zooming. I am also not entirely sure if the way I added the explicit module imports (for both workflow-standalone and workflow-theia) was done correctly, but it worked after I added those and it did not before. |
Update: now also added the selection palette moving when resizing or moving nodes, since I could not find an explanation why I did not do it when writing my thesis. Please review |
@yentelmanero We will keep this PR open and merge it after the 2.2.0 Release is done (end of May). This way we have a full release cycle to polish the feature and address follow-up issues before we are shipping it to adopters. In any case, from our side this concludes the practical aspect of your bachelor thesis. We don't require/desire any more changes from your side. Congrats! |
This PR is part of my bachelor research conducted in TU Wien in the Business Informatics Group.
In this PR, the Smart Connector UIExtension, which is a Tool that hovers around the selected node, simplifying the creation of new nodes and edges, was created.
Here are some screenshots of the UIExtension:
(different types of nodes can have different options)
Server PR
Theia PR