GNOME Bugzilla – Bug 712902
Don't show childless [Gmail] in Folders list
Last modified: 2019-01-15 03:19:07 UTC
---- Reported by jim@yorba.org 2012-06-22 15:09:00 -0700 ---- Original Redmine bug id: 5444 Original URL: http://redmine.yorba.org/issues/5444 Searchable id: yorba-bug-5444 Original author: Jim Nelson Original description: The magic [Gmail] (or, for some accounts, [GoogleMail]) and its child Important are now shown in the Labels list due to #3704. We should not show [Gmail] unless it has children not treated as special folders. Important should be displayed when we implement #5094. Related issues: related to geary - Feature #5094: Display "Important" Gmail folder (Fixed) related to geary - Feature #6510: Support sub-foler (Need Information) duplicated by geary - 6814: Don't show [Gmail] label (Duplicate) ---- Additional Comments From geary-maint@gnome.bugs 2013-05-15 14:34:00 -0700 ---- ### History #### #1 Updated by Adam Dingle about 1 year ago * **Assignee** deleted (<strike>_Jim Nelson_</strike>) #### #2 Updated by Adam Dingle about 1 year ago * **Target version** deleted (<strike>_0.2_</strike>) #### #3 Updated by Jim Nelson 10 months ago * **Subject** changed from _[Gmail] and [Gmail]/Important shown_ to _[Gmail] shown in Folders list_ * **Target version** set to _0.3.0_ Important has been handled. All that's left is removing the [Gmail] folder. #### #4 Updated by Jim Nelson 9 months ago * **Target version** changed from _0.3.0_ to _0.4.0_ #### #5 Updated by Jim Nelson 6 months ago * **Subject** changed from _[Gmail] shown in Folders list_ to _Don't show childless [Gmail] in Folders list_ * **Description** updated (diff) * **Target version** changed from _0.4.0_ to _0.5.0_ Updated to reflect that there are some situations where Geary needs to display [Gmail], since some other clients out there are adding their own folders under it. However, since [Gmail] by itself is not interesting, it should be hidden if it has no children. The broader rule for Geary should be: if a Folder has no children and is not SELECTable (i.e. "!openable" in FolderProperties parlance), then it should not be displayed. --- Bug imported by chaz@yorba.org 2013-11-21 20:17 UTC --- This bug was previously known as _bug_ 5444 at http://redmine.yorba.org/show_bug.cgi?id=5444 Unknown milestone "unknown in product geary. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. Resolution set on an open status. Dropping resolution
*** Bug 725232 has been marked as a duplicate of this bug. ***
*** Bug 735098 has been marked as a duplicate of this bug. ***
Hello Mike, This bug is rather old but still here in master, so I'd like to tackle it down: what approach should I have here? Currently if you try to open this folder in left pane you will get: > d 21:03:32 imap-engine-minimal-folder:722: Soft failure opening or preparing remote folder Gmail:account_02:[Gmail] (open_count=1 remote_opened=true), closing: Server disallowed SELECT [Gmail]: a005 NO [NONEXISTENT] Unknown Mailbox: [Gmail] (Failure) Possible solutions are: 1) hide it in the left pane in any-case 2) make it unselectable (as "Labels") in left pane in any-case? 3) make it unselectable if it has children, and hide it otherwise 4) make something deeper in the engine itself, eg. "removing" the folder from the account folders list?
I tend to agree with Jim: > The broader rule for Geary should be: if a Folder has no children and is not > SELECTable (i.e. "!openable" in FolderProperties parlance), then it should not > be displayed. It might be worth running with --log-network and seeing what GMail is actually reporting for that folder when Geary does a LIST/XLIST at startup. If we do know that it isn't openable in advance (or even if it requires the SELECT to fail as you note above) and can work out it won't have any children, then yeah, just hide it. If a user-made sub-folder is then later added, it should obviously then show up again.
Created attachment 346540 [details] [review] patch proposal v1 -- wip The fact is: [Gmail] folder is the parent of all Gmail folders (at least drafts, trash, important, all mails, spam, starred). But I guess I'm doing something similar to your approach, see the current **wip** patch (which currently aborts).
Hmm, I wonder if rather than adding [Gmail] to the branch and then trying to hide it it later, would be to not add it in the first place (since it's folder properties should say it isn't openable)? Then also check whenever adding a normal (i.e. not special) folder that all of its ancestors have been added - and if not then add its ancestors then.
Oops, my bad - this patch was actually meant for Bug 754802 (hide "Labels" folder if none present). For [Gmail] folder indeed I'll follow your approach.
No problem, would the same approach work there as well, however?
Created attachment 347050 [details] [review] patch proposal v2 Well, I think it's easier to not add them on the upper layer like the following approach. WDYT?
Bump tickets to 0.14 that aren't going to make 0.13.
Just tested this patch, worked perfectly :-) - even applied cleanly.
Thank for the bump. :) I took a look at the patch (it does need some rebasing after recent changes to master). There's probably an unhandled corner case when a new folder gets added below one that has already been hidden, and that isn't handled specially as in the case of the [Gmail] folder, but hopefully that's reasonably rare. So I will landed this as-is on master and will see if anyone complains. https://gitlab.gnome.org/GNOME/geary/merge_requests/84