Skip to content

Fix editor omicronBoost and add unknown property validation#59

Merged
NducTiOnomBi merged 4 commits into
mainfrom
feature/editor-fixes-and-unknown-property-validation
Apr 15, 2026
Merged

Fix editor omicronBoost and add unknown property validation#59
NducTiOnomBi merged 4 commits into
mainfrom
feature/editor-fixes-and-unknown-property-validation

Conversation

@NducTiOnomBi

Copy link
Copy Markdown
Owner

Summary

Fixes the visual editor writing to a non-existent omicronBoost property (should be omicronEnhancement per schema) and adds validation to catch unknown properties.

Changes

Bug Fixes (editor.js)

  • Property name mismatch — All omicronBoost data property references renamed to omicronEnhancement to match the JSON schema. The editor was previously reading/writing an invalid property name.
  • getElementById case mismatch — Fixed chkHasOmicronBoostchkHasomicronBoost (matching actual HTML element ID), which was preventing omicron changes from enabling the Update Character button.
  • UI identifier cleanup — Renamed all related HTML IDs, function names, and variables from omicronBoost to omicronEnhancement for consistency.

New Validation (VisualEditorFunctions.psm1)

  • Unknown property detectionTest-CharacterData now validates that character objects only contain properties defined in the schema. Catches typos and invalid properties like omicronBoost.

Tests

  • Added Pester test for unknown property detection
  • All 61 tests pass

Validation

  • Editor correctly reads/writes omicronEnhancement
  • Update Character button enables on omicron changes
  • Unknown property omicronBoost on MAZKANATA is caught by validation
  • All 61 Pester tests pass

NducTiOnomBi and others added 4 commits April 14, 2026 21:30
- Rewrite ValidateCharacterData.ps1 to use module's Test-CharacterData
  instead of duplicating validation logic (~500 lines to ~210 lines)
- Add synergy slot limit validation to Test-CharacterData
- Add skipIfPresentCharacters cross-reference validation
- Add character ID format validation (uppercase/numbers/underscores)
- Fix single-element array unwrapping in ConvertTo-CharacterArray
- Fix JSON array serialization for single validation errors in editor
- Fix $Error variable conflict (eliminated with duplicate code removal)
- Add test for JSON array serialization of single errors
- All 60 Pester tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace hardcoded C:\ paths with cross-platform TestDrive paths
so tests pass on both Windows and ubuntu-latest runners.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…alidation

- Rename all omicronBoost references to omicronEnhancement in editor.js
  to match the JSON schema property name (was writing invalid property)
- Fix case mismatch in getElementById calls that prevented omicron
  boost changes from enabling the Update Character button
- Add unknown property validation to Test-CharacterData (catches
  properties not defined in the schema, e.g. omicronBoost on MAZKANATA)
- Rename UI element IDs for consistency (inputomicronBoost→
  inputomicronEnhancement, chkHasomicronBoost→chkHasomicronEnhancement)
- Add Pester test for unknown property detection
- All 61 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Kept unknown property validation and test from this branch
that were removed during merge with main (PR #58 changes).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NducTiOnomBi
NducTiOnomBi merged commit 6cfe380 into main Apr 15, 2026
1 check passed
@NducTiOnomBi
NducTiOnomBi deleted the feature/editor-fixes-and-unknown-property-validation branch April 15, 2026 05:31
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.

1 participant