Repository navigation
Keep the label markup in field previews drawn in the browser - #3706
Conversation
Previews drawn in the browser put the field name straight into the
label, with no frm_builder_field_name span, and left the required
indicator without its frm_required_indicator_{id} id. Live label
edits then replaced the whole label, removing the required indicator,
the tooltip indicator and the collapsed tag. Required indicator edits
did not reach the preview at all.
Match the PHP preview markup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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 43 minutes. View limit details
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. |
There was a problem hiding this comment.
Approve. Nothing blocking, no notes.
The drawn preview now builds the same label markup as show_label_on_form_builder() in PHP: the name sits in span.frm_builder_field_name and the required span carries frm_required_indicator_{id}. admin.js already writes live label edits into .frm_builder_field_name and the Required Indicator input already targets frm_required_indicator_{id}, so those two hooks now find their targets. The bundle matches the source: frm-label-text is gone, the new frm_builder_field_name assignment and frm_required_indicator_ id are in. Its other differences are webpack module ids, as usual after a rebuild. The label still goes through the same server-side kses + force_balance_tags as before, now via innerHTML on the span instead of insertAdjacentHTML, so no new injection path.
Live bug repro, before and after (preview env, Lite at master 76c0064 vs PR head c3672c1, form of 16 required text fields forced into the deferred/drawn path with a mu-plugin; field 14 selected):
| Step | master | PR |
|---|---|---|
| Label markup after load | Field 14 <span class="frm_required">*</span> … (bare text, no name span, no id on the indicator) |
<span class="frm_builder_field_name">Field 14</span> <span class="frm_required" id="frm_required_indicator_19">*</span> … |
Edit label to Renamed 14 |
whole label replaced by the bare text Renamed 14; asterisk, collapsed tag and tooltip indicator gone |
name changes, asterisk, (Collapsed) tag and tooltip indicator stay |
Required Indicator set to !! |
nothing changes (label stays Renamed 14) |
indicator span reads !! |
PR head after both edits (field 14):
Siblings checked on the PR, on both field 1 and field 14: a label of <b>Bold</b> & more renders as bold text inside the name span with the other parts intact; toggling Required hides and shows the indicator (frm_hidden added and removed); clearing the indicator leaves it empty.
Tests run: node --test tests/js/*.test.mjs at c3672c11e → 17 pass, 1 fail (style-live-preview.test.mjs: @babel/core isn't installed in the scratch checkout; it's a styler test the PR doesn't touch). CI on this PR shows every job as "skipping".
Not run: PHPCS/PHPStan/Oxlint, the 300+ field Online Submission form from the PR description, Pro-only field types in the drawn path, keyboard or screen-reader checks. No automated test covers the drawn label markup; the repo has no browser-less harness for fieldPreviews.js, so I did not ask for one.
Heads up, not a finding: the PR is 13 commits behind master and rebuilds js/formidable_admin.js, so it will conflict with any other builder PR that lands first (the description says the same).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Nov 16, 2026 7:14p.m. | Review ↗ | |
| JavaScript | Nov 16, 2026 7:14p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Field previews drawn in the browser (the deferred previews from 5ed1a1949, not released yet) put the field name straight into the label. They had no
frm_builder_field_namespan, and the required indicator had nofrm_required_indicator_{id}id. The PHP preview has both.As a result, editing the field label replaced the whole label and removed the required asterisk, the tooltip indicator and the "(Collapsed)" tag. Changing the Required Indicator setting did not update the preview.
This makes the drawn markup match the PHP preview. It is split out of #3672 so it can go out with the next release, since the regression ships with the deferred previews otherwise.
Testing
!!. Before: nothing changed in the preview. After: the preview shows!!.Verified in a browser on the dev site, with Pro active, against master's bundle (bug reproduced) and this branch's bundle (fixed). No new debug log entries.
js/formidable_admin.jsis rebuilt, so it will conflict with other open builder PRs. Rebuild to resolve.🤖 Generated with Claude Code