Skip to content

feat(form-builder): add conditional fields, uploads and CSV exports - #355

Merged
olliethedev merged 12 commits into
mainfrom
feat/issue-338-after-v6
Nov 6, 2026
Merged

olliethedev merged 12 commits into
mainfrom
feat/issue-338-after-v6

Conversation

@olliethedev

Copy link
Copy Markdown
Collaborator

Summary

Closes #338.

showIf on fields/steps -> live visibility -> validate visible values -> strip hidden answers
File -> adopter onUpload callback -> URL string
submission.export permission -> paged reads + bounded CSV -> download or visible HTTP 413 error

Adds the visual condition editor, standalone file palette/renderer support, and a separate authorized CSV export operation. The shared form converter preserves rules and validates hook replacement data before persistence. Cross-step fields use accumulated answers for visibility; numeric browser inputs are normalized before conditional validation while server number validation stays strict. Registry pages depend on the maintained shared btst-auto-form and btst-form-builder-ui items, giving each form component one owner across Form Builder, CMS, Ecommerce and UI Builder installs.

Evidence

  • Before: fields and steps were unconditional; there was no standalone file field or submissions CSV action.
    After: 112 focused Form Builder unit/runtime tests pass, including regressions that fill and submit a required cross-step conditional field and submit typed numbers in a conditional single-page form. Two real Next.js Playwright flows pass on the corrected runtime. Coverage includes all operators, hidden required/stale values, nested fields, upload success/failure/retry, authorization, CSV quoting/formula protection, bounded export limits, and visual editing through save/reload.
  • Captioned walkthrough · all screenshots and verification
  • Field condition editor · standalone upload · CSV action

The actual admin export action also returned HTTP 413 (FORM_EXPORT_TOO_LARGE) for 20 public submissions with 1,201 distinct data columns, displayed the size-limit error, and triggered no file download. The report includes an inspected 10.5-second captioned demo and size-limit screenshot; this fixture exercises the column cap.

Media is durably archived and verified, but requires the owner’s archive login plus LAN/private Tailscale access. The walkthrough uses an untracked local upload adapter supplied through onUpload; uploaded bytes and downloaded CSV contents were verified.

Validation: 112 focused Form Builder unit/runtime tests, five CMS nested-config compatibility tests, Form Builder and Components typechecks/builds, focused Biome check, regenerated registry and two registry ownership/source-closure tests pass. Both existing focused Next.js Chromium flows pass on the corrected runtime (3.3 seconds), covering submission, CSV download and visual editing through save/reload. The first browser attempt timed out during repeated development refreshes while a package build was running; the rerun passed after the build finished. Earlier validation includes 12 endpoint-inventory tests, a 390px overflow/keyboard check and the full docs production build on 4b7b385. No docs source changed in this runtime correction, so that build was not repeated. Full local suites and the all-plugin registry install matrix were not run; CI provides broad coverage.

Merge Danger

Door: two-way

No database migration. Hidden answers are intentionally omitted from new submissions. Upload storage, file validation, access and cleanup belong to the adopter callback.

Blast Radius: Forms

Export has its own forms:submission.export grant. Ownerless-form export requires an authenticated identity across the three generated framework examples. Source reads are paged; CSV assembly remains in memory within caps of 10,000 rows, 1,000 data columns, 1,000,000 data cells, and 10 MiB each for source and output. Oversized exports return HTTP 413 with a visible size-limit message. Shared AutoForm/registry source also serves CMS and Ecommerce consumers.

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
better-stack-docs Ready Ready Preview Nov 6, 2026 11:28am UTC
better-stack-playground Ready Ready Preview Nov 6, 2026 11:28am UTC

Request Review

@olliethedev

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T11:31:07.921169Z e025d16 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76bddf97d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/schema-converter.ts Resolved
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size

16 of 194 bundles changed.

Module Gzip base → PR Gzip change Minified change
@btst/plugin-form-builder/client/components 284156 → 287806 B +3650 B (+1.3%) +9901 B (+0.9%)
@btst/components/form-builder 227330 → 230881 B +3551 B (+1.6%) +8407 B (+1.0%)
@btst/plugin-form-builder/client 285845 → 289323 B +3478 B (+1.2%) +9682 B (+0.9%)
@btst/components/stepped-auto-form 194595 → 197158 B +2563 B (+1.3%) +6659 B (+0.9%)
@btst/plugin-job-board/client 503145 → 505617 B +2472 B (+0.5%) +6107 B (+0.3%)
@btst/plugin-job-board/client/components 501342 → 503720 B +2378 B (+0.5%) +6107 B (+0.3%)
@btst/plugin-cms/client 263606 → 265816 B +2210 B (+0.8%) +5687 B (+0.6%)
@btst/plugin-cms/client/components 261093 → 263262 B +2169 B (+0.8%) +5678 B (+0.6%)
@btst/plugin-form-builder/api 109387 → 110909 B +1522 B (+1.4%) +4644 B (+0.9%)
@btst/plugin-ui-builder/client/components 1568996 → 1570501 B +1505 B (+0.1%) +3920 B (+0.1%)

Showing the 10 largest changes by absolute gzip bytes.

ad53b4c → e025d16. Standalone costs; rows overlap. Moved paths appear as new/removed entries, not application savings.

Measured 22 packed archives separately; full report includes their compressed bytes without installed dependencies.

Full report and measurements

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45a9873200

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/lib/schema-converter.ts Resolved

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: e025d16feb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@olliethedev
olliethedev merged commit b1fa73b into main Nov 6, 2026
158 of 162 checks passed

This branch was successfully deployed

2 active deployments
Preview – better-stack-docs — e025d16f Deployed Nov 6, 2026 by vercel[bot]
Preview – better-stack-playground — e025d16f Deployed Nov 6, 2026 by vercel[bot]
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.

Form Builder: conditional showIf rules, standalone file field, and submissions CSV export

1 participant