Skip to content

feat: support rendering of line between columns#2743

Open
Abdeltoto wants to merge 1 commit intosuperdoc-dev:mainfrom
Abdeltoto:feat/column-separator-line
Open

feat: support rendering of line between columns#2743
Abdeltoto wants to merge 1 commit intosuperdoc-dev:mainfrom
Abdeltoto:feat/column-separator-line

Conversation

@Abdeltoto
Copy link
Copy Markdown

Summary

  • Parse w:sep attribute and child element on w:cols in section properties to detect the line-between column setting
  • Add lineBetween flag to ColumnLayout, SectionBreakBlock.columns, and Page types in contracts
  • Propagate lineBetween through the pm-adapter extraction and layout engine page creation
  • Render vertical separator lines in the DomPainter between column gaps when lineBetween is enabled

Files changed

  • Modified: contracts/src/index.ts -- lineBetween on ColumnLayout, SectionBreakBlock, Page
  • Modified: super-converter/section-properties.js -- parse w:sep attribute and child element
  • Modified: pm-adapter/src/sections/extraction.ts -- extract lineBetween from w:cols
  • Modified: layout-engine/src/index.ts -- carry activeColumns to page
  • Modified: painters/dom/src/renderer.ts -- render vertical lines in inter-column gaps

Test plan

  • All existing tests pass
  • Pre-commit hooks pass (format + lint + commitlint)
  • Test with a .docx file containing multi-column layout with line-between enabled

Closes #2067

Parse the w:sep attribute and child element on w:cols in section
properties to detect the "line between" column setting. Carry the
lineBetween flag through ColumnLayout, SectionBreakBlock, and Page
types so the DomPainter can render vertical separator lines in the
inter-column gaps.

Closes superdoc-dev#2067

Made-with: Cursor
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb1d82966f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1075 to +1076
if (activeColumns && activeColumns.count > 1) {
page.columns = activeColumns;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve lineBetween when attaching columns to page

page.columns = activeColumns assumes the new lineBetween flag survives section-state cloning, but cloneColumnLayout currently drops that field (packages/layout-engine/contracts/src/column-layout.ts, function cloneColumnLayout). As a result, page.columns.lineBetween is typically undefined even when <w:cols w:sep="1"> is parsed, so the separator rendering path never activates. Please propagate lineBetween through the column clone/state pipeline before assigning it to the page.

Useful? React with 👍 / 👎.

Comment on lines +2231 to +2233
// Render vertical separator lines between columns when lineBetween is enabled
if (page.columns?.lineBetween && page.columns.count > 1 && page.margins && this.doc) {
const cols = page.columns;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Draw column separators in the vertical rendering path

This separator logic was added only to renderPage, but the default vertical/non-book flow renders pages via fullRender/patchLayout/virtualization, which build DOM through createPageState instead of renderPage (same file). In those modes, separators are never created, so users in standard vertical mode won’t see the new line-between-columns feature. The separator rendering needs to be shared with or duplicated in the createPageState path.

Useful? React with 👍 / 👎.

@caio-pizzol caio-pizzol self-assigned this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: support rendering of line between columns

2 participants