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

[mini-browser] fix 'Open Source' implementation #5223

Closed
vince-fugnitto opened this issue May 22, 2019 · 1 comment · Fixed by #10047
Closed

[mini-browser] fix 'Open Source' implementation #5223

vince-fugnitto opened this issue May 22, 2019 · 1 comment · Fixed by #10047
Labels
mini-browser issues related to the mini-browser

Comments

@vince-fugnitto
Copy link
Member

Description

Currently, the implementation of the mini-browser openSource may be flawed for certain file extensions.

Here is the current implementation of the openSource.
https://github.com/theia-ide/theia/blob/730afb49ffb4be2f1b839bfce364fa0e938034f6/packages/mini-browser/src/browser/mini-browser-open-handler.ts#L236-L243

The call open calls the following opener-service method:

https://github.com/theia-ide/theia/blob/730afb49ffb4be2f1b839bfce364fa0e938034f6/packages/core/src/browser/opener-service.ts#L80-L83

Based on the implementation of getOpener, the handler returned has the highest priority.


In the mini-browser we have both the Open Preview and Open Source toolbar items, used to open the uri in question in two different modes. The problem with the Open Source is that the highest handler is in fact the Preview so clicking on it will do nothing for let's say an image called a.jpg. Instead, we should determine based on the list of all available open handlers, what the best open source handler would be or if it should always be the editor.

If we take for example the case of an image file like a.jpg, the highest open handler would be the preview, but if we call the openSource based on its current implementation, we will also use the preview. In this case, we should get all open-handlers, and determine for the right context what the appropriate open-handler would be.

@vince-fugnitto vince-fugnitto added the mini-browser issues related to the mini-browser label May 22, 2019
@vince-fugnitto
Copy link
Member Author

Investigation of #5110

fangnx pushed a commit to fangnx/theia that referenced this issue May 23, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 23, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 23, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 27, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 27, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 28, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 29, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
fangnx pushed a commit to fangnx/theia that referenced this issue May 29, 2019
…pen source" to work with image/pdf files

Signed-off-by: fangnx <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mini-browser issues related to the mini-browser
Projects
None yet
1 participant