-
Notifications
You must be signed in to change notification settings - Fork 317
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
Creating a new node with the (+) button #3278
Conversation
…node-button-180887253
…node-button-180887253
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.
There is a LOT of FRP refactoring here. I'm OK with it, but I have a serious request to the tester – please test all corner cases very carefully. Go trough testing scenario – talk with Sylwia about where to find the testing scenario. You can also do the testing together with Sylwia, so she will show you how she does it (she is the most precise tester of Enso ever). Such a big refactoring of FRP requires serious testing.
|
||
// ==================== | ||
// === OccupiedArea === | ||
// =================== |
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.
missing =
|
||
/// The structure describing an occupied area. | ||
/// | ||
/// All such areas are rectangles described by x and y ranges. |
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.
x1
is start of the range and x2
is end of it? If so, add short info about it pls.
EDIT: after seeing implementation, it seems that x1
and x2
are not sorted. This needs short doc :)
} | ||
|
||
/// Return the x position of the left or right boundary, depending on whether the direction | ||
/// points leftwards of rightwards respectively. Returns `None` if direction does not point |
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 Rust the doc syntax for mentioning things is [`None`]
, not `None`
(unfortunately). Please apply in other comments too.
|
||
impl GraphEditorModelWithNetwork { | ||
pub fn new(app: &Application, cursor: cursor::Cursor, frp: &Frp) -> Self { | ||
let network = frp.network.clone_ref(); // FIXME make weak |
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.
fix left
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.
This is part of moved code, not written by me.
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.
It seems to be non-trivial to change, so I would leave the "fixme".
app/gui/view/graph-editor/src/lib.rs
Outdated
let y_gap = self.frp.default_y_gap_between_nodes.value(); | ||
let y_offset = y_gap + node::HEIGHT; | ||
let starting_point = above_pos - Vector2(0.0, y_offset); | ||
let direction = Vector2(1.0, 0.0); |
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 think it should mean "left", but (1,0)
means right – are we not searching place on the left side of currently occupied place?
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 just wanted to keep it as it was. But of course I can change to left.
app/gui/view/graph-editor/src/lib.rs
Outdated
// - area taken by node view (obviously) | ||
// - the minimum gap between nodes in all directions, so the new node won't be "glued" to | ||
// another |
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.
use either sentences or semicolons at the end of points, please.
app/gui/view/graph-editor/src/lib.rs
Outdated
@@ -2445,7 +2547,7 @@ fn new_graph_editor(app: &Application) -> GraphEditor { | |||
} | |||
|
|||
|
|||
// === Add Node === | |||
// === Nodes Utilities === |
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.
"Utilities" is the worst word IMO, as everything can be an "utility". This section will probably contain everything in the future. Do you see any better name maybe?
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.
The problem is, that I don't really get what is going on in the block below. Seems like preparing many FRP nodes, without clear theme. But surely it wasn't adding nodes.
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.
Ok, I read it more carefully, and it looks like things related to mouse cursor and clicks. So I rename it to "Mouse Interactions"
When working with the branch, I noticed a gray vertical bar near the top of the screen, where the "status bar" later shows up - should it not be there maybe? It looks a bit like it was a shadow of an empty status bar. It's visible in the screencast attached to the PR description - look in the area highlighted with a yellow circle in the image below: |
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.
A few remarks
@@ -338,6 +338,7 @@ pub fn expression_mock() -> Expression { | |||
Expression { pattern, code, whole_expression_id, input_span_tree, output_span_tree } | |||
} | |||
|
|||
// TODO[ao] This expression mocks results in panic. If you want to use it, please fix it first. |
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 don't quite understand this sentence, and also I'm not sure if we should leave in code TODOs not attached to a created issue in pivotal.
app/gui/view/src/project.rs
Outdated
|
||
committed_in_searcher <- | ||
searcher.editing_committed.map2(&last_searcher, |&entry, &s| (s.input, entry)); | ||
trace committed_in_searcher; |
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.
Probably should be removed (one more slightly below)
app/gui/view/src/project.rs
Outdated
// frp.source.old_expression_of_edited_node <+ existing_node_edited.map(f!((node_id) | ||
// model.graph_editor.model.nodes | ||
// )); |
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.
Should be removed? The output seems to be unused in the code.
Manual testing showed two regressions:
See attached video for the second issue: 2022-02-21.14-00-37.mp4 |
pub fn start_editing_new_node(&self, node_id: NodeId) { | ||
self.frp.set_node_expression.emit(&(node_id, node::Expression::default())); | ||
self.frp.edit_node.emit(&node_id); | ||
} |
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.
This function seems to be unused. Is it deliberate?
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.
No, it is not. Thanks for catching!
@akavel @vitvakatu absolutely stunning work with the testing!!! Keep it this way ❤️ |
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.
Regressions were fixed 👍🏻
[The Task](https://www.pivotaltracker.com/story/show/180887253) A new (+) button on the left-bottom corner appeared. It may be clicked to open searcher in the middle of the scene, as an alternative to tab key. https://user-images.githubusercontent.com/3919101/154514279-7972ed6a-0203-47cb-9a09-82dba948cf2f.mp4 * The window_control_buttons::common was extracted to separate crate `ensogl-component-button` almost without change. * This includes a severe refactoring of adding nodes in general in the Graph Editor. The whole responsibility of adding new nodes (and starting their editing) was moved to Graph Editor - the Project View only reacts for GE events to show searcher properly. * The status bar was moved from the bottom-left corner to the middle-top of the scene. It does not collide with (+) button, and plays "notification" role anyway. * The `interface` debug scene was buggy. The problem was with one expression's span-tree. When I replaced it, the scene works. * I've removed "new searcher" API, as it is completely outdated. * I've changed code owners of integration tests to GUI team, as it is the team writing mostly the integration tests (int rust)
[The Task](https://www.pivotaltracker.com/story/show/180887253) A new (+) button on the left-bottom corner appeared. It may be clicked to open searcher in the middle of the scene, as an alternative to tab key. https://user-images.githubusercontent.com/3919101/154514279-7972ed6a-0203-47cb-9a09-82dba948cf2f.mp4 * The window_control_buttons::common was extracted to separate crate `ensogl-component-button` almost without change. * This includes a severe refactoring of adding nodes in general in the Graph Editor. The whole responsibility of adding new nodes (and starting their editing) was moved to Graph Editor - the Project View only reacts for GE events to show searcher properly. * The status bar was moved from the bottom-left corner to the middle-top of the scene. It does not collide with (+) button, and plays "notification" role anyway. * The `interface` debug scene was buggy. The problem was with one expression's span-tree. When I replaced it, the scene works. * I've removed "new searcher" API, as it is completely outdated. * I've changed code owners of integration tests to GUI team, as it is the team writing mostly the integration tests (int rust)
* Creating a new node with the (+) button (#3278) [The Task](https://www.pivotaltracker.com/story/show/180887253) A new (+) button on the left-bottom corner appeared. It may be clicked to open searcher in the middle of the scene, as an alternative to tab key. https://user-images.githubusercontent.com/3919101/154514279-7972ed6a-0203-47cb-9a09-82dba948cf2f.mp4 * The window_control_buttons::common was extracted to separate crate `ensogl-component-button` almost without change. * This includes a severe refactoring of adding nodes in general in the Graph Editor. The whole responsibility of adding new nodes (and starting their editing) was moved to Graph Editor - the Project View only reacts for GE events to show searcher properly. * The status bar was moved from the bottom-left corner to the middle-top of the scene. It does not collide with (+) button, and plays "notification" role anyway. * The `interface` debug scene was buggy. The problem was with one expression's span-tree. When I replaced it, the scene works. * I've removed "new searcher" API, as it is completely outdated. * I've changed code owners of integration tests to GUI team, as it is the team writing mostly the integration tests (int rust) * Fix regression #181528359 * Add docs & remove unused function * Fix & enable native Rust tests * Fix formatting Co-authored-by: Adam Obuchowicz <adam.obuchowicz@enso.org> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
[The Task](https://www.pivotaltracker.com/story/show/180887253) A new (+) button on the left-bottom corner appeared. It may be clicked to open searcher in the middle of the scene, as an alternative to tab key. https://user-images.githubusercontent.com/3919101/154514279-7972ed6a-0203-47cb-9a09-82dba948cf2f.mp4 * The window_control_buttons::common was extracted to separate crate `ensogl-component-button` almost without change. * This includes a severe refactoring of adding nodes in general in the Graph Editor. The whole responsibility of adding new nodes (and starting their editing) was moved to Graph Editor - the Project View only reacts for GE events to show searcher properly. * The status bar was moved from the bottom-left corner to the middle-top of the scene. It does not collide with (+) button, and plays "notification" role anyway. * The `interface` debug scene was buggy. The problem was with one expression's span-tree. When I replaced it, the scene works. * I've removed "new searcher" API, as it is completely outdated. * I've changed code owners of integration tests to GUI team, as it is the team writing mostly the integration tests (int rust)
In this branch: * The workaround for cursor-not-being-updated-after-closing-searcher bug (discovered while testing #3278) is reverted. * The proper fix was introduced: created an abstraction for EnsoGL component, which, when dropping, will not immediately drop the FRP network and model, but instead put it into the Garbage Collector. The Collector ensures, that all "component hiding" effects and events will be handled, and drops FRP network and model only after that. * I run clippy for wasm32 target out of curiosity. There was one warning, and I fixed it on this branch.
In this branch: * The workaround for cursor-not-being-updated-after-closing-searcher bug (discovered while testing #3278) is reverted. * The proper fix was introduced: created an abstraction for EnsoGL component, which, when dropping, will not immediately drop the FRP network and model, but instead put it into the Garbage Collector. The Collector ensures, that all "component hiding" effects and events will be handled, and drops FRP network and model only after that. * I run clippy for wasm32 target out of curiosity. There was one warning, and I fixed it on this branch.
Pull Request Description
The Task
A new (+) button on the left-bottom corner appeared. It may be clicked to open searcher in the middle of the scene, as an alternative to tab key.
add-button-.5.mp4
Important Notes
ensogl-component-button
almost without change.interface
debug scene was buggy. The problem was with one expression's span-tree. When I replaced it, the scene works.Checklist
Please include the following checklist in your PR: