Skip to content

Accept null sections in config_items.json; fix test:config - #53

Merged
figamore merged 1 commit into
mainfrom
ConfigItemsNullSections
Oct 8, 2026
Merged

figamore merged 1 commit into
mainfrom
ConfigItemsNullSections

Conversation

@MitchBradley

Copy link
Copy Markdown
Collaborator

This follows up #51. That PR was merged at 3ca31cf, before this fix reached its branch.

Problem

  • The real config_items.json is always rejected. The shape check added in c53b17c rejects any section that isn't an object. Field-less types are null in the real file: axes.<letter>.motorN.null_motor, NoSpindle, kinematics.midtbot and kinematics.Cartesian. So FigUI never uses the file and always falls back to its built-in field tables. The test passed only because its fixture had no null section.
  • npm run test:config fails on main. Load FluidNC's config_items.json instead of the retired schema file #51 made ConfigStudio import the store, and the store's module-level browser code (localStorage.getItem("theme")) fails when the test loads ConfigStudio under Node.

Fix

  • parseConfig() now allows null sections. test:config covers this with a NoSpindle: null fixture, and no longer asserts that axes: null is invalid.
  • ConfigStudio no longer imports the store. CodeEditor passes espInfo.version down as a firmwareVersion prop.

Testing

🤖 Generated with Claude Code

- parseConfig() rejected every non-object section, but field-less types
  (null_motor, NoSpindle, kinematics.midtbot/Cartesian) are null in the
  real config_items.json, so the whole file was always rejected. Allow
  null sections, and cover it in test:config (the synthetic fixture had
  no null section, so the test passed while the real file failed).
- ConfigStudio no longer imports the store: its module-level browser
  code (localStorage theme read) broke test:config, which loads
  ConfigStudio under Node. CodeEditor passes espInfo.version down as a
  firmwareVersion prop instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 20:24
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: figamore/FigUI/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2b99d9d-6d2c-4cc8-8558-d576e84982bb
📥 Commits

Reviewing files that changed from the base of the PR and between 2390db8 and e87aafb.

📒 Files selected for processing (4)
  • scripts/test-config-compatibility.mjs
  • src/components/CodeEditor.tsx
  • src/components/ConfigStudio.tsx
  • src/lib/fluidSchema.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes correctly address both reported regressions and include focused test coverage.

0 open findings

What changed in this PR

Allows FluidNC field-less configuration sections and removes ConfigStudio’s direct store dependency.

Changes:

  • Accepts null configuration sections and adds regression coverage.
  • Passes firmware version from CodeEditor into ConfigStudio.
  • Restores Node compatibility for configuration tests.
File Description
src/​lib/​fluidSchema.ts Accepts null field-less sections.
src/​components/​ConfigStudio.tsx Receives firmware version via props.
src/​components/​CodeEditor.tsx Supplies the connected firmware version.
scripts/​test-config-compatibility.mjs Tests null-section parsing.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@figamore
figamore merged commit 04709e4 into main Oct 8, 2026
2 checks passed
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.

3 participants