Fix: Select option values displaying with quotes and checkbox sync issues#530
Open
hypnosis wants to merge 4 commits intoMake-md:mainfrom
Open
Fix: Select option values displaying with quotes and checkbox sync issues#530hypnosis wants to merge 4 commits intoMake-md:mainfrom
hypnosis wants to merge 4 commits intoMake-md:mainfrom
Conversation
added 4 commits
January 14, 2026 20:48
Fixes issue where editing options in table properties would not save correctly. Changes: - Fix PropertyValue.tsx: Save options and colorScheme atomically to prevent data loss - Fix EditOptionsModal.tsx: Auto-close color picker menu after color selection - Fix OptionCell.tsx: Prioritize individual option colors over color scheme - Fix package.json: Correct typo in dev script (nnode -> node) - Update tsconfig.json: Change target from es6 to es2020 to support regex dotall flag - Update .gitignore: Add data.json to ignore user settings The main issue was that calling saveParsedValue twice would overwrite the first save with stale data. Now both fields are saved in a single atomic operation.
Fixed issue where checkbox properties in the top section (inline properties) were not updating when changed in the bottom Properties section. Root cause: PropertiesView component was only listening to 'contextStateUpdated' events, which are not triggered when individual file properties are saved via saveProperties(). When a checkbox is toggled, it saves via saveProperties() which triggers 'pathStateUpdated' event instead. Solution: Added listener for 'pathStateUpdated' event to refresh property values when the current path's properties change. This ensures both property sections stay in sync. Changes: - Added pathChanged() handler to listen for pathStateUpdated events - Added pathState to useEffect dependencies for proper cleanup - Properties now refresh immediately when any property is saved
**Bug Description:** When adding or modifying select (option) property values in the Properties panel, the values were being incorrectly serialized as JSON arrays (e.g., ["approve"]) instead of plain strings (e.g., "approve"). This caused the values to display with quotes in the UI and broke the select dropdown functionality. **Root Causes:** 1. OptionCell was using serializeMultiDisplayString() for single select values, which was unnecessary and caused incorrect serialization 2. parseProperty() was called without explicit type information, causing detectPropertyType() to misidentify single option arrays as option-multi 3. No safeguards existed to handle array values when parsing single options **Changes Made:** 1. **OptionCell.tsx**: Changed single option value serialization from serializeMultiDisplayString() to direct value access (value[0] ?? "") in savePropValue() and removeOption() methods 2. **PropertiesView.tsx**: Modified property parsing to pass explicit column type to parseProperty(), preventing type misdetection 3. **parsers.ts**: Added array handling in parseProperty() for option type to extract first element if value is unexpectedly an array 4. **properties.ts**: Added safety check in parseMDBStringValue() to parse and extract single values from JSON array strings when saving to frontmatter **Testing:** - Single select options now save and display correctly without quotes - Multi-select options continue to work as expected - Select dropdowns function properly after value changes
…e misdetection
**Bug Description:**
When property values were parsed from frontmatter in PropertiesView and
syncContextRow, the type parameter was not passed to parseProperty(). This
caused detectPropertyType() to auto-detect types based on the value format
rather than using the actual field schema definition.
For example, a single-select option field with an array value like ["approve"]
in frontmatter would be misdetected as option-multi instead of option, causing:
1. Values to display incorrectly with quotes
2. Checkbox properties not syncing between top and bottom views
**Root Cause:**
Two locations were calling parseProperty() without the type parameter:
1. PropertiesView.tsx line 100 - when loading properties from frontmatter
2. linkContextRow.ts line 94 - when syncing context rows with frontmatter
This caused the system to rely on detectPropertyType() which makes assumptions
based on value format (arrays → multi-type) rather than using the actual
schema definition.
**Changes Made:**
1. **PropertiesView.tsx** (line 87-95):
- Added lookup in both tableData.cols AND columns (from context schemas)
- This ensures properties defined in context schemas are found correctly
- Pass the resolved field type to parseProperty() on line 100
2. **linkContextRow.ts** (line 92-96):
- Modified filteredFrontmatter reduce function to find field type from
fields array before calling parseProperty()
- Pass the field type as third parameter to parseProperty()
**Impact:**
- Single-select options now parse correctly even when stored as arrays
- Boolean checkboxes sync properly between top properties and bottom panel
- Multi-select options continue to work as expected
- Type detection now respects schema definitions over value format
**Testing:**
- ✅ Single select with array value displays without quotes
- ✅ Boolean checkboxes sync between top and bottom views
- ✅ Multi-select options work correctly
- ✅ Properties from context schemas resolve proper types
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 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)