Skip to content

fix: render image borders in the layout painter#429

Merged
jan-kubica merged 2 commits into
mainfrom
cursor/eigenpal-image-borders-6b1a
Jul 19, 2026
Merged

fix: render image borders in the layout painter#429
jan-kubica merged 2 commits into
mainfrom
cursor/eigenpal-image-borders-6b1a

Conversation

@jan-kubica

@jan-kubica jan-kubica commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Image border attrs already lived on the ProseMirror image node (borderWidth / borderColor / borderStyle), but the paged layout painter ignored them, so borders had no visual effect.

Changes

  • Propagate border attrs through ImageRun / ImageBlock
  • Apply CSS borders when painting floating, inline, block, cropped, and rotated images
  • Keep folio's borderStyle naming throughout
Open in Web Open in Cursor 

Co-authored-by: Jan Kubica <jan-kubica@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b18274a-f2a9-4a1b-9c2e-bd877d2a6560

📥 Commits

Reviewing files that changed from the base of the PR and between 3229068 and 85de0ac.

📒 Files selected for processing (9)
  • .changeset/eigenpal-image-border-rendering.md
  • api-reports/core/layout-engine.api.md
  • packages/core/src/layout-bridge/convert/toFlowBlocks-image-borders.test.ts
  • packages/core/src/layout-bridge/convert/toFlowBlocks.ts
  • packages/core/src/layout-engine/types.ts
  • packages/core/src/layout-painter/renderImage-opacity.test.ts
  • packages/core/src/layout-painter/renderImage.ts
  • packages/core/src/layout-painter/renderParagraph.ts
  • packages/core/src/prosemirror/extensions/nodes/ImageExtension.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/eigenpal-image-borders-6b1a

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request ports image border rendering through layout painting by introducing border attributes (borderWidth, borderColor, borderStyle) to the layout engine types, preserving them during document conversion, and implementing border painting in the layout painter. The review feedback highlights a critical issue where borders applied directly to cropped elements are clipped and rendered invisible. To resolve this, the reviewer suggests updating applyImageBorder to accept generic HTMLElements and conditionally applying the border to the container element when cropping is active.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/layout-painter/renderImage.ts Outdated
Comment thread packages/core/src/layout-painter/renderParagraph.ts Outdated
Comment thread packages/core/src/layout-painter/renderParagraph.ts Outdated
Comment thread packages/core/src/layout-painter/renderImage.ts Outdated
Comment thread packages/core/src/layout-painter/renderParagraph.ts
@cursor
cursor Bot marked this pull request as ready for review July 19, 2026 03:18
Cropped images clip a scaled <img> inside overflow:hidden, so borders on
the image itself disappear. Apply borders to the crop container/wrapper
instead, widen applyImageBorder to HTMLElement, and refresh the
layout-engine API report.

Co-authored-by: Jan Kubica <jan-kubica@users.noreply.github.com>
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@jan-kubica
jan-kubica merged commit 4b6e885 into main Jul 19, 2026
8 checks passed
@jan-kubica
jan-kubica deleted the cursor/eigenpal-image-borders-6b1a branch July 19, 2026 16:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants