Skip to content

feat(form) - Add transformer hook#986

Merged
gabrielseco merged 7 commits intomainfrom
add-transformer-hook
May 5, 2026
Merged

feat(form) - Add transformer hook#986
gabrielseco merged 7 commits intomainfrom
add-transformer-hook

Conversation

@gabrielseco
Copy link
Copy Markdown
Collaborator

@gabrielseco gabrielseco commented May 1, 2026

Add transformer hook to transform in the future the description strings to HTML

Extracted from: #979

The change doesn't affect at all anybody as the transformHtmlToComponents will be undefined

Had to change the mocking of some tests to avoid breakage


Note

Medium Risk
Touches shared FormDescription rendering to optionally transform sanitized HTML into React nodes, which could impact how descriptions display across forms if a transformer is provided.

Overview
Adds an optional transformHtmlToComponents callback to FormFieldsContext and a new useTransformer hook to access it.

Updates BaseFormDescription to sanitize string descriptions and, when a transformer is present, render the transformed React output instead of dangerouslySetInnerHTML (with extra data-* markers for diagnostics).

Refactors multiple unit tests to use async partial mocking of @/src/context to preserve new exports, and adds coverage for transformer behavior (custom transforms, complex HTML, and sanitization).

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 211.89 kB 211.73 kB +165 B (+0.1%) 🔴
Total (raw) 572.58 kB 572.06 kB +527 B (+0.1%) 🔴
CSS (gzip) 20.69 kB 20.69 kB 0 B (0%) 🟢
CSS (raw) 107.95 kB 107.95 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 211.89 kB / 250 kB (84.8%)
  • ✅ Total raw: 572.58 kB / 600 kB (95.4%)
  • ✅ CSS gzipped: 20.69 kB / 25 kB (82.8%)

Largest Files (Top 5)

  1. chunk-BQ5YDUNS.js - 13.99 kB (new)
  2. styles.css - 10.35 kB (0 B (0%))
  3. index.css - 10.35 kB (0 B (0%))
  4. index.js - 6.08 kB (+8 B (+0.1%))
  5. chunk-TNQKP2XT.js - 5.89 kB (0 B (0%))
View All Files (313 total)
File Size (gzip) Change
chunk-BQ5YDUNS.js 13.99 kB new
styles.css 10.35 kB 0 B (0%)
index.css 10.35 kB 0 B (0%)
index.js 6.08 kB +8 B (+0.1%)
chunk-TNQKP2XT.js 5.89 kB 0 B (0%)
chunk-R7JA2EDU.js 5.81 kB new
chunk-MHLREAYY.js 4.55 kB new
chunk-67T5LPKP.js 4.29 kB new
chunk-RDKCWDI2.js 4.06 kB new
chunk-QT67GTAK.js 3.73 kB new

✅ Bundle size check passed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-initt7634-remotecom.vercel.app
Latest Commit:55b05ba
Inspect:View deployment

Deployed with vercel-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 89.97% 89.95% +0.02% 🟢
Statements 89.64% 89.62% +0.02% 🟢
Functions 87.70% 87.69% +0.01% 🟢
Branches 80.00% 80.01% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 3659 / 4067
  • Coverage: 89.97%
  • Change: +0.02% (8 lines)
Statements Coverage
  • Covered: 3720 / 4150
  • Coverage: 89.64%
  • Change: +0.02% (8 statements)
Functions Coverage
  • Covered: 998 / 1138
  • Coverage: 87.70%
  • Change: +0.01% (1 functions)
Branches Coverage
  • Covered: 2268 / 2835
  • Coverage: 80.00%
  • Change: 0% (3 branches)

✅ Coverage check passed

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b213c80. Configure here.

Comment thread src/components/ui/form.tsx
@gabrielseco gabrielseco merged commit 3622d1e into main May 5, 2026
10 checks passed
@gabrielseco gabrielseco deleted the add-transformer-hook branch May 5, 2026 10:12
@gabrielseco gabrielseco mentioned this pull request May 8, 2026
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