robert7 / nixnote2

Nixnote - Evernote desktop client for Linux
GNU General Public License v3.0
297 stars 32 forks source link

regression introduced in sorting code (pull #187) - narrow note list no longer sorted #204

Closed ludovicaelbrecht closed 1 year ago

ludovicaelbrecht commented 1 year ago

Expected vs. actual behavior

I use the "narrow note list" and sort notes through View -> Sort notes by -> Date Updated. This has worked perfectly until 2.1.6, and has been broken in every version since 2.1.7.

Steps to reproduce the problem

  1. View -> Narrow Note List
  2. Try to sort the notes using View -> Sort notes by -> Date Updated
  3. The notes aren't sorted differently, they're always sorted alphabetically.

Specifications

Running nixnote2 on Linux (Fedora 38), reproduced this behavior both using the Fedora copr package and by building from source.

I looked at the changes introduced in 2.1.7 (since this is where the problem appears). In 2.1.7, this issue is closed: https://github.com/robert7/nixnote2/issues/156 ("editor fonts and sorting notes"). Which is fixed by this pull request: https://github.com/robert7/nixnote2/pull/187/commits Which contains this commit: https://github.com/robert7/nixnote2/pull/187/commits/4fb6706146cfce61309c062e544df55e6f1faa7d

If I undo this commit (i.e. comment out the sorting code and add "this->setSortingEnabled(false);" again), then recompile, the regression is no longer there for me.

I don't know what the correct fix is, but if I read issue #156 correctly it seems that this commit fixed a sorting issue in "wide note list" mode, but as a side effect breaks sorting in "narrow note list".

Thanks, Ludovic

boo-yee commented 1 year ago

Hi. To fix issue 156, I set the notetableview as sortable by calling setSortingEnabled(true), so that we can sort by clicking on the headers, but it caused such a side effect, which is not what I expected. In my case, narrow or wide does not matter, actually sorting from the menu does not work. If you just need to sort by one attribute(column) in 2.1.7 or later, you could do that by clicking on the notetableview's headers for now. And I'll try to find a way to fix the sorting from the menu later on.

boo-yee commented 1 year ago

Fixed by https://github.com/robert7/nixnote2/pull/207.

ludovicaelbrecht commented 1 year ago

Just built the develop branch, it's fixed indeed. Thanks a lot!