Skip to content

feat(newsletter-publishing): convert top-level Columns blocks to beehiiv columns - #199

Merged
phpbits merged 14 commits into
release/1.2.0from
feature/19814725-columns-block-support
Nov 12, 2026
Merged

phpbits merged 14 commits into
release/1.2.0from
feature/19814725-columns-block-support

Conversation

@phpbits

@phpbits phpbits commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

A WordPress Columns block at the top level of a post now converts to one beehiiv columns block. Before, Columns was skipped and its content was lost. Media & Text already used the same conversion.

Teamwork task: https://fueled.teamwork.com/app/tasks/19814725
Closes #167

How it converts

  • Each core/column becomes one column. Its inner blocks go under blocks, in order.
  • A percent width becomes a whole number. A column with no width has no width set.
  • A px, em or rem width becomes that column's share of the row's widths. If any column in such a row has no usable width, no column gets a width.
  • Vertical alignment maps to verticalAlign.
  • stackOnMobile is true by default, as for Media & Text, and false only when the WordPress block opts out.
  • beehiiv accepts at most 3 columns in one columns block. With more columns, or with Columns nested in a column, the inner blocks are sent as ordinary top-level blocks in order. The row is not split.
  • core/columns is now a supported block and core/column is nested-only, so the editor no longer lists them as omitted.

Known difference

A ticket comment (2026-10-21) asked for an error message when a row has more than 3 columns. This PR follows the intake instead: the content is sent as top-level blocks and the editor shows no omitted-block warning.

Also fixed (found by the independent QA run, separate commits)

  • A table's block background color is now sent to beehiiv (eb847c0).
  • A paragraph holding only a non-breaking space is now omitted (711d803).
  • A Media & Text block with no valid image is now omitted whole, as its PRD says (238514a).

Tests

  • PHPUnit: 112 passed.
  • E2E, full suite: 224 passed, 5 skipped (other features), 0 failed, 0 flaky.
  • New E2E specs for the two PRDs (27 tests) are in caa9ecd.
  • Lint: lint:js, lint:css and lint:php pass on PHP 7.4 to 8.5.

Open questions

  • Does the beehiiv API require the column widths in one columns block to total 100? Each width is rounded on its own, so a row can total 99 or 101.
  • How should a row that mixes percent and px widths convert? It currently gets no widths.

…iiv columns

Feature: newsletter-publishing/block-conversion/structured-content-blocks

Implements:
- US-006: A Columns block in a post becomes one beehiiv columns block

Verified:
- AC-008, AC-011 to AC-019 covered by PHPUnit tests
- Up to 3 columns per block; more columns, or columns nested in a column, put their inner blocks at the top level
- px/em/rem widths become a share of the row; percent widths round per column
Covers structured-content-blocks (AC-001 to AC-019) and block-conversion-framework (AC-001 to AC-008). Two specs assert known gaps and currently fail: table background color (AC-010) and a non-breaking-space paragraph (AC-005).
A table with a block background color sent no color. The color is now read from the
block attributes, the table tag, or the figure wrapper, and sent as visual settings
the same way lists and paragraphs send it.
…king space

A paragraph with only a non-breaking space was still sent as a text block. The check
now treats non-breaking spaces as blank.
…id image

The PRD says a Media & Text block with no valid image URL is omitted. The converter
kept the text column instead. The whole block is now omitted.
…iv sidebar is open

The marker adds a class and tooltip to the block's own element instead of wrapping
the block, shows only while the beehiiv sidebar is open, keeps the hidden-eye icon
visible, and also covers posts linked to a scheduled newsletter.
…umns and mark them in the editor

A Columns block with more than 3 columns was sent as top-level blocks. It is now
omitted from the newsletter, and the editor marks it and counts it in the omitted
blocks notice, the same as other blocks the newsletter leaves out. The column limit
is shared with the editor through the block support config.
…mns block's visual settings

A Columns block's background color, text color, padding, margin and border are now sent
as the visual settings of the beehiiv columns block, the same way a Group's styling is
sent for its section. Colors come from custom values or the theme palette. Padding and
margin are sent in whole pixels per side as inner and outer spacing, and rem and em
convert at 16 pixels. The border sends its color, width, style and radius, and a border
with a color or width and no style is sent as solid. Sides, styles and units beehiiv
cannot take are left out so it keeps its default.

The styling code is a self-contained copy of the Group version, so this branch does not
depend on the Group branch. The two can share one class after both land.
…ling

beehiiv holds a container's styling on a section, so a Columns block with a background
color, text color, padding, margin or border that beehiiv can take is now sent as a
section with those visual settings, holding the plain columns block. A Columns block
with no styling that converts stays a plain columns block, and a Columns block with
more than 3 columns, or with nothing convertible inside, is still not sent.
…the columns block's visual settings"

This reverts commit 2a5305b.
@phpbits
phpbits changed the base branch from main to release/1.2.0 November 12, 2026 13:14
@phpbits
phpbits marked this pull request as ready for review November 12, 2026 13:14
…4725-columns-block-support

# Conflicts:
#	includes/Newsletter/BlockConverter.php
#	includes/Newsletter/SupportedBlocks.php
#	tests/e2e/specs/block-conversion-framework.spec.js
@phpbits
phpbits merged commit 1ba0b89 into release/1.2.0 Nov 12, 2026
18 of 26 checks passed
@phpbits
phpbits deleted the feature/19814725-columns-block-support branch November 12, 2026 14:57
@phpbits phpbits mentioned this pull request Nov 12, 2026
phpbits added a commit that referenced this pull request Nov 16, 2026
* feat(editor-integration): preview the real beehiiv email in the post editor (#195)

* feat(editor-integration): preview the real beehiiv email of a saved post in the editor

Adds a Preview email button and modal (desktop and mobile views, from, subject and
preview text, sandboxed inert frame), a REST route that syncs a linked beehiiv draft
from the saved post and fetches the rendered email, and the draft lifecycle it needs:
created on first preview, updated in place, recreated when the publication or template
changes, kept across status changes, removed when Send to newsletter is turned off or
the post is deleted.

* fix(newsletter-publishing): import WP_Error in the sender

* chore: revert unrelated whitespace change in the publication send test

* fix(newsletter-publishing): replace a previewed draft with a real send on publish or schedule

* fix(newsletter-publishing): lock simultaneous previews so only one draft is created

* fix(editor-integration): poll for the preview email from the editor instead of waiting in PHP

* refactor(editor-integration): harden the preview frame, share the post read, and fix the preview E2E expectations

* refactor(editor-integration): share one preview eligibility check, purge stale locks, memoize the inert email, and cover the new paths

* refactor(editor-integration): move preview eligibility into its own class and lengthen the preview lock

* Meet WordPress VIP Integration Center conformance checks (#196)

* feat: meet WordPress VIP Integration Center conformance checks

Add vip-manifest.yaml, run PHPUnit and Playwright from composer test,
and widen the CI matrix to WP 6.9/7.0 and PHP 8.2-8.5.

* feat: read WordPress VIP runtime config

Read the VIP_BEEHIIV_CONFIG array for the API base URL, falling back to the
wp-config constant and the default. Missing or invalid config is ignored.
Add fixtures, tests, and README examples.

* test(e2e): add demo walkthrough recorder and four demo scripts (#202)

* test(e2e): add intake demo recording scripts

Playwright config, helpers and per-intake walkthrough scripts that record
one captioned demo video per intake. Output goes to the gitignored
tests/e2e/test-results/demo/ folder.

* test(e2e): add demo walkthrough for the require-template-choice intake

Records the settings toggle, the empty template field, the blocked send and
the unblocked send on the feature/19814561-settings-require-template build.

* test(e2e): show the pre-publish panel notice in the require-template demo

* test(e2e): add demo walkthrough for the email preview intake

Records the Preview email control, the sandboxed preview modal, the
save-before-preview rule, a failed preview with retry, and the unavailable
state on an already scheduled post.

* test(e2e): add mobile view to the email preview demo

* test(e2e): add demo walkthrough for the subscriber gating intake

* test(e2e): add demo walkthrough for the Group section intake

* Convert Group blocks to beehiiv sections (#200)

* feat(newsletter-publishing): convert Group blocks to beehiiv sections

Feature: newsletter-publishing/block-conversion/block-conversion-framework

Implements:
- US-006: A Group block becomes a beehiiv section holding its converted inner blocks

Posts first synced with this change keep sections on later syncs. Posts synced before it keep omitting Group blocks.

* test(e2e): cover block conversion framework acceptance criteria

* fix(newsletter-publishing): omit Groups nested in a Group from the beehiiv payload

beehiiv rejects a section inside a section, so the post failed to sync.
A Group inside a Group is now omitted with its inner blocks, and the editor
counts it in the omitted-block notice and marks it with the hidden icon.

* test(e2e): cover the editor notice for a Group nested in a Group

* fix(editor): show the omitted-block notice on scheduled posts linked to beehiiv

A linked post turns Send to newsletter off, which hid the notice and the
hidden-block icon while its newsletter was still scheduled and syncing edits.

* style(editor): remove the top margin on the omitted-block notice

* fix(editor): mark omitted blocks on the block element and only while the beehiiv sidebar is open

The marker no longer wraps the block in an extra element. The hidden-eye icon is
drawn on the block itself and stays visible without hovering.

* style(editor): add a gap above the omitted-blocks line only when it follows the send warning text

* Send a Group's background color, text color and padding as the section's visual settings

Colors come from custom values or the theme palette. Padding is sent in whole pixels
per side; rem and em convert at 16 pixels, and sides in percent or fluid units keep
beehiiv's default. Borders and other Group styling are not sent yet.

* Send a Group's border color, width, style and radius as the section's visual settings

A border with a color or width and no style is sent as solid. Palette colors, including
the var:preset|color|slug values the editor stores on a border with a different width
on each side, are sent as their color value. Styles beehiiv does not accept, colors and
styles that differ by side, and widths or radii in percent are not sent.

* Send a Group's margin as outer spacing and resolve theme and fluid spacing sizes

A Group's margin is sent as the section's outer spacing, next to padding as inner
spacing. A size chosen by name from the theme is read from the theme's own definition:
presets are applied in WordPress's order (default, theme, custom), and the default sizes
and colors are skipped when the theme turns them off, so a theme that redefines a default
name no longer gets WordPress's default value. A fluid size (clamp, min or max) is sent
at its widest fixed value.

* Add setting to require editors to choose a post template (#198)

* feat(admin-interface): add require-template-choice setting

Feature: admin-interface/settings-page/publication-template-config

Implements:
- US-007: Require editors to choose a template (setting only; enforcement and editor display live in other PRDs)

Verified:
- AC-014: toggle with the agreed label
- AC-015: off by default
- AC-016: saved state persists
- AC-017: help text covers the three points
- AC-018: shown in the existing connected-only section
- AC-019: publication and template selections unchanged

* test(admin-interface): cover require-template-choice setting in e2e

* feat(newsletter-publishing): block sending until an editor chooses a template

Feature: newsletter-publishing/newsletter-template-selection/post-template-selection

Implements:
- US-004: Require an editor-chosen template (send-time rule)

Verified:
- AC-009: default used when setting off or post already sent
- AC-012: no automatic template when the rule applies
- AC-013: send blocked even with a site default
- AC-014: agreed message, no beehiiv request
- AC-015: all roles
- AC-016: sent posts exempt
- AC-017: chosen template continues
- AC-018: setting off behaves as before

* test(newsletter-publishing): cover required-template rule in e2e

* feat(editor-integration): ask editors to choose a template when required

Feature: editor-integration/editor-sidebar/newsletter-template-selection

Implements:
- US-007: Required template prompt in the editor sidebar

Verified:
- AC-002: default behavior unchanged when the setting is off or the post was sent
- AC-014: empty field with the Choose a template prompt
- AC-015: no pre-selected template and no default label
- AC-016: help text under the empty field
- AC-017: blocked send shows the message through the existing error notice
- AC-018: prompt and help clear once a template is chosen
- AC-019: unchanged when the setting is off or the post was sent

* test(editor-integration): cover required-template prompt in e2e

* fix(editor-integration): show required-template notice as an error in the publish panel

Open the pre-publish panel when the newsletter still needs a template,
show the required-template message as an error, and add top spacing to
beehiiv notices outside the sidebar.

* fix(editor-integration): meet template picker ACs and update tests for the new setting

Show help text for the default template, a loading spinner while templates
load, and an unavailable label for deleted templates. Add publish-panel e2e
tests, and update the settings storage and validation e2e specs for the new
require-template setting.

* feat(newsletter-publishing): convert top-level Columns blocks to beehiiv columns (#199)

* feat(newsletter-publishing): convert top-level Columns blocks to beehiiv columns

Feature: newsletter-publishing/block-conversion/structured-content-blocks

Implements:
- US-006: A Columns block in a post becomes one beehiiv columns block

Verified:
- AC-008, AC-011 to AC-019 covered by PHPUnit tests
- Up to 3 columns per block; more columns, or columns nested in a column, put their inner blocks at the top level
- px/em/rem widths become a share of the row; percent widths round per column

* test(newsletter-publishing): add E2E specs for block conversion PRDs

Covers structured-content-blocks (AC-001 to AC-019) and block-conversion-framework (AC-001 to AC-008). Two specs assert known gaps and currently fail: table background color (AC-010) and a non-breaking-space paragraph (AC-005).

* fix(newsletter-publishing): send table block background color to beehiiv

A table with a block background color sent no color. The color is now read from the
block attributes, the table tag, or the figure wrapper, and sent as visual settings
the same way lists and paragraphs send it.

* fix(newsletter-publishing): omit paragraphs that hold only a non-breaking space

A paragraph with only a non-breaking space was still sent as a text block. The check
now treats non-breaking spaces as blank.

* fix(newsletter-publishing): omit Media & Text blocks that have no valid image

The PRD says a Media & Text block with no valid image URL is omitted. The converter
kept the text column instead. The whole block is now omitted.

* feat(editor): mark omitted blocks on the block itself while the beehiiv sidebar is open

The marker adds a class and tooltip to the block's own element instead of wrapping
the block, shows only while the beehiiv sidebar is open, keeps the hidden-eye icon
visible, and also covers posts linked to a scheduled newsletter.

* style(editor): add a gap above the omitted-blocks line only when it follows the send warning text

* feat(newsletter-publishing): omit Columns blocks with more than 3 columns and mark them in the editor

A Columns block with more than 3 columns was sent as top-level blocks. It is now
omitted from the newsletter, and the editor marks it and counts it in the omitted
blocks notice, the same as other blocks the newsletter leaves out. The column limit
is shared with the editor through the block support config.

* Send a Columns block's colors, padding, margin and border as the columns block's visual settings

A Columns block's background color, text color, padding, margin and border are now sent
as the visual settings of the beehiiv columns block, the same way a Group's styling is
sent for its section. Colors come from custom values or the theme palette. Padding and
margin are sent in whole pixels per side as inner and outer spacing, and rem and em
convert at 16 pixels. The border sends its color, width, style and radius, and a border
with a color or width and no style is sent as solid. Sides, styles and units beehiiv
cannot take are left out so it keeps its default.

The styling code is a self-contained copy of the Group version, so this branch does not
depend on the Group branch. The two can share one class after both land.

* Wrap a styled Columns block in a beehiiv section that carries its styling

beehiiv holds a container's styling on a section, so a Columns block with a background
color, text color, padding, margin or border that beehiiv can take is now sent as a
section with those visual settings, holding the plain columns block. A Columns block
with no styling that converts stays a plain columns block, and a Columns block with
more than 3 columns, or with nothing convertible inside, is still not sent.

* Revert "Wrap a styled Columns block in a beehiiv section that carries its styling"

This reverts commit 34dd1c4.

* Revert "Send a Columns block's colors, padding, margin and border as the columns block's visual settings"

This reverts commit 2a5305b.

* Use theme palette colors and a full title replace in the e2e specs after the release merge

* Pin the E2E job to Ubuntu 24.04 and fix a Prettier error in the structured content spec

* Prepare the 1.2.0 release: bump the version, add the changelog, fill in @SInCE tags, and refresh the POT file

* Keep Group sections when a preview draft is refreshed

* Use a palette slug that Twenty Twenty-Five defines in the Group border and nested list color specs
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.

Map WP Columns -> beehiiv Columns

1 participant