Skip to content

fix: form builder + cms#118

Merged
olliethedev merged 4 commits into
mainfrom
fix/form-builder-cms
Apr 17, 2026
Merged

fix: form builder + cms#118
olliethedev merged 4 commits into
mainfrom
fix/form-builder-cms

Conversation

@olliethedev
Copy link
Copy Markdown
Collaborator

@olliethedev olliethedev commented Apr 17, 2026

Summary

  • fix form builder nested field-type
  • fix form builder inverse-relation UI labeling
  • fix cms injected components at any nesting depth
  • fix cms inverse-relations panel
  • exporting blog ui components

Type of change

  • Bug fix
  • New plugin
  • Feature / enhancement to an existing plugin
  • Documentation
  • Chore / refactor / tooling

Checklist

  • pnpm build passes
  • pnpm typecheck passes
  • pnpm lint passes
  • Tests added or updated (unit and/or E2E)
  • Docs updated (docs/content/docs/) if consumer-facing types or behavior changed
  • All three codegen-projects create successfully and pass E2E tests
  • New plugin: submission checklist in CONTRIBUTING.md completed

Screenshots


Note

Medium Risk
Changes the CMS auto-form field-config generation and nested field-type injection (including arrays-of-objects), which can affect how existing admin forms render and validate. Also tweaks inverse-relation UI labeling and adds new public blog client exports, with moderate integration surface area.

Overview
Improves CMS auto-form support for arrays of objects by recursively propagating per-item .meta() config (placeholders, fieldType, custom field components) from JSON Schema items.properties, with safeguards/warnings for reserved FieldConfigItem key collisions and new unit coverage.

Updates CMS ContentForm to inject built-in file and relation components at any nesting depth (including inside array items), and tweaks the inverse-relations panel to disambiguate duplicate source-type sections by appending a humanized field name.

Exposes additional blog client UI building blocks (e.g. PostCard, PostsList, TagsList, skeletons, navigation, carousel) via a new @btst/stack/plugins/blog/client/components export, bumps @btst/stack to 2.11.5, and extends tooling/docs to cover repeating groups plus ignore generated Playwright codegen traces.

Reviewed by Cursor Bugbot for commit 4da908f. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
better-stack-docs Ready Ready Preview, Comment Apr 17, 2026 7:04pm
better-stack-playground Ready Ready Preview, Comment Apr 17, 2026 7:04pm

Request Review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Security Assessment — No High-Confidence Vulnerabilities Found

Reviewed all changes introduced by this PR against the threat checklist. No exploitable vulnerabilities were identified. Findings by area:

content-form.tsx — Recursive injectCustomFieldTypes

The new recursive function walks prop.properties and items.properties to inject CMS-specific field components (file upload, relation picker). The recursion is bounded by the JSON Schema structure, which originates from the server-side content type configuration (a trusted, admin-controlled source). No user-supplied input directly drives the recursion depth, and JSON.parse cannot produce circular references, so stack-overflow DoS is not a realistic concern. The prop.fieldType and prop.relation values read from the schema are used only to select which React component to render — not to execute code or build queries — so there is no injection path here.

helpers.tsx — Array-item recursion in buildFieldConfigFromJsonSchema

The new items.properties branch mirrors the existing nested-object branch. The reservedProps guard prevents item-level property names from clobbering parent-level config (e.g., description, label, fieldType). The cast value.items as JsonSchemaProperty is safe because an array-typed items (tuple schema) would have no .properties, causing the block to silently skip — no security consequence.

inverse-relations-panel.tsxhumanizeFieldName / ambiguous

humanizeFieldName performs pure regex string transformations (strip trailing Id/Ids, split camelCase) on relation.fieldName, a server-supplied field name. The result is rendered as plain React text content — not as HTML — so there is no XSS vector. The pre-existing URL construction in handleAddNew (prefill_${relation.fieldName}=${itemId}) does not URL-encode its components; however, relation.fieldName is a schema-level identifier controlled by the application developer, and itemId is typically a UUID or opaque key. This pattern predates this PR and is a low-severity hardening opportunity rather than a new vulnerability.

New @btst/stack/plugins/blog/client/components export

Re-exports existing internal components (PostCard, PostsList, etc.) at a new public entry point. No new attack surface is introduced — these components were already reachable at runtime; only their TypeScript import path changes.

biome.json lint ignore

Adds !**/playwright-report-codegen/trace/** to the lint-ignore list. This is a tooling change and has no security impact.


Summary: All diff changes are constrained to client-side rendering logic driven by server-controlled schema data. No injection, authentication/authorization, secrets, XSS, SSRF, or supply-chain risks were introduced.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

@github-actions
Copy link
Copy Markdown
Contributor

Shadcn registry updated — registry JSON files were rebuilt and committed to this branch.

@olliethedev olliethedev merged commit 0081473 into main Apr 17, 2026
3 checks passed
@olliethedev olliethedev deleted the fix/form-builder-cms branch April 17, 2026 19:08
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