Skip to content

Commit

Permalink
Fix missing visualization preview in CB (#5757)
Browse files Browse the repository at this point in the history
Closes #5639

This PR fixes a regression introduced in #4120, due to which new nodes that were being edited had an empty visualization preview. Now newly created visualization containers do get a default visualization set even before the visualization's input type is set.

https://user-images.githubusercontent.com/117099775/221256294-c87a50da-c8b0-4f00-bf84-f5ae551fca72.mp4
  • Loading branch information
galin-enso authored Feb 27, 2023
1 parent ba3d45e commit b8ceaec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
- [The component browser suggestions take into account entry aliases][5678]. The
searcher input is now matched to entry aliases too. The alias match is used to
filter and sort component browser entries.
- [Fixed missing result preview when editing nodes.][5757]

#### EnsoGL (rendering engine)

Expand Down Expand Up @@ -500,6 +501,7 @@
[5699]: https://github.com/enso-org/enso/pull/5699
[5719]: https://github.com/enso-org/enso/pull/5719
[5721]: https://github.com/enso-org/enso/pull/5721
[5757]: https://github.com/enso-org/enso/pull/5757

#### Enso Compiler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,14 @@ impl Container {
eval_ frp.toggle_visibility (model.toggle_visibility());

visualisation_uninitialised <- frp.set_visualization.map(|t| t.is_none());
set_default_visualisation <- frp.set_vis_input_type.gate(&visualisation_uninitialised).unwrap();
default_visualisation <- set_default_visualisation.map(f!((tp) {
default_visualisation <- visualisation_uninitialised.on_true().map(|_| {
Some(visualization::Registry::default_visualisation())
});
vis_input_type <- frp.set_vis_input_type.gate(&visualisation_uninitialised).unwrap();
default_visualisation_for_type <- vis_input_type.map(f!((tp) {
registry.default_visualization_for_type(tp)
}));
default_visualisation <- any(&default_visualisation, &default_visualisation_for_type);

eval frp.set_data ((t) model.set_visualization_data(t));
frp.source.size <+ frp.set_size;
Expand Down

0 comments on commit b8ceaec

Please sign in to comment.