quickmove-extension icon indicating copy to clipboard operation
quickmove-extension copied to clipboard

Searching in the folder list stopped working (for non-top-level folders?)

Open tessarakt opened this issue 5 years ago • 3 comments

I just upgraded to Thunderbird 74.0 beta 1. QFM version is 2.0.0pre1.

Now I now longer get proper results when searching in the folder list.

Steps to reproduce:

  1. In the message list, press Shift-G. => The popup appears, "Goto" is selected, the folder list contains some names (apparently recent folders). This is as expected.
  2. Wait long enough, then type "Pos". => Two "Posteingang" (German for "Inbox") folders are shown (for two different accounts). This is as expected.
  3. Type letters of any other folder. => List becomes empty. Expected would be: That folder is shown in the list.

Could this be related to this entry in the Changelog: "MailExtensions: Changed folder enumeration to return tree structure rather than list"?

tessarakt avatar Feb 23 '20 10:02 tessarakt

Yes, that exactly.

If I change the code in folderlist.js as follows, it works:

  searchRecursively(lowerSearchTerm, folder) {
    if (folder.name.toLowerCase().includes(lowerSearchTerm)) {
      this._addFolder(folder, 0);
    }

    for (let subFolder of folder.subFolders) {
      this.searchRecursively(lowerSearchTerm, subFolder);
    }
  }
  
  addRecursively(folder) {
    let depth = (folder.path.match(/\//g) || []).length - 1;
    this._addFolder(folder, depth);

    for (let subFolder of folder.subFolders) {
      this.addRecursively(subFolder);
    }
  }

  repopulate() {
    let lowerSearchTerm = this.searchValue.toLowerCase();
    this._clearFolders();

    if (lowerSearchTerm) {
      for (let folder of this.allFolders) {
        this.searchRecursively(lowerSearchTerm, folder);
      }
    } else if (this.defaultFolders) {
      for (let folder of this.defaultFolders) {
        this._addFolder(folder, 0);
      }
    } else {
      for (let folder of this.allFolders) {
        this.addRecursively(folder);
      }
    }
  }

tessarakt avatar Feb 23 '20 13:02 tessarakt

@kewisch Firstly thank you for creating this extension, it makes managing my email much easier. ❤️ I heavily relied on this behaviour.

@tessarakt thanks for opening this issue. I've searched for folderlist.js in the directory where the extension exists but I cannot find this file. Where should this be located?

Is this fix in a format that it can be merged to bring this useful behaviour back?

ei8fdb avatar Jan 08 '21 11:01 ei8fdb

@ei8fdb folderlist.js is part of the extension. The .xpi file is just a ZIP archive. You can unpack it, make the changes to folderlist.js, and then add it to the archive again.

tessarakt avatar Jan 09 '21 16:01 tessarakt

This should be fixed, please open a new issue if not

kewisch avatar Aug 19 '23 19:08 kewisch