Implement "Open containing folder" iconic button for "Saved Files" items (about:downloads)
Categories
(Thunderbird :: Toolbars and Tabs, enhancement)
Tracking
(Not tracked)
People
(Reporter: torsten.zachert, Assigned: mkmelin, Mentored)
References
Details
(Keywords: ux-discovery, ux-efficiency, Whiteboard: [lang=js])
Attachments
(2 files, 8 obsolete files)
9.57 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
10.01 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Comment 5•6 years ago
|
||
Comment hidden (typo) |
Assignee | ||
Comment 8•6 years ago
|
||
Should be changing code around here: https://searchfox.org/comm-central/rev/c1fa40fa8e939b73cebcd10cd5de3351f2e35841/mail/components/downloads/content/aboutDownloads.js#230
For reference, Firefox code (different) is around here: https://searchfox.org/mozilla-central/rev/444ee13e14fe30451651c0f62b3979c76766ada4/browser/components/downloads/DownloadsSubview.jsm#455
Updated•5 years ago
|
Magnus, Wayne I think I can tackle this too. Please assign this to me and I will make a patch ASAP.
Comment 11•5 years ago
|
||
Magnus the above searchfox links that you posted is the code which corresponds to the Downloads View
when (Cntrl + J)
is pressed in TB. Could you please tell me which part of the codebase I should be playing with, so that the main display interface gets changed (Because I need to add a downloads button and give it the same functionality as Ctrl+J). Thankyou.
Assignee | ||
Comment 12•5 years ago
|
||
There has been some other comments, but I think we should focus on the initial goal with this bug: to be able to open the containing folder of the attachment, from the downloads view.
If you compare to firefox, right of each file there is a folder icon which you can click to "Open Containing Folder". That is the part we want to tackle in this bug.
Comment 13•5 years ago
|
||
Thankyou Magnus for the clarification. I had one more doubt regarding the UI. In aboutDownload.js
there are certain XUL Elements being added. For example, the fileName, size and startDate
are being added to the vbox
section. But my doubt is, where is the fileName and size and startDate being filled? Which component of the system is responsible for filling in the details? Thankyou.
Assignee | ||
Comment 14•5 years ago
|
||
Those are just the elements to show the data. The actual data looks to be set up in the DownloadItem "constructor" https://searchfox.org/comm-central/rev/c1fa40fa8e939b73cebcd10cd5de3351f2e35841/mail/components/downloads/content/aboutDownloads.js#171
Comment 15•5 years ago
|
||
Where can I find the Icon Location or Path
to the folder icon which is present in firefox. I need a path something like moz-icon://......
Assignee | ||
Comment 16•5 years ago
|
||
Icons are hooked up by css. Compare to firefox: https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/browser/themes/shared/customizableui/panelUI.inc.css#1768
You need to get the corresponding icon files copied to mail/ instead of browser/ and registered in relevant jar.mn file. Searchfox is your friend here. Look for how it's done for browser/ and do a similar thing for mail.
For firefox, regarding the actual command I think it ends up executing downloadsCmd_show and ends up here:
https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/browser/components/downloads/DownloadsViewUI.jsm#701
Comment 17•5 years ago
|
||
Magnus I have faced another issue.
console.log(this.download.target.path);
let file = new FileUtils.File(this.download.target.path);
DownloadsCommon.showDownloadedFile(file);
The value of this.download.target.path
is /home/somu/Videos/temp.jpg
. But the last line (showDownloadedFile) is giving an error saying that NS_ERROR_FILE_NOT_FOUND
. But the file is actually present in the above stated path. Am I missing out something here? Thankyou.
Assignee | ||
Comment 18•5 years ago
|
||
Please post a patch with what you have. Hard to say without any code
Comment 19•5 years ago
|
||
Comment 20•5 years ago
|
||
Magnus I have attached the Patch. Please note that I am working on only the clickable functionality as of now. I haven't taken care of the right icon usage and its position either. I will do them once this clickable functionality is working properly. Thankyou.
Assignee | ||
Comment 21•5 years ago
|
||
Comment 22•5 years ago
|
||
Magnus I actualy copied the DownloadsCommon.jsm
from browser/
to obj-x86_64-pc-linux-gnu/dist/bin/modules/DownloadsCommon.jsm
and the clickable functionality actually worked. So now the only thing that remains is that how to tell the ./mach build
to automatically add DownloadsCommon.jsm
to the TB Build
. Could you please tell me how to do this? If this is done, then the first part of the Issue would be done with. Thankyou.
Assignee | ||
Comment 23•5 years ago
|
||
You would have to add it under mail/ somewhere and make appropriate changes (see what m-c does for DownloadsCommon.jsm). But, anyway, seems better to just copy over the 10-20 lines for now
Comment 24•5 years ago
|
||
Comment 25•5 years ago
|
||
Magnus great news. I got the DownloadsCommon.jsm
file included in the build of Thunderbird
and the clickable functionality is working now. There are now 2 more sub issues to solve -
- Using the right folder Icon
- Positioning the Folder Icon correctly (In each Download Element)
I plan on taking up subtask 2 first. But I have tried a lot of ways to get the folder icon
below the sender
by changing css and even by using another vbox. But they all were in vain. Could you please help me regarding this? (on how to change the position). I have attached the current view of the DownloadsView. Thankyou.
Assignee | ||
Comment 26•5 years ago
|
||
Probably best to use the Developer Tools and inspect the element, both for Firefox and for Thunderbird. Then compare and see that needs changing.
Comment 27•5 years ago
|
||
Magnus, is the positioning looking good? Also I am using the same CSS configuration in all 3 linux, windows and Mac OSX for now. Please let me know if any changes you would suggest.
Comment 28•5 years ago
|
||
Magnus, I have faced a new issue. When we double-click
on the Folder Icon
, it is launching the file. But this is not the expected behaviour. I have trieds to remove this by stopping the Bubbling Process
, by using the stopPropagation
command. But it is not working. Am I missing something here? I have attached the latest patch for reference. Thankyou.
Assignee | ||
Comment 29•5 years ago
|
||
stopImmediatePropagation() perhaps?
Comment 30•5 years ago
|
||
I tried that too Magnus, but it is still not working? Could you please help me with it.
Assignee | ||
Comment 31•5 years ago
|
||
Assignee | ||
Comment 32•5 years ago
|
||
Move to shared css file. Almost completely the same, and looks like the differences are just stuff that were forgot.
Assignee | ||
Comment 33•5 years ago
|
||
Add the icon to click. Copied from Firefox. (Though not the js directly, it's too different.)
Assignee | ||
Updated•5 years ago
|
Comment 34•5 years ago
|
||
Comment 35•5 years ago
|
||
Assignee | ||
Comment 36•5 years ago
|
||
Assignee | ||
Comment 37•5 years ago
|
||
Comment 38•5 years ago
|
||
Comment 39•5 years ago
|
||
Assignee | ||
Comment 40•5 years ago
|
||
Assignee | ||
Comment 41•5 years ago
|
||
Comment 43•5 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/b72e1eda0630
use a shared CSS file for aboutDownloads.css. r=Paenglab
https://hg.mozilla.org/comm-central/rev/94486e357774
Provide icon to list / open the last saved, recent attachments from download list. r=Paenglab DONTBUILD
Comment 44•5 years ago
|
||
The original patch had
https://hg.mozilla.org/comm-central/rev/94486e357774#l4.12
+ skin/classic/messenger/icons/panel-icon-magnifier.svg (../shared/mail/icons/panel-icon-magnifier.svg)
conditionally:
#ifndef XP_MACOSX
skin/classic/messenger/icons/panel-icon-folder.svg (../shared/mail/icons/panel-icon-folder.svg)
#else
skin/classic/messenger/icons/panel-icon-magnifier.svg (../shared/mail/icons/panel-icon-magnifier.svg)
#endif
Comment 45•5 years ago
|
||
At least the commit message of this patch isn't right, and one misleading variable name in code, hence removin checkin-needed.
From my reading of the patch (sorry no time to try, screenshot would be helpful), and this bug's history:
Magnus has changed the objective of this bug in comment 12 (for details, see below). Therefore:
Wrong commit message:
Bug 1471833: Provide icon to list / open the last saved, recent attachments from download list. r=Paenglab
Correct commit message:
Bug 1471833: Saved Files list (about:downloads): Add iconic button to open the containing folder of downloaded attachments. r=Paenglab
For the same reason, I think the following variable should be changed:
let downloadButton = document.createXULElement("button");
Imo, downloadButton wrongly suggests that the purpose of this button is to download something, but in reality, it's about opening the containing folder:
// Show the downloaded file in folder if the folder icon is clicked.
downloadButton.addEventListener("click", aEvent => this.show());
So a more appropriate name for this button would be something like:
openFolderButton
If my reading is correct, the current summary of this bug should also be changed accordingly.
Background:
- Original objective: Reporter's request (per current summary):
Summary: Provide icon to list / open the last saved, recent attachments from download list.
It would be very helpful to have a list with the last saved attachments to open directly or in the explorer, like Firefox has.
So that's about adding a toolbar button in the main window for that missing link when after saving attachments, there's zero hint in the UI how to access them, unless searching menus or knowing Ctrl+J by heart (a problem which I have pointed out long ago). Note that reporter is also asking for an easy way to open saved attachments, meaning reporter was clearly not talking about the existing downloads list which already has that functionality. See Jörg's comment 3 which confirms this original understanding.
- New objective (per Magnus comment 12):
Only add a folder icon next to each download in the list of downloads aka Saved Files (that's useful, too, but only after knowing how to find the downloads list...)
Comment 46•5 years ago
|
||
Midair-collision, Jörg landed this before I succeded to remove checkin-needed.
Comment 45 still applies, and I recommend to fix the commit message and the variable name, because it's pretty confusing otherwise.
Comment 47•5 years ago
|
||
Hmm, commit messages are permanent. If the TB module owner and a TB peer work together, I can only assume that the stuff is correct.
Assignee | ||
Comment 48•5 years ago
|
||
Thomas, well this bug was slightly confusing. If there's something missing, file a new bug with a more clear focus.
I don't see anything wrong with the commit message.
The variable name is just a variable name. It's named that way because that what firefox also uses for this.
Comment 49•5 years ago
•
|
||
(In reply to Magnus Melin [:mkmelin] from comment #48)
Fwiw:
I won't care much if the commit message gets fixed or not, now that it's already landed, but let's get the record straight.
This bug has implemented an "Open containing folder" icon/button for every saved attachment item in the list of "Saved Files" tab, right?
I am failing to see any of that that in the current commit message?
Thomas, well this bug was slightly confusing. If there's something missing, file a new bug with a more clear focus.
Hmmm. The summary is slightly odd because it's arguably repetitive, but otherwise I am failing to locate the confusion until comment 12 where you just decided to do something related, but pretty different from the original intention and description of this bug. Kindly re-read comment 0 up to comment 11 and all of them are only talking about adding a toolbar button to access the Saved Files list/tab sometimes called "downloads list" from the main 3 pane tab. So apparently for reporter, Jörg, myself, and even newbie assignee Somu there was no confusion about the intention of this bug...
I don't see anything wrong with the commit message.
Bug 1471833: Provide icon to list / open the last saved, recent attachments from download list. r=Paenglab
Imho the current commit message is misleading because this bug did NOT add an icon which allows users to list the last saved attachments; we already had that list, but reporter was failing to find it because our UI does not give any easily discoverable clues about the existence of the "Saved Files" list. This bug added an icon/button to "open containing folder" of any one item in the list of "Saved Files".
The variable name is just a variable name. It's named that way because that what firefox also uses for this.
Fair enough (however: pls note that the FF button has multiple functions, but ours hasn't).
Comment 50•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #12)
There has been some other comments, but I think we should focus on the initial goal with this bug: to be able to open the containing folder of the attachment, from the downloads view.
TB already had that functionality on the context menu of each "Saved Files" item; but now it's more discoverable and more easily accessible, which is great! Thanks for implementing this.
If you compare to firefox, right of each file there is a folder icon which you can click to "Open Containing Folder". That is the part we want to tackle in this bug.
FTR: That is the part that Magnus decided to tackle in this bug.
Assignee | ||
Comment 51•5 years ago
|
||
Like Jörg said, commit messages cannot be changed.
Description
•