Skip to content

[codex] Preserve visual styles on text shapes - #16

Merged
RealSid08 merged 1 commit into
mainfrom
codex/styled-text-shapes-fidelity
Apr 1, 2026
Merged

RealSid08 merged 1 commit into
mainfrom
codex/styled-text-shapes-fidelity

Conversation

@RealSid08

Copy link
Copy Markdown
Member

Summary

  • preserve visual frame styling for text-bearing preset shapes instead of dropping them to bare text boxes
  • render the new frame metadata through the existing text element path so fills, borders, and rounded corners survive parsing
  • add parser and renderer regression tests for styled text boxes

Why

Renderable text shapes in PPTX can carry both text content and visual shape styling. The parser previously returned a plain text element as soon as it found text, which meant those shapes lost their fill, stroke, and corner styling during rendering.

Impact

This improves fidelity for common business-slide text boxes without changing the public ShapeElement model or broadening scope into table/theme follow-up work.

Validation

  • pnpm run fixtures:generate
  • pnpm run verify
  • pnpm run pack:check
  • pnpm run test:browser
  • PPTX_VISUAL_CASES=text-insets-anchor pnpm run test:visual

Notes

The targeted text-insets-anchor visual metric only moved slightly, so the larger remaining gap looks more related to theme/color behavior than the old unstyled-text-shape bug itself.

@RealSid08 RealSid08 added the release:patch Publish a patch release on merge label Apr 1, 2026 — with ChatGPT Codex Connector
@RealSid08
RealSid08 merged commit d643ec7 into main Apr 1, 2026
9 of 10 checks passed
@RealSid08
RealSid08 deleted the codex/styled-text-shapes-fidelity branch April 1, 2026 08:31
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Visual PR Diff

Compared 15 visual cases against the latest successful main visual artifact and found 2 changed cases.

Renderer Change Ranking

Case Max Diff Mean Diff Top Changed Slides
nested-groups 0.0481 0.0481 1 (0.0481)
group-transform 0.0411 0.0411 1 (0.0411)
bullets-numbering 0.0000 0.0000 1 (0.0000)
complex-sanitized 0.0000 0.0000 1 (0.0000), 4 (0.0000), 5 (0.0000), 8 (0.0000)
diagram-fallback 0.0000 0.0000 2 (0.0000), 10 (0.0000)
image-cropping 0.0000 0.0000 1 (0.0000)
image-placement 0.0000 0.0000 1 (0.0000)
paragraph-spacing 0.0000 0.0000 1 (0.0000)
slop-sample 0.0000 0.0000 1 (0.0000), 2 (0.0000), 3 (0.0000), 4 (0.0000), 5 (0.0000)
table-layout 0.0000 0.0000 1 (0.0000)

Most Regressed Vs Office Reference

Case Mean Delta Max Delta Worst Slide Delta
group-transform +0.0001 +0.0001 1 (+0.0001)

Most Improved Vs Office Reference

Case Mean Delta Max Delta Best Slide Delta
nested-groups -0.0000 -0.0000 1 (-0.0000)
text-insets-anchor -0.0000 -0.0000 1 (-0.0000)

Preview Slides

nested-groups slide 1

MainPRDiff
Main baseline nested-groups slide 1PR current nested-groups slide 1Diff nested-groups slide 1

group-transform slide 1

MainPRDiff
Main baseline group-transform slide 1PR current group-transform slide 1Diff group-transform slide 1

Artifacts include HTML side-by-side reports under visual-regression-artifacts and visual-pr-comparison.

github-actions Bot added a commit that referenced this pull request Apr 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81d9bb121e

ℹ️ 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 thread src/renderer.ts
Comment on lines +143 to +147
if (frame.strokeWidth && frame.strokeWidth > 0) {
element.style.borderWidth = `${frame.strokeWidth * scale}px`;
element.style.borderStyle = frame.strokeDash || "solid";
element.style.borderColor = frame.strokeColor || "#000";
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip fallback border color for noFill text frames

When a text-bearing shape has an explicit line with <noFill/>, parseTextShapeFrame can still pass a positive strokeWidth but no strokeColor. This branch then renders a visible border using #000, so “no outline” shapes become black-outlined after this change. The issue reproduces on any text shape whose OOXML includes <a:ln w="..."><a:noFill/></a:ln>, and it is introduced by the new frame rendering path for text elements.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Publish a patch release on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant