What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
What is with this feature called Download Manager? What purpose does it serve?
If one drags a file in to FreeCAD, FreeCAD should streamline open it. Instead it invokes this process.
Reproduce:
Open FreeCAD
Open File Manager and drag a file in to FC application
Result: A panel called Download Manager open up.
If one drags a file in to FreeCAD, FreeCAD should streamline open it. Instead it invokes this process.
Reproduce:
Open FreeCAD
Open File Manager and drag a file in to FC application
Result: A panel called Download Manager open up.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
Are you talking about the start page? It is a web view. When you drag something into a webview it opens that file. Web view can't handle the FreeCAD file, since it's not an image, not a text file, not a video. It's a binary. And the default behavior when opening a binary in a browser is to download it.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
hmmm, 'Today I Learned...'vanuan wrote: ↑Thu Sep 17, 2020 2:51 am Are you talking about the start page? It is a web view. When you drag something into a webview it opens that file. Web view can't handle the FreeCAD file, since it's not an image, not a text file, not a video. It's a binary. And the default behavior when opening a binary in a browser is to download it.
Thanks for that explanation. I do think it's bad form from a UX point of view that users are dragging files in to FC and encountering this unaware of the fact you just explained.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
I think we have to ask wmayer to explain why FreeCAD needs this:
https://tracker.freecadweb.org/view.php?id=952
Maybe the original idea was to make FreeCAD a full featured web browser.
Frankly, I don't think FreeCAD should be a web browser. But it kind of is.
So the question is how to make UX better. Specifically, the start page.
First of all, maybe disable an ability to navigate away from the start page.
To do that, you need to open all the links in a real web browser rather than in a web view. This can be achieved by setting the link delegation policy and handling all links to be opened in a browser. Of course, only if the opened page is a start page.
Next, disable drag and drop specifically for the start page. This can be done either by using HTML Drag and Drop API, or using the link handling approach, that is by handling the "file:///" urls while tracking the previously opened page. So that when detecting the FCStd file which is accessible via the "file:///" protocol you could just open it from the local file system.
Actually, it is just another attack vector that you can follow a file link and it would automatically execute some python script on your machine.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
@vanuan thank you for your important perspective. I learn a lot reading your posts. I'll keep this discussion going to get somewhere with this. Since the Start WB is one of the first things new users interact with and it's important (crucial even) that it designed intelligently for onboarding new users and educating them.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
The download manager is a feature the project founder JRiegel wanted to have. Its purpose is to drag and drop a url of a web page into FreeCAD to open the download manager and get the file.
So, e.g. if you are in the FreeCAD forum and someone uploaded a file just drag and drop this link to FreeCAD and it automatically downloads the file.
With the conventional workflow you have to click the link and choose the option to download it. Then you have to switch to FreeCAD and either drag and drop from the file manager or use the Open function and navigate to the directory.
So the direct support to get the file is a big time saver.
However, it doesn't work for all kind of links. For example, when you had to login to a page it doesn't work but also on some pages there are some url redirections and there it can fail, too.
So, e.g. if you are in the FreeCAD forum and someone uploaded a file just drag and drop this link to FreeCAD and it automatically downloads the file.
With the conventional workflow you have to click the link and choose the option to download it. Then you have to switch to FreeCAD and either drag and drop from the file manager or use the Open function and navigate to the directory.
So the direct support to get the file is a big time saver.
However, it doesn't work for all kind of links. For example, when you had to login to a page it doesn't work but also on some pages there are some url redirections and there it can fail, too.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
This makes sense.
So, opening a download manager for a "file:///" seems like a bug. When you drop a file in any other place than QWebView, it is opened directly.
Another bug is that when you drop an image into a start page, it replaces the start page instead of opening a new window or a download manager.
But that can't be right, why would you even support drag and dropping into a web view rather than a whole application window? Isn't Qt able to intercept dropping a file into a web view? This must've been done intentionally.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
That's a scenario I never had on my radar. But for me this also happens with my system browser when I drag and drop a file it doesn't support it opens the download dialog. Anyway, you're right that FreeCAD should load the file even if dropped on the start page.
Hmm, ok.
I do not know yet what exactly happens internally. Must debug through the code first...But that can't be right, why would you even support drag and dropping into a web view rather than a whole application window? Isn't Qt able to intercept dropping a file into a web view? This must've been done intentionally.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
git commit dea2fad51
This looks like a valid use case. The image is loaded into the web page and the logic is handled by the web engine. You can go back to the previous content by clicking on the left arrow button.Another bug is that when you drop an image into a start page, it replaces the start page instead of opening a new window or a download manager.
Re: What's the deal with the FreeCAD internal 'Download Manager' getting triggered when dragging a file in to FC ?
Thank you very much!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs