fix: keep closed values for property icons (fixes logseq/db-test#1173) - #13201
Open
Aung-Min-Myat wants to merge 1 commit into
Open
fix: keep closed values for property icons (fixes logseq/db-test#1173)#13201Aung-Min-Myat wants to merge 1 commit into
Aung-Min-Myat wants to merge 1 commit into
Conversation
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.
Problem
Property option icons do not render on tag pages. On the
#Taskpage the Status column shows "Doing" and "Todo" as plain text, while theStatusproperty page shows the same values with their icons. It affects every property that has closed values, not only Status.Reproduced on 2.0.1-alpha+nightly.20260908, Windows.
Cause
:property/closed-valuesis a virtual attribute backed by the reverse reference:block/_closed-value-property(entity_plus.cljc:180). It resolves only on a live DataScript entity.A tag page loads its columns through
:thread-api/get-class-properties, which returnsentity-forward-mapresults. That function reads forward datoms only, so the reverse lookup is lost and the property reaches the UI without its closed values.select-item(components/property/value.cljs:1491) gates the icon branch on(seq (:property/closed-values property)). With the key gone, rendering falls through to the plain-text branch.Property pages were unaffected because
property-related-objectspasses the live page entity directly.The
built-in-propertyfallback inviews.cljs:80would have covered built-in properties, butbuild-columnsonly applies it when:db/identis absent, and the worker map always has one.Fix
Attach the closed values in
get-class-properties, flattened with the sameselect-keysshape already used by:thread-api/get-property-closed-values, so:logseq.property/iconsurvives. The logic is extracted into a plain function so it can be unit tested.Fixes logseq/db-test#1173.
Tests
Added
get-class-properties-keeps-closed-values-for-iconstosrc/test/frontend/worker/handler/property_test.cljs, covering that closed values and their icons survive the worker boundary, and that properties without closed values keep their existing map shape.Verified by hand that the
#Taskpage shows icons, theStatusproperty page is unchanged, and a user-defined closed-value property also shows its icons.Platforms
Shared worker code, compiled into the
db-workerbuild used by Desktop, Web and Mobile. No platform-specific code is involved.