Skip to content

fix(ui): flashcards when disabled, Extends offers no Root Tag, tag page property order, pages with only hidden properties - #13893

Open
yuxi-liu-wired wants to merge 2 commits into
logseq:masterfrom
yuxi-liu-wired:fix/dbtest-misc
Open

yuxi-liu-wired wants to merge 2 commits into
logseq:masterfrom
yuxi-liu-wired:fix/dbtest-misc

Conversation

@yuxi-liu-wired

@yuxi-liu-wired yuxi-liu-wired commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1272, Fixes logseq/db-test#1411, Fixes logseq/db-test#1288, Fixes logseq/db-test#1179.

Four small, independent UI fixes, one commit each (the files are disjoint, so they can be split into separate PRs). #1264 is not included, see the end.

#1272: flashcards switched off but g f / t c still open them

What the user sees: with Settings > Features > Flashcards off, the g f and t c shortcuts still open the flashcards dialog, and a block tagged #card still shows a "Practice" button that opens it.

Cause: :feature/enable-flashcards? was checked only in the left sidebar, the block context menu and the settings row. toggle-cards! (the :go/flashcards shortcut target) and the Practice button published :modal/show-cards unconditionally.

Change: toggle-cards! publishes :modal/show-cards only when state/enable-flashcards?, and still closes an already open flashcards dialog. The Practice button in components/block.cljs is rendered only when flashcards are enabled. The #card / #cards tags are not touched: #card is a built-in class (decision for the maintainers if they want to hide it as well).

Tests: toggle-cards-respects-flashcards-setting-test in frontend.handler.ui-test.

#1411: tag page lists class properties in an arbitrary order

What the user sees: a tag page shows its properties in a fixed order that ignores the order the user set, and drag-reordering uses the wrong neighbours.

Cause: the tag page rendered (:logseq.property.class/properties block) as an unordered set. The renderer cannot sort it anyway: the plain value summaries that frontend.worker.plain-value sends for referenced entities did not carry :block/order, so db-property/sort-properties would have fallen back to the uuid tie-break.

Change: ref-value->summary adds :block/order for property entities, and class-property-rows in components/property.cljs sorts with db-property/sort-properties (the sort the worker already uses for display and :thread-api/reorder-display-property).

Tests: class-properties-carry-their-order-test in frontend.worker.plain-value-test, class-property-rows-follow-block-order-test in frontend.components.property.property-test.

#1288: no "Show hidden properties" link on a tagged page whose properties are all hidden

What the user sees: on a new page with a tag whose properties all have "Hide empty value", no properties and no "Show hidden properties" link are shown, so there is no way to fill them in.

Cause: properties-area returned nil when a block had only hidden properties unless it was a root block, in the sidebar, a class, or already showing hidden properties. A page open in the main view is none of these, although show-hidden-properties-toggle-button? is true for the current route page, so the toggle never got rendered.

Change: that rule is now hidden-properties-only-without-reveal?, which does not apply when the toggle button would be rendered.

Tests: hidden-properties-only-area-keeps-reveal-toggle-test in frontend.components.property.property-test (a pure test of the predicate; the rendering itself is not covered by a unit test and would need an e2e test).

#1179: Root Tag offered in the Extends select

What the user sees: in the Extends select on a tag page, Root Tag is a choice, and clicking it in the open popup adds it to Extends.

Cause: the worker built extends-class-options with :except-extends-hidden-tags? true, but ldb/extends-hidden-tags does not contain :logseq.class/Root (private-tags explicitly drops it). The classes' filter in select-node that removes Root does not apply to this list.

Change: property-node-selector-data passes :except-root-class? true for extends-class-options. Root stays the implicit parent of every tag.

Tests: property-node-selector-data-extends-options-exclude-root-tag in frontend.worker.handler.property-test.

Not fixed: #1264 (:logseq.property.asset/external-url is :string, should be :url)

Changing the schema type needs a migration and more, so I stopped as instructed. :url is a value-ref type (value-ref-property-types in logseq.db.frontend.property.type): the value is stored as a ref to a value entity, with a :db.type/ref attribute. External URL is stored as a plain string today and read as a string everywhere (string? checks in deps/publish/src/logseq/publish/render.cljs, src/main/logseq/common/export/file.cljs, src/main/frontend/handler/assets.cljs, src/main/frontend/extensions/pdf/assets.cljs, src/main/frontend/worker/sync/assets.cljs, the :logseq.property.asset/external-url writes in editor/assets.cljs, components/assets.cljs and the graph-parser exporter). There is no existing migration in frontend.worker.db.migrate that retypes a built-in property (the nearest, "65.12", only removes :position from :url properties). A fix needs: a schema migration (attribute :db/valueType to ref, convert existing string values to url value entities), changes to every writer and reader above, and sync/export/publish handling. That is a design decision for the maintainers (alternatively: keep :string and render the value as a link).


Devin Review

Rebase onto master 29fd2ed (Nov 11)

Two of this PR's fixes are now in master, and their commits are dropped here:

What this PR still changes: the flashcards fix and the tag property order fix. In components/property.cljs it keeps master's two new functions and adds class-property-rows.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

{:property-uuid (:block/uuid property)
:property-ident (:db/ident property)
:value nil})))
(let [properties (class-property-rows block)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Mounted tag pages retain prior property order

A reorder from another window updates class-property-rows, but ordered-properties retains its local order when membership stays unchanged. The mounted tag page can show the prior order until remount.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@yuxi-liu-wired

Copy link
Copy Markdown
Contributor Author

On the mounted tag page and a reorder from another window: ordered-properties keeps its local order while the set of properties is unchanged, which is how every property list behaves on master (block and page property areas too); this PR only makes the tag page start from the saved order instead of set order (#1411). Following external reorders in all of them would be a change to ordered-properties itself, so it is left out of this PR.

yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Oct 29, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Oct 31, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 3, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 11, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 12, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 13, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 14, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 15, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 16, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 17, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 18, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
…when the feature is off

With Settings > Features > Flashcards switched off, the `g f` and `t c` shortcuts still opened the flashcards dialog, and cards blocks still showed a Practice button that opened it.

Only the sidebar entry, the block context menu and the settings row checked `:feature/enable-flashcards?`. `toggle-cards!`, the target of the `g f` / `t c` shortcut, and the Practice button on a block tagged #card published `:modal/show-cards` without checking it.

`toggle-cards!` now publishes the event only when flashcards are enabled (it still closes an open flashcards dialog), and the Practice button is rendered only when flashcards are enabled. The built-in #card class stays, as it is a built-in class.

Test: `toggle-cards-respects-flashcards-setting-test` checks that no event is published when the setting is off and that it is published when on.

Fixes logseq/db-test#1272
A tag page showed its class properties in an arbitrary fixed order instead of the order set by the user, and dragging a property to reorder it then reordered relative to the wrong neighbours.

The tag page rendered `:logseq.property.class/properties` as an unordered set, and the plain values sent to the renderer for referenced properties did not carry `:block/order`, so nothing could sort them.

Referenced property entities now carry `:block/order` in the plain value summary, and the tag page sorts its class properties with `db-property/sort-properties` (`class-property-rows`), the same sort the worker uses for display and reordering.

Tests: `class-properties-carry-their-order-test` (worker plain value keeps the order on class properties) and `class-property-rows-follow-block-order-test` (the tag page rows follow `:block/order`, not the set order).

Fixes logseq/db-test#1411
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 19, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.
yuxi-liu-wired added a commit to yuxi-liu-wired/logseq that referenced this pull request Nov 19, 2026
…ce, so it merges cleanly with logseq#13893

The test this PR added to worker/handler/property_test.cljs sat at the same place as the ones logseq#13893 adds there, so the two PRs conflicted and the nightly merge left one of them out. The test is unchanged; it now lives in frontend.worker.handler.property-tag-completion-test, which carries the requires it needs, and property_test.cljs is back to master's.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant