Skip to content

Sorting a tag table by a checkbox gives the same order ascending and descending #1321

Closed
logseq/logseq
#13486

Description

@yuxi-liu-wired

Steps

  1. Create a tag Topic with a Checkbox property "done".
  2. Tag 2 blocks with #Topic: "checked", with "done" checked, and "unchecked", with "done" checked and then unchecked.
  3. On the Topic page, sort the table by "done" ascending, then descending.

Expected

The 2 directions give opposite orders: unchecked, checked ascending, and checked, unchecked descending. A query table over the same blocks sorts ascending as unchecked, checked.

Actual

The tag page lists checked, unchecked in both directions. An unchecked box sorts like a block without the property, last in both directions.

Cause

sort-eids-by-sorting in deps/db/src/logseq/db/common/view.cljs builds its value map with (if-let [v (eid-sort-value db schema eid)] (assoc! acc eid v) acc). if-let skips the value false, so an unchecked box counts as a missing value.

Found with a model-based property test of table views (ascending against descending, tag table against query table), replayed on upstream master 16c4ed1a0.

Activity

  1. yuxi-liu-wired commented on Oct 6, 2026

    @yuxi-liu-wired
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions