Conversation
tommy230
force-pushed
the
fix/import-compound-submit-button
branch
from
September 28, 2026 20:30
3d4d864 to
77ee803
Compare
7 of 8 tasks
base.submit was a leaf whose only content was the label string, with a 'Submit' fallback for buttons with no text. Submit buttons that carry an icon instead of text (an inline svg, an icon-font <i>, an <img>) lost the icon on import and published as the literal word "Submit". base.submit now accepts children and renders them when it has any, falling back to the label when it has none (the base.link contract, shared between the publisher render and the canvas via forms/content.ts). The importer recurses into submit buttons with element children instead of flattening them to a label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tommy230
force-pushed
the
fix/import-compound-submit-button
branch
from
September 29, 2026 00:02
77ee803 to
1eea45a
Compare
tommy230
marked this pull request as ready for review
September 29, 2026 04:47
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A submit button that carries an icon instead of text loses the icon on HTML import. A newsletter form whose submit is an arrow drawn as an inline
<svg>, a search box whose submit is an icon-font<i>, or a form whose submit is an<img>all import asbase.submitwith only the'Submit'fallback label, and the published page shows that word where the icon was.This is the case #476 deliberately left out.
base.submitinsrc/modules/base/forms/index.tsis a leaf whose only content is thelabelprop, so the button rule insrc/core/htmlImport/rules.tsdoes not recurse into submit buttons andsubmitLabel()falls back to'Submit'. The comment there notes that lifting this needsbase.submitto accept children; this change does that.The fix:
base.submitaccepts children and renders them when it has any, falling back tolabelonly when it has none. The rule lives insrc/modules/base/forms/content.tsand is shared by the publisher render and the canvas preview, the same shapebase.linkuses.<svg>, an icon-font<i>, or an<img>survives as child nodes. Text-only submits still import as a childlessbase.submitwith their label, and<input type="submit">is unchanged.base.submitrather than becoming a container, socore/formsstill finds the form's submit control by module id.Trade-off: the Form Settings panel and the form snapshot still read the submit's
labelprop, so an icon-only submit shows as "Submit" there even though the canvas and the published page show the icon. That is cosmetic and left alone here.Overlaps with #575 on adjacent
docs/features/html-import.mdbullets; whichever lands second gets a small rebase.Verification
bun run buildbun run lintbun test: 7061 pass, 0 failNew tests in
src/__tests__/htmlImport/submitButtonChildren.test.ts: 6 of 8 fail onmainand pass with this change; the two that pass either way cover the unchanged text-only and label-fallback cases. The existingstructurePreservationtest that pinned the old label-only behaviour now asserts the children are kept.Checklist
docs/features/html-import.md: the button row and the "Button-like elements keep what they wrap" note;docs/features/modules.mdanddocs/reference/module-engine.md.)🤖 Generated with Claude Code