Opened 6 years ago

Closed 5 years ago

#5337 closed defect (fixed)

Cannot switch to Text View if preferredView="info" is selected

Reported by: Christian Kral <dr.christian.kral@…> Owned by: adeas31
Priority: high Milestone: 1.14.0
Component: OMEdit Version:
Keywords: Cc: Andrea.Bartolini, ceraolo

Description

Consider the following test model:

within ;
model Test
  annotation (
    preferredView="info",
    uses(Complex(version="3.2.2"), Modelica(version="3.2.2")),
  Documentation(info="<html>
  <p>Here starts the documentation</p>
</html>"));
end Test;

If I load this model in OpenModelica and I make a double click on it, the documentation is shown as expected. I can, however, not see the underlying code. When I apply a double click on Text View, the source code is not shown. From this point on I cannot edit the Modelica code of the model any more...

Change History (9)

comment:1 Changed 6 years ago by adeas31

You know that you can right click the model and choose View Text.

comment:2 follow-up: Changed 6 years ago by casella

See #4967.

Apparently, I'm not the only one to find the current behaviour to be counterintuitive :)

I still think that the most obvious behaviour for the GUI would be that if I double click on a package that has preferredView="info" the documentation layer should be of course displayed, but if I then click on the Text View button, the text should be displayed. The fact that I select the library and the Text View and the text does not become visible is very odd - it looks like OMEdit is trying to hide something, or just like a plain bug.

Please note this is relevant for library developers (as myself and Christian). End users probably won't bother.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 6 years ago by adeas31

Replying to casella:

See #4967.

Apparently, I'm not the only one to find the current behaviour to be counterintuitive :)

I still think that the most obvious behaviour for the GUI would be that if I double click on a package that has preferredView="info" the documentation layer should be of course displayed, but if I then click on the Text View button, the text should be displayed.

Well there is no text view button in that case. We only open the documentation layer, the diagram/text layer is not shown if preferredView="info" is set.

The fact that I select the library and the Text View and the text does not become visible is very odd - it looks like OMEdit is trying to hide something, or just like a plain bug.

That is not the case. If the diagram layer (or the text view button) is visible then clicking on it does show the text view. The problem here is that we don't open the diagram layer instead we just show the documentation layer and many users find it difficult to understand how to open the diagram layer in that case. This is exactly what has been discussed in #2249 and #4967. And to address this issue we added the context menu items which allows to open the diagram layer regardless of the preferredView annotation.

Please note this is relevant for library developers (as myself and Christian). End users probably won't bother.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 6 years ago by casella

  • Cc Andrea.Bartolini ceraolo added

Replying to adeas31:

Replying to casella:

See #4967.

Apparently, I'm not the only one to find the current behaviour to be counterintuitive :)

I still think that the most obvious behaviour for the GUI would be that if I double click on a package that has preferredView="info" the documentation layer should be of course displayed, but if I then click on the Text View button, the text should be displayed.

Well there is no text view button in that case.

Of course there is one, it simply refers to the previously opened class that didn't have preferredView="info". If I click on the text view button, I still see the text of that previously opened class.

We only open the documentation layer, the diagram/text layer is not shown if preferredView="info" is set.

True, but if you don't close the text layer view of the previously selected class, you'll still see it, and the whole thing looks inconsistent. I guess we already discussed this in #4983, I find the idea that the documentation layer and the text/diagram view that are visible at some point may refer to two different classes extremely confusing.

At any time the text/diagram view has four visible buttons: icon, text, diagram, and documentation. One would expect that by clicking on them, I can see different aspects of the same model. The fact that the documentation browser lives an autonomous looks odd to me. I'm not sure if others share this feeling, though. @christiankral, would you like to comment?

The fact that I select the library and the Text View and the text does not become visible is very odd - it looks like OMEdit is trying to hide something, or just like a plain bug.

That is not the case. If the diagram layer (or the text view button) is visible then clicking on it does show the text view. The problem here is that we don't open the diagram layer instead we just show the documentation layer and many users find it difficult to understand how to open the diagram layer in that case.

IMHO, the problem here is that even if you select a new class, you keep on seeing the text/diagram view of the previously selected one. This is very confusing. Steps to reproduce:

  • Expand the libraries browser tree to Modelica.Blocks.Examples.PIDController
  • Double-click on it: the diagram of the controller shows up
  • Double-click on User's Guide (that has the preferredView annotation): the User's Guide shows up in the Documentation Browser, but the controller diagram is still there
  • Click on the text view: the text of the controller model is shown.

I would find it a lot more intuitive to get this behaviour

  • Expand the libraries browser tree to Modelica.Blocks.Examples.PIDController
  • Double-click on it: the diagram of the controller shows up
  • Double-click on User's Guide (that has the preferredView annotation): the User's Guide shows up in the Documentation Browser, and the diagram view goes blank (because of the preferredView annotation)
  • Click on the text view: the text of the User's Guide class shows up in the text view
Last edited 6 years ago by casella (previous) (diff)

comment:5 Changed 6 years ago by Andrea.Bartolini

I agree with Francesco, is very confusing to mix the diagram/text view of one model and the documentation of another model, and also it may be dangerous, because one can be erroneously edit a model which is not consistent with the shown documentation.

The solution proposed by Francesco works fine for me.

comment:6 in reply to: ↑ 4 Changed 6 years ago by Christian Kral <dr.christian.kral@…>

Replying to casella:

Replying to adeas31:

Replying to casella:

See #4967.

Apparently, I'm not the only one to find the current behaviour to be counterintuitive :)

I still think that the most obvious behaviour for the GUI would be that if I double click on a package that has preferredView="info" the documentation layer should be of course displayed, but if I then click on the Text View button, the text should be displayed.

Well there is no text view button in that case.

Of course there is one, it simply refers to the previously opened class that didn't have preferredView="info". If I click on the text view button, I still see the text of that previously opened class.

We only open the documentation layer, the diagram/text layer is not shown if preferredView="info" is set.

True, but if you don't close the text layer view of the previously selected class, you'll still see it, and the whole thing looks inconsistent. I guess we already discussed this in #4983, I find the idea that the documentation layer and the text/diagram view that are visible at some point may refer to two different classes extremely confusing.

At any time the text/diagram view has four visible buttons: icon, text, diagram, and documentation. One would expect that by clicking on them, I can see different aspects of the same model. The fact that the documentation browser lives an autonomous looks odd to me. I'm not sure if others share this feeling, though. @christiankral, would you like to comment?

As a library developer it appears more "natural" to me to NOT have an extra documentation browser window, as I also consider Icon View, Text View, Diagram View and Documentation View as four different aspects of the same model. However, as a user it makes more sense to have an extra Documentation View, as it may be helpful to see the documentation about a library model while working on a user model. So as a library developer I have no strong opinion against the separate documentation window which may show content independent of the model I am working on.

The fact that I select the library and the Text View and the text does not become visible is very odd - it looks like OMEdit is trying to hide something, or just like a plain bug.

That is not the case. If the diagram layer (or the text view button) is visible then clicking on it does show the text view. The problem here is that we don't open the diagram layer instead we just show the documentation layer and many users find it difficult to understand how to open the diagram layer in that case.

IMHO, the problem here is that even if you select a new class, you keep on seeing the text/diagram view of the previously selected one. This is very confusing. Steps to reproduce:

  • Expand the libraries browser tree to Modelica.Blocks.Examples.PIDController
  • Double-click on it: the diagram of the controller shows up
  • Double-click on User's Guide (that has the preferredView annotation): the User's Guide shows up in the Documentation Browser, but the controller diagram is still there
  • Click on the text view: the text of the controller model is shown.

I agree with Francesco that this behavior is not very intuitive and error prone, as misleading information may be displayed.

For a Modelica class with preferredView="info" the context menu shows the entries View Icon, View Diagram, View Text and View Documentation. If I click on one of these menu items the underlying view is displayed, as expected. The buttons Icon View, Diagram View, Text View and Documentation View do not appear. On my opinion the two aspects View Text and Text View appear a little bit like a text riddle... For a normal Modelica class without preferredView="info" View Text and Text View do the very same: they display the text view of a Modelica class.

I would find it a lot more intuitive to get this behaviour

  • Expand the libraries browser tree to Modelica.Blocks.Examples.PIDController
  • Double-click on it: the diagram of the controller shows up
  • Double-click on User's Guide (that has the preferredView annotation): the User's Guide shows up in the Documentation Browser, and the diagram view goes blank (because of the preferredView annotation)
  • Click on the text view: the text of the User's Guide class shows up in the text view

I very much agree with this proposal. In this case the context menu View ... and the button ... View should always cause the same behavior. In this case the context menu could even be changed to ... View to avoid the riddle character of the different nameings.

comment:7 follow-up: Changed 5 years ago by adeas31

Well I can sync the Documentation Browser with the current model. Changing the model will automatically load the documentation of that model. Note that this will be bi-directional as you can also navigate to different model from the documentation links. So changing a model in documentation will change the current model as well.

However, as a user it makes more sense to have an extra Documentation View, as it may be helpful to see the documentation about a library model while working on a user model.

This is not possible if we go with the above change and it also means that we revert some parts of the #2249 (I mean double clicking on Modelica will open Modelica documentation and model view).

comment:8 in reply to: ↑ 7 Changed 5 years ago by casella

Replying to adeas31:

However, as a user it makes more sense to have an extra Documentation View, as it may be helpful to see the documentation about a library model while working on a user model.

I guess it is quite easy to open both the user model and the library model and toggle between the two tabs.

IMHO consistency helps avoiding mistakes; from this point of view, documentation view is on a part with text view, diagram view and icon view, it shouldn't be different.

comment:9 Changed 5 years ago by adeas31

  • Milestone changed from Future to 1.14.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 13e6186/OpenModelica.

The documentation view is now in sync with the icon/diagram/text view.
I have removed the view * context menu items as they don't make sense now.

Note: See TracTickets for help on using tickets.