Repository navigation
Fix Custom Fields save serialization by moving settings.js to stable data hooks - #358
Merged
Merged
Conversation
2 tasks done
Co-authored-by: admonstrator <69824+admonstrator@users.noreply.github.com>
Co-authored-by: admonstrator <69824+admonstrator@users.noreply.github.com>
Co-authored-by: admonstrator <69824+admonstrator@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix custom fields saving issue due to outdated CSS selectors
Fix Custom Fields save serialization by moving settings.js to stable data hooks
Sep 25, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The selector fix is consistent across generated and rendered rows, with targeted regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes Custom Fields persistence by aligning serialization with stable data attributes in the settings UI.
Changes:
- Adds shared selectors and safer Custom Fields serialization.
- Adds data hooks to server-rendered fields.
- Registers focused selector-drift regression coverage.
| File | Description |
|---|---|
public/js/settings.js |
Uses stable data hooks for serialization and duplicate detection. |
views/settings.ejs |
Adds matching hooks to rendered fields. |
tests/test-settings-custom-fields-selector-sync.js |
Verifies selector and markup alignment. |
scripts/run-tests.js |
Registers the regression test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Custom Fields could be added in the Settings UI but failed to persist on save because
settings.jsstill parsed rows using outdated Tailwind-era selectors. This caused client-side serialization failures and leftcustom_fieldsempty.Custom field serialization now uses explicit data hooks
updateCustomFieldsJson()now reads:data-field-namedata-field-typeServer-rendered rows now expose the same contract as JS-created rows
data-field-nameanddata-field-typeto existing Custom Fields rows inviews/settings.ejs.Duplicate-name detection aligned with the same selector contract
addCustomField()duplicate checks now query the shared name hook instead of legacy class-based selectors.Regression guard for selector drift
tests/test-settings-custom-fields-selector-sync.jsto assert:scripts/run-tests.jsassettings-custom-fields-selector-sync.