Skip to content

render: an audio clip's own picture is drawn without the speaker glyph (#2324) - #2325

Open
xaoseric wants to merge 1 commit into
storytold:mainfrom
XAOS-Interactive:audio-picture-no-glyph
Open

xaoseric wants to merge 1 commit into
storytold:mainfrom
XAOS-Interactive:audio-picture-no-glyph

Conversation

@xaoseric

@xaoseric xaoseric commented Nov 22, 2026 •

Copy link
Copy Markdown

Audio opened from a .pptx shows its own icon once, without DeckCraft's speaker drawn on top.

Fixes #2324.

What the user saw. In the editor, an audio clip from a .pptx showed two icons: the clip's own picture, stored with the audio in the file, and DeckCraft's blue speaker over it.

Cause. In the ShapeKind::Media arm of crates/render/src/renderer.rs, the clip's picture (MediaClip::poster) is drawn when it has one. Then if !mc.video || mc.poster.is_none() drew the speaker glyph for every audio clip, picture or not. PPTX import reads an audio shape's picture into poster, so every imported audio clip with a picture got both. paint::media_glyph's own doc already says the glyph is for clips "without a poster".

Change. The glyph (and a video's dark backing) is drawn only in the no-picture branch. A clip with its own picture shows just that picture, as video already did; a clip without one still shows the speaker or film glyph. Only drawing changes. Setting or resetting an audio clip's picture from the app is #2209, which builds on this.

Test. tests::an_audio_clips_own_picture_is_drawn_without_the_speaker_glyph gives an audio clip a picture as large as its box, a green PNG generated in the test, and checks that every sampled pixel inside the box is that green. It also checks that a clip without a picture still draws the speaker. Fails on main (454 sampled points off-green: the speaker), passes with the fix. A picture only a few pixels across did not show the bug, because the glyph then lands outside the box, so the test uses a full-size one.

Verification (local, Linux):

  • cargo fmt --all --check: pass.
  • cargo clippy -p deckcraft-render --all-targets -- -D warnings: pass.
  • cargo test -p deckcraft-render: 224 passed, 1 failed. The failure is tests::east_asian_vertical_text_stands_ideographs_upright, which fails the same way on main here: no CJK font, because ../craft-fonts is not checked out.
  • cargo xtask wasm: pass.
  • Manual check in the running app by the operator: a .pptx with audio now shows only its own icon. Audio inserted in DeckCraft still shows the speaker.
  • Not run: cargo xtask ci.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage for audio clips with poster images, verifying that the poster appears without the speaker glyph and that clips without posters retain the glyph.
  • Refactor
    • Clarified rendering behavior in code comments; rendering behavior remains unchanged.

storytold#2324)

An audio clip with its own picture (every audio shape a .pptx stores
has one) was drawn with DeckCraft's speaker glyph over that picture,
so imported audio showed two icons. As for video, the clip's picture
is now all that shows; the built-in speaker or film glyph is drawn
only when the clip has no picture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The renderer comment describes media poster and fallback-glyph rendering. A test checks poster and speaker-glyph pixels for audio clips with and without posters. Rendering conditions are unchanged.

Changes: Media poster rendering

Layer / File(s) Summary
Document and test media poster rendering
crates/render/src/renderer.rs, crates/render/src/tests.rs
A comment describes when the renderer displays a poster or built-in media glyph. A test checks that an audio clip with a poster has no speaker glyph over it, and that a clip without a poster displays the speaker glyph.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: aiongg, dylanmtaylor

Merge Risk: Minimal · up to 4cace

This change adds documentation and a test for audio clip picture rendering, with no change to runtime behavior. The merge risk is minimal.

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 names the main behavior change: an audio clip's own picture is drawn without the speaker glyph. The raw summary says draw_fill changed only in comments and a test was added. The objectives s…
Linked Issues check Passed [#2324] requires that a media clip with its own picture show only that picture, and that the speaker (audio) or film glyph (video) appear only when there is no picture. The diff to crates/render/src/r…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes two files. crates/render/src/renderer.rs changes only the Media arm of draw_fill, which is the fix for #2324, plus a comment. crates/render/src/tests.r…
Full details: Title check

Explanation

The title names the main behavior change: an audio clip's own picture is drawn without the speaker glyph. The raw summary says draw_fill changed only in comments and a test was added. The objectives say the fix draws the picture without the glyph and draws the speaker or film glyph only when no picture is present. The title matches the stated objective, and the reference to #2324 matches the linked issue.

Full details: Linked Issues check

Explanation

[#2324] requires that a media clip with its own picture show only that picture, and that the speaker (audio) or film glyph (video) appear only when there is no picture. The diff to crates/render/src/renderer.rs (ShapeKind::Media arm) matches this. When mc.poster is Some, the picture is drawn and the else branch is skipped, so no glyph or video backing is drawn. When mc.poster is None, the video backing (video only) and paint::media_glyph are drawn, as before. The old condition !mc.video || mc.poster.is_none() is removed. Video behavior with a poster is unchanged. The added test tests::an_audio_clips_own_picture_is_drawn_without_the_speaker_glyph in crates/render/src/tests.rs covers both cases: a full-size green picture with no off-green pixels in the box, and a clip without a picture that still draws the speaker. Setting or resetting audio pictures (#2209) is out of scope, and the PR does not attempt it. Note: the AI-generated summary of renderer.rs says the rendering conditions are unchanged. The actual diff shows a changed condition, so the summary is inaccurate. This assessment relies on the diff. The test was not executed in this review; the result rests on the diff and the author's reported run.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes two files. crates/render/src/renderer.rs changes only the Media arm of draw_fill, which is the fix for #2324, plus a comment. crates/render/src/tests.rs adds one test that exercises that same change. No unrelated code, configuration, or dependency changes appear in the diff. The test uses the image crate. This dependency is not shown as changed in the diff, so it is assumed to be already available to the render crate. This was not verified. The change does not add the #2209 picture set/reset feature, as the PR description states.

Finishing Touches

Generate unit tests (beta)

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

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution timed out
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

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 0ccc68f and 4cacee7.

Files selected for processing: 2

  • crates/render/src/renderer.rs
  • crates/render/src/tests.rs

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

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

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.

Audio with its own picture is drawn with DeckCraft's speaker icon on top of it

1 participant