Skip to content

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

Draft
phpbits wants to merge 8 commits into
mainfrom
feature/19814725-columns-block-support
Draft

phpbits wants to merge 8 commits into
mainfrom
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.
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