Skip to content
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

Internal Browser (Hints, HTML Report Preview) opens save dialogue #866

Closed
himslm01 opened this issue Sep 2, 2022 · 19 comments
Closed

Internal Browser (Hints, HTML Report Preview) opens save dialogue #866

himslm01 opened this issue Sep 2, 2022 · 19 comments

Comments

@himslm01
Copy link

himslm01 commented Sep 2, 2022

Version of Archi

v4.9.3

Archi Plug-ins

None

Operating System

GNU Linux Ubuntu 22.04.1 LTS

Expected Behaviour

Tooltips should pop-up when I hover over icons and objects

Actual Behaviour

A "save" window opens offering me to save the <icon-type>.html page to disk.

Steps to Reproduce the Behaviour

  1. Download Archi-Linux64-4.9.3.tgz
  2. Decompress to folder and run Archi application
  3. Hover mouse over Palette icons

There are no error logs and this happens with all .archimate files.

Archi tooltip save

@Phillipus
Copy link
Member

Are you running Ubuntu under X11 or Wayland?

@himslm01
Copy link
Author

himslm01 commented Sep 2, 2022

How would I tell?

<EDIT>
Google tells me to check this way:

$ loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'
x11

@Phillipus
Copy link
Member

I think the default for Ubuntu is Wayland. You need to run Archi with export GDK_BACKEND=x11 as in the Archi-Ubuntu.sh file included.

@Phillipus
Copy link
Member

Phillipus commented Sep 2, 2022

Do you have the "Hints" tab open or closed. Hints are stored in html files like the name in your screenshot.

Is it all tooltips? In the tree? On a diagram?

@himslm01
Copy link
Author

himslm01 commented Sep 2, 2022

Thanks for the quick feedback.

The hints tab was closed.
It was all tooltips, in the pallet, on the tree, on the diagram, etc.

Even though the command above suggested I was running under x11, changing my desktop shortcut to run the Archi-Ubuntu.sh shell script appears to have fixed the issue for tooltips.

But since you mentioned the hints tab, if I have the hints tab open the same issue occurs - this time you can see the tooltip and the save dialogue.

Archi tooltip save running Archi-Ubuntu

@Phillipus
Copy link
Member

The Hints tab is displaying a local HTML page when you hover over the palette, or select a component in the Tree or in a diagram.

The Hints tab is basically an embedded WebKit browser. When it displays a hint it sets the embedded browser URL to something like file:///<pathto>/hintfile.html This is standard practice for displaying a local file URL.

As to why it is opening a save dialog I have no idea. If you can offer any further clues that would be helpful, at this stage there's nothing I can change in Archi's code.

@Phillipus
Copy link
Member

FWIW, I installed a fresh install of Ubuntu 22.0.4.1 and didn't see this issue. Perhaps different versions of Webkit? Configuration? Permissions?

@himslm01
Copy link
Author

himslm01 commented Sep 2, 2022

This was a fresh install of Ubuntu 20.04 about a month ago, although the /home partition was preserved from a previous install so $HOME/.local and other places configuration is kept will have been preserved from previous years of running various Ubuntus.
I'm new to Archi, but I have never seen the issue - downloading instead of displaying web pages - in other Java based GUI apps.
I don't know where to find any config which might change how webkit behaves, but is this useful in any way?

$ dpkg -l|grep webkit
ii  gir1.2-webkit2-4.0:amd64                   2.36.6-0ubuntu0.22.04.1                 amd64        Web content engine library for GTK - GObject introspection data
ii  libwebkit2gtk-4.0-37:amd64                 2.36.6-0ubuntu0.22.04.1                 amd64        Web content engine library for GTK

@Phillipus
Copy link
Member

I have the same webkit versions.

I start Ubuntu when logging in with the option Ubuntu on XOrg available from the bottom right corner of the log-in screen. I tried Archi with this and using Wayland, with and without the Archi-Ubuntu.sh script and all is OK.

Did you try with the Hints tab closed? It shouldn't trigger that dialog.

@Phillipus
Copy link
Member

Another place where the internal webkit browser (it's an Eclipse SWT Browser component) is used is in the Tools -> Preview HTML Report main menu item. Does this do the same thing when the preview report tab opens?

@Phillipus
Copy link
Member

I think I may have found what's happening here, assuming this only happens with Hints files:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=534113

It concerns the mime type of the html file which may be reported as application/xhtml+xml. The solution is to fix that mime type association (I don't know how).

@Phillipus
Copy link
Member

Phillipus commented Sep 2, 2022

Actually, the above may not be exactly correct. I was confusing Archi's help files (which use XHTML) with the Hints files which are normal HTML. But there may be a clue there. Might be worth checking mime types associations.

@Phillipus
Copy link
Member

You could try this command:

file --mime-type <pathto>/business_actor.html

<pathto> is the location of Archi's help plugin which is:

Archi/plugins/com.archimatetool.help_4.9.3.202203221030/hints

@himslm01
Copy link
Author

himslm01 commented Sep 2, 2022

Currently:
With the hints tab closed and running the Archi-Ubuntu.sh script I see no issues.
With the hints tab open and running the Archi-Ubuntu.sh script I see this issue.

Tools -> Preview HTML Report main menu item causes four save dialogues to appear.
As far as I can see, no preview report tab opens.

@Phillipus
Copy link
Member

Both the hints tab and the preview report use the webkit browser with a local url set to file:///path_to/somefile.html So this means that webkit is not seeing these files as HTML files. Might be a mime type association as mentioned above.

@Phillipus
Copy link
Member

With the hints tab closed and running the Archi-Ubuntu.sh script I see no issues.

I don't think using Archi-Ubuntu.sh will make any difference. It's the Hints tab being open that causes this.

@himslm01
Copy link
Author

himslm01 commented Sep 2, 2022

$ file --mime-type $HOME/Applications/Archi/plugins/com.archimatetool.help_4.9.3.202203221030/hints/business_actor.html
/home/mdsh/Applications/Archi/plugins/com.archimatetool.help_4.9.3.202203221030/hints/business_actor.html: text/html

@Phillipus
Copy link
Member

Phillipus commented Sep 2, 2022

Looking at the comments in https://bugs.eclipse.org/bugs/show_bug.cgi?id=534113 I traced the internal Eclipse WebKit code. It seems that a decision to either display the html file or show a download dialog is based solely on how the Eclipse code determines the mime type of the file which it queries from the system. As this issue has not been reported before it's likely that a WebKit config of mime types is different on your system. I don't know how to investigate that further.

@Phillipus Phillipus changed the title Tooltip opens save dialogue Internal Browser opens save dialogue Sep 2, 2022
@Phillipus Phillipus changed the title Internal Browser opens save dialogue Internal Browser (Hints, HTML Report Preview) opens save dialogue Sep 2, 2022
@Phillipus
Copy link
Member

I'll close this one as there's nothing we can change in the Archi code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants