Repository navigation
fix(ui): flashcards when disabled, Extends offers no Root Tag, tag page property order, pages with only hidden properties - #13893
yuxi-liu-wired wants to merge 2 commits into
Conversation
| {:property-uuid (:block/uuid property) | ||
| :property-ident (:db/ident property) | ||
| :value nil}))) | ||
| (let [properties (class-property-rows block) |
There was a problem hiding this comment.
🔍 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
On the mounted tag page and a reorder from another window: |
2b3a280 to
362792e
Compare
…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.
362792e to
94a6f35
Compare
…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.
94a6f35 to
bdc02a6
Compare
…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.
bdc02a6 to
2a41a17
Compare
…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.
…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.
…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.
2a41a17 to
81f4e8b
Compare
…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.
…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.
…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.
…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.
…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.
81f4e8b to
1db5d44
Compare
…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.
…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.
1db5d44 to
d5d40b6
Compare
…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.
…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.
d5d40b6 to
66dc374
Compare
…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.
66dc374 to
0f39818
Compare
…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.
…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.
0f39818 to
f0e5cf3
Compare
…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.
…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.
…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
f0e5cf3 to
0720a4e
Compare
…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.
…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.
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 cstill open themWhat the user sees: with Settings > Features > Flashcards off, the
g fandt cshortcuts 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/flashcardsshortcut target) and the Practice button published:modal/show-cardsunconditionally.Change:
toggle-cards!publishes:modal/show-cardsonly whenstate/enable-flashcards?, and still closes an already open flashcards dialog. The Practice button incomponents/block.cljsis rendered only when flashcards are enabled. The#card/#cardstags are not touched:#cardis a built-in class (decision for the maintainers if they want to hide it as well).Tests:
toggle-cards-respects-flashcards-setting-testinfrontend.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 thatfrontend.worker.plain-valuesends for referenced entities did not carry:block/order, sodb-property/sort-propertieswould have fallen back to the uuid tie-break.Change:
ref-value->summaryadds:block/orderfor property entities, andclass-property-rowsincomponents/property.cljssorts withdb-property/sort-properties(the sort the worker already uses for display and:thread-api/reorder-display-property).Tests:
class-properties-carry-their-order-testinfrontend.worker.plain-value-test,class-property-rows-follow-block-order-testinfrontend.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-areareturned 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, althoughshow-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-testinfrontend.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-optionswith:except-extends-hidden-tags? true, butldb/extends-hidden-tagsdoes not contain:logseq.class/Root(private-tags explicitly drops it). Theclasses'filter inselect-nodethat removes Root does not apply to this list.Change:
property-node-selector-datapasses:except-root-class? trueforextends-class-options. Root stays the implicit parent of every tag.Tests:
property-node-selector-data-extends-options-exclude-root-taginfrontend.worker.handler.property-test.Not fixed: #1264 (
:logseq.property.asset/external-urlis:string, should be:url)Changing the schema type needs a migration and more, so I stopped as instructed.
:urlis a value-ref type (value-ref-property-typesinlogseq.db.frontend.property.type): the value is stored as a ref to a value entity, with a:db.type/refattribute. External URL is stored as a plain string today and read as a string everywhere (string?checks indeps/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-urlwrites ineditor/assets.cljs,components/assets.cljsand the graph-parser exporter). There is no existing migration infrontend.worker.db.migratethat retypes a built-in property (the nearest, "65.12", only removes:positionfrom:urlproperties). A fix needs: a schema migration (attribute:db/valueTypeto 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:stringand render the value as a link).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.cljsit keeps master's two new functions and addsclass-property-rows.