Repository navigation
fix(views): a missing value sorts last in query tables, both ways - #13610
Closed
yuxi-liu-wired wants to merge 1 commit into
Closed
yuxi-liu-wired wants to merge 1 commit into
yuxi-liu-wired wants to merge 1 commit into
Conversation
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 6, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
yuxi-liu-wired
force-pushed
the
fix/table-filter-and-sort
branch
from
October 12, 2026 05:48
96e91be to
005b9ed
Compare
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated: the "does not contain ignores case" half of this PR is now on master (93d19b6, #13487), so this PR keeps only the other half, rebased on master.
In query tables and grouped views (
sort-entities), a row with no value for the sort property sorts first when sorting descending, and the order flips between directions; tag tables (sort-eids-by-sorting) already put such rows last both ways.Cause:
by-one-sortingand the minor sort (common-util/by-sorting) usecompare, which puts nil first, and reverse it for descending.Fix:
compare-nil-last: nil last in both directions, otherwisecomparein the sort's direction; used for the major sort and the minor sorts ofsort-entities.Test:
logseq.db.common.view-test/sort-entities-puts-a-missing-value-last-both-ways-test: ascending, descending, and as the second sort key. On master the descending case fails; with the fixlogseq.db.common.view-testpasses (48 tests, 154 assertions, nbb). Lint as in CI fordeps/db.