Fix: Select option values displaying with quotes and checkbox sync issues #530
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 Description
When working with select (option) properties in the Properties panel, two critical bugs were discovered:
Select values displayed with quotes: When adding or modifying select option values in the bottom Properties panel, they appeared with quotes in the UI (e.g.,
["approve"]instead ofapprove), breaking the select dropdown functionality.Checkbox properties not syncing: Boolean checkbox values changed in the bottom Properties section did not update in the top properties view, causing data inconsistency.
Root Cause Analysis
The issues stemmed from two related problems in property value handling:
1. Incorrect Serialization (Select Options)
OptionCell.tsxwas usingserializeMultiDisplayString()for single-select values["value"]instead of"value"2. Type Misdetection (All Properties)
parseProperty()was being called without explicit type information in two critical locations:PropertiesView.tsxwhen loading properties from frontmatterlinkContextRow.tswhen syncing context rows with frontmatterdetectPropertyType()which auto-detects types based on value format["approve"]were misdetected asoption-multiinstead ofoptionSolution
Commit 1: Fix Select Option Serialization
Files changed:
OptionCell.tsx,PropertiesView.tsx,parsers.ts,properties.tsOptionCell.tsx: Changed single option value serialization from
serializeMultiDisplayString()to direct value access (value[0] ?? "") in:savePropValue()methodremoveOption()methodparsers.ts: Added array handling in
parseProperty()for option type to extract first element if value is unexpectedly an arrayproperties.ts: Added safety check in
parseMDBStringValue()to parse and extract single values from JSON array strings when saving to frontmatterCommit 2: Fix Type Detection in Property Parsing
Files changed:
PropertiesView.tsx,linkContextRow.tsPropertiesView.tsx (lines 87-100):
tableData.colsANDcolumns(from context schemas)parseProperty()linkContextRow.ts (lines 92-96):
filteredFrontmatterreduce function to find field type from fields arrayparseProperty()Testing
✅ Select Options
✅ Boolean Checkboxes
✅ Type Detection
Impact
Screenshots
Before
["approve"](with quotes)After
approve(clean display)Related Issues: Fixes property value serialization and type detection bugs
Type: Bug Fix
Priority: High (affects data display and UX)