Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: keep closed values for property icons (fixes logseq/db-test#1173) - #13201

Open
Aung-Min-Myat wants to merge 1 commit into
logseq:masterfrom
Aung-Min-Myat:fix/1173-property-icons
Open

fix: keep closed values for property icons (fixes logseq/db-test#1173)#13201
Aung-Min-Myat wants to merge 1 commit into
logseq:masterfrom
Aung-Min-Myat:fix/1173-property-icons

Conversation

@Aung-Min-Myat

Copy link
Copy Markdown
Contributor

Problem

Property option icons do not render on tag pages. On the #Task page the Status column shows "Doing" and "Todo" as plain text, while the Status property 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-values is 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 returns entity-forward-map results. 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-objects passes the live page entity directly.

The built-in-property fallback in views.cljs:80 would have covered built-in properties, but build-columns only applies it when :db/ident is absent, and the worker map always has one.

Fix

Attach the closed values in get-class-properties, flattened with the same select-keys shape already used by :thread-api/get-property-closed-values, so :logseq.property/icon survives. 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-icons to src/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 #Task page shows icons, the Status property page is unchanged, and a user-defined closed-value property also shows its icons.

Platforms

Shared worker code, compiled into the db-worker build used by Desktop, Web and Mobile. No platform-specific code is involved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property option icons are not displayed on #Task pages

1 participant