Skip to content

fix(review): check alt text on picture-filled shapes - #2293

Open
MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:patch-25
Open

MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:patch-25

Conversation

@MMexicann

@MMexicann MMexicann commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

DeckCraft’s accessibility check now reports picture-filled shapes that need alternative text.

Part of #2223, covering explicit picture fills. Icon detection remains open.

The checker previously looked at shape kind, so it missed an ordinary shape filled with a picture. It now checks the fill as well. Shapes with alt text and shapes marked decorative keep their existing exceptions.

Verification

Added accessibility_requires_alt_text_for_picture_fills to exercise review.accessibility with an undescribed picture fill, a plain shape, and the two exceptions. Local rustfmt passed for the changed file. The Rust test was not run locally.

Summary by CodeRabbit

  • Bug Fixes
    • Accessibility reviews now flag nondecorative shapes with picture fills when they lack alternative text. Shapes with descriptions or marked as decorative are not flagged.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The accessibility review now reports nondecorative shapes with picture fills when they lack alternative text. A test checks that plain shapes, described picture-filled shapes, and decorative picture-filled shapes are not reported.

Changes: Accessibility review

Layer / File(s) Summary
Picture-fill alternative text check
crates/engine/src/cmd/review.rs
The check includes picture-filled shapes while retaining its empty-description and nondecorative conditions. A test verifies which shapes appear in the missing-alternative-text results.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

  • storytold/deckcraft#2223: This PR adds the explicit picture-fill check described in the issue. Icon detection remains unaddressed.

Suggested reviewers: echelon, nikitkara

Merge Risk: Minimal · up to cbe1a

This change makes the accessibility review report picture-filled shapes that lack alternative text. Shapes with alt text and decorative shapes are still exempt. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(review): check alt text on picture-filled shapes" matches the main change. The raw summary says review.accessibility now treats shapes with picture fills as needing alternative text, an…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(review): check alt text on picture-filled shapes" matches the main change. The raw summary says review.accessibility now treats shapes with picture fills as needing alternative text, and the objectives describe the same goal. The title names the scope (picture-filled shapes) and the behavior (alt text check) without listing files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c355c06 and cbe1a62.

Files selected for processing: 1

  • crates/engine/src/cmd/review.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@autocraft-bot autocraft-bot Bot added the bugfix Fixes something that is broken: wrong result, crash, data loss label Nov 21, 2026
@cloutier

Copy link
Copy Markdown
Contributor

Independently validated cbe1a625 on macOS arm64 with a locally authored 11-shape deck. Official main 0ccc68f6 flagged only the ordinary picture whose alt text I cleared. This PR also flagged the undescribed rectangle with an explicit picture fill, both before saving and after each of two PPTX reopens. The described and decorative picture-fill controls stayed unflagged. The focused engine regression accessibility_requires_alt_text_for_picture_fills passed locally.

The inserted icon case from #2223 still reproduces on both revisions, consistent with this PR’s scope. The inserted Star and a separate freeform renamed Star both reopen as generic custom shapes without an origin marker. These are DeckCraft CLI observations.

@autocraft-bot autocraft-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI-generated review (Claude Opus 5.5). Not a maintainer decision.

No blocking problems found (not certain).

Adds an explicit picture-fill check to the missing-alt-text rule, so ordinary shapes filled with an image are reported unless they are described or decorative.

  • crates/engine/src/cmd/review.rs:263 ORs Fill::Picture into needs_alt, so a shape matching both kind and fill is still reported only once.
  • crates/engine/src/cmd/review.rs:264 keeps the existing descr.trim().is_empty() && !decorative exemptions unchanged for the new case.
  • The new test accessibility_requires_alt_text_for_picture_fills covers an undescribed fill, a plain shape, a described fill and a decorative fill, and checks that only id 100 is reported.
  • Worth confirming that picture-filled shapes nested inside groups are reached by the same check, if the traversal does not already descend into group children.

Claims checked:

  • verified: The accessibility check now reports nondecorative picture-filled shapes without alternative text. (crates/engine/src/cmd/review.rs:263 adds || matches!(&sh.fill, Some(deckcraft_model::Fill::Picture(_))) to needs_alt; review.rs:264-265 pushes 'Missing alternative text' when needs_alt holds.)
  • verified: Shapes with alt text and shapes marked decorative keep their existing exceptions. (crates/engine/src/cmd/review.rs:264 keeps the condition needs_alt && sh.descr.trim().is_empty() && !sh.decorative; the test at review.rs:830-831 builds described (102) and decorative (103) shapes and asserts that o…
  • verified: Covers explicit picture fills only; icon detection remains open. (crates/engine/src/cmd/review.rs:263 checks only Fill::Picture; nothing in the diff adds icon detection.)

Reviewed at cbe1a62.

Recommendation: merge, after a maintainer's decision.

This branch has not been deployed

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

Labels

bugfix Fixes something that is broken: wrong result, crash, data loss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants