Skip to content

fix(server): Omit null fields in control JSON editor#157

Merged
lan17 merged 3 commits intomainfrom
fix/omit-null-control-json
Apr 1, 2026
Merged

fix(server): Omit null fields in control JSON editor#157
lan17 merged 3 commits intomainfrom
fix/omit-null-control-json

Conversation

@lan17
Copy link
Copy Markdown
Contributor

@lan17 lan17 commented Apr 1, 2026

Summary

This updates the control JSON editor so null object fields are not rendered in Full JSON mode.

What changed

  • Added a recursive UI-side normalizer that removes object properties whose values are null
  • Used that normalized shape when seeding the edit-control modal state
  • Used null-free stringification when switching from form mode to Full JSON mode
  • Added a regression test covering a composite condition tree with nullable transport fields

Why

Controls are not persisted with these null keys in the database, but the UI was rendering the nullable transport shape returned by the API. That made Full JSON mode noisy with entries like "or": null and "selector": null.

Validation

  • pnpm exec eslint src/core/page-components/agent-detail/modals/edit-control/edit-control-content.tsx src/core/page-components/agent-detail/modals/edit-control/utils.ts tests/agent-detail.spec.ts

Notes

  • Full Playwright verification is currently blocked locally by unrelated UI environment issues, including a missing motion/react module when starting a fresh dev server.
  • make ui-typecheck also currently fails elsewhere in the UI for unrelated type errors.

@lan17 lan17 changed the title [codex] Omit null fields in control JSON editor feat(ui): Omit null fields in control JSON editor Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lan17 lan17 changed the title feat(ui): Omit null fields in control JSON editor feat(server): Omit null fields in control JSON editor Apr 1, 2026
@lan17 lan17 marked this pull request as ready for review April 1, 2026 00:27
@lan17 lan17 changed the title feat(server): Omit null fields in control JSON editor fix(server): Omit null fields in control JSON editor Apr 1, 2026
@lan17 lan17 merged commit 0aa2f3c into main Apr 1, 2026
8 checks passed
@lan17 lan17 deleted the fix/omit-null-control-json branch April 1, 2026 02:06
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.

2 participants