Skip to content

Home › Font: Text Shadow button, shown and turned off for inherited shadows (#1662) - #1691

Open
ljkx wants to merge 7 commits into
storytold:mainfrom
ljkx:text-shadow-ribbon-toggle
Open

ljkx wants to merge 7 commits into
storytold:mainfrom
ljkx:text-shadow-ribbon-toggle

Conversation

@ljkx

@ljkx ljkx commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The Font group on the Home tab had no Text Shadow button, even though format.textShadow is registered under Home › Font, so there was no way to turn a text shadow on or off from the interface.

What was wrong

  • No button: the Font group showed Bold, Italic, Underline and Strikethrough, but no shadow toggle.
  • format.state had no shadow key, so a button could not show the current state.
  • A shadow the text inherits (from a layout or master list style, as in the issue's deck) could not be turned off. RunProps::shadow == None means "inherit", so format.textShadow {on: false} left the run unchanged and the shadow still drew.

What changed

  • Ribbon (ui-egui/ribbon/home.rs): a Text Shadow toggle between Underline and Strikethrough, as in PowerPoint, using the existing TextShadow icon. It lights up from format.state.
  • State (engine/cmd/format/painter.rs): format.state reports shadow from the resolved run, so inherited shadows count.
  • Model (model/text.rs): new RunProps::own_effects. The run carries its own, possibly empty, effect list, which replaces the inherited one: shadow, inner shadow, glow, reflection and soft edge are not inherited. Other formatting still inherits.
  • Command (engine/cmd/format/text_effects.rs, engine/cmd/text/formatting.rs): turning off a shadow a run inherits sets own_effects and copies the other effects that run inherits onto it, so only the shadow goes away. PowerPoint does the same with the run's own a:effectLst. Turning a shadow on next to inherited effects copies them onto the run the same way, so the saved a:effectLst keeps them. Each run's inherited effects are resolved from its own paragraph (new format_run_inherited), so mixed selections keep their own effects.
  • PPTX (pptx/read/dml.rs, pptx/write/dml.rs): a run's a:effectLst (empty or not) is read as own_effects and written back. Before, such runs imported from PowerPoint lost their override and showed the inherited effects as well.
  • Render: the needs_filters fix for text whose shadow or glow comes only from defRPr or the default text style (a blank slide on main) is now in its own PR, render: text effects from a paragraph's defRPr or the default text style need filters #2083.

The Font dialog option and the Format Shape pane's inherited-effects display (#1661, open PR #1685) are not part of this PR.

How it was tested

  • model: a_run_without_effects_inherits_no_shadow (inherit skips effects, other props still inherit, and a list style's empty list hides the master's effects).
  • engine: text_shadow_off_keeps_each_runs_own_inherited_effects (per-run effects across shapes and across paragraphs of one range).
  • engine: text_shadow_off_in_a_table_uses_each_cells_inherited_effects (table cells each use their own inherited effects, and only the selected cells change; fails when cells get no inherited props or all get the first cell's).
  • engine: text_shadow_inherited_from_the_layout_shows_and_toggles (shadow set on the sample's layout title in master view. On the slide, format.state reports it, the toggle turns it off and on again, and undo restores the run).
  • engine: text_shadow_on_keeps_an_inherited_glow_through_save_and_reopen (shadow turned on over a paragraph-level glow; the glow is still there after a PPTX save and reopen; fails without the fix).
  • pptx: empty_run_effect_list_round_trips and run_effect_list_with_effects_keeps_replacing_the_inherited_one.
  • ui-egui: ribbon::text_shadow_tests clicks Home › Font › Text Shadow on text that inherits a shadow from its list style and checks the state the button is drawn from.
  • cargo test on deckcraft-model, -pptx, -engine and -ui-egui: all pass. cargo clippy -D warnings --all-targets on those crates and cargo fmt --check are clean.

Fixes #1662

Summary by CodeRabbit

  • New Features
    • Added a Text Shadow toggle to the Home ribbon. It reflects the current formatting and lets you turn inherited shadows off or back on.
  • Bug Fixes
    • Text effect overrides now preserve the choice to disable inherited effects, including after saving and reopening a presentation, while other text formatting continues to inherit as before.
    • Rendering now detects shadows and glows inherited from paragraph and presentation styles, including effects set through paragraph defaults.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Run properties now track explicit effect ownership, and formatting resolves inherited effects per paragraph. PPTX round trips preserve empty effect lists. The formatting state and Home ribbon expose text-shadow state and toggling, and rendering checks inherited effects.

Changes: Text shadow behavior

Layer / File(s) Summary
Effect ownership and inherited formatting
crates/model/src/text.rs, crates/engine/src/tests.rs
RunProps adds own_effects. When the flag is true, effect properties do not inherit, while other properties continue to inherit. Tests cover effect suppression and inheritance.
Paragraph-specific inherited formatting
crates/engine/src/cmd/text/formatting.rs, crates/engine/src/cmd/text.rs, crates/engine/src/cmd/format.rs
Formatting resolves inherited run properties per paragraph for selected text, shapes, and table cells. It applies those properties to runs and paragraph end marks.
Text-shadow state and ribbon toggle
crates/engine/src/cmd/format/painter.rs, crates/engine/src/cmd/format/text_effects.rs, crates/ui-egui/src/ribbon/home.rs, crates/ui-egui/src/ribbon.rs, crates/ui-egui/src/ribbon/text_shadow_tests.rs, crates/engine/src/tests.rs
Formatting state reports whether a run has a shadow. Turning off an inherited shadow preserves inherited sibling effects and marks the effects as owned. The Home ribbon adds a Text Shadow toggle. Tests cover inherited state and toggling.
PPTX effect-list round trip
crates/pptx/src/read/dml.rs, crates/pptx/src/write/dml.rs, crates/pptx/tests/it/roundtrip.rs
PPTX reading marks a run’s effect list as owned, including an empty list. Writing emits an effect list when own_effects is true. Round-trip tests cover empty effects and a glow.
Inherited effect detection in rendering
crates/render/src/slide.rs, crates/render/src/tests.rs
text_has_effects checks paragraph defaults and the presentation default text style for shadows or glows. A renderer test checks detection and output for paragraph-default glow.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant HomeRibbon
  participant TextShadowCommand as format.textShadow
  participant InheritedFormatting
  participant RunProps
  participant FormattingState
  HomeRibbon->>TextShadowCommand: Send toggle value
  TextShadowCommand->>InheritedFormatting: Resolve paragraph-specific run properties
  InheritedFormatting-->>TextShadowCommand: Return inherited effects
  TextShadowCommand->>RunProps: Update shadow and own_effects
  TextShadowCommand->>FormattingState: Report current shadow state
  FormattingState-->>HomeRibbon: Set toggle state
Loading

Possibly related issues

  • storytold/deckcraft#1661: This change resolves inherited text effects in formatting operations, but does not update the Format Shape pane.

Suggested reviewers: echelon

Merge Risk: Minimal · up to 3f77e

No actionable issue remains from this review; the PR is mergeable after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the Home › Font Text Shadow button and its behavior for inherited shadows, which matches the main change. The changeset adds the ribbon toggle (home.rs), the ribbon UI tests, and the i…
Linked Issues check Passed Directly linked issue #1662 requires a Text Shadow toggle in the Home › Font group that reflects the current state, including inherited shadows. The Font dialog option is described as ideal, not requi…
Out of Scope Changes check Passed Each changed area supports #1662 or the inherited-shadow behavior that #1662 requires:
- Ribbon (ui-egui/ribbon/home.rs, ribbon.rs, ribbon/text_shadow_tests.rs): adds the requested toggle and it…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the Home › Font Text Shadow button and its behavior for inherited shadows, which matches the main change. The changeset adds the ribbon toggle (home.rs), the ribbon UI tests, and the inherited-shadow handling in the engine, model, PPTX, and render crates. The title references issue #1662, which the linked issue supports. The title is specific and describes the primary user-facing change. It does not cover the PPTX effect-list and render changes, which is acceptable for a title.

Full details: Linked Issues check

Explanation

Directly linked issue #1662 requires a Text Shadow toggle in the Home › Font group that reflects the current state, including inherited shadows. The Font dialog option is described as ideal, not required, and this PR excludes it.

[#1662] Toggle and state:

  • crates/ui-egui/src/ribbon/home.rs adds the Text Shadow toggle to the Font group, between Underline and Strikethrough, bound to format.textShadow. The PR summary states that it reads shadow from format.state.
  • crates/engine/src/cmd/format/painter.rs adds shadow to format.state, computed from the resolved run. An inherited shadow therefore lights the button.

[#1662] Turning off an inherited shadow:

  • crates/engine/src/cmd/format/text_effects.rs (text_shadow, off branch) runs format_run_inherited. It sets shadow = None. When the run inherits a shadow, it calls own_effect_list, which copies the other inherited effects onto the run and sets own_effects = Some(true). Confirmed in the diff at the reviewed head.
  • crates/engine/src/cmd/text/formatting.rs resolves inherited props per paragraph for text selections, shapes and table cells (inherited_by_paragraph, format_paragraphs, format_all). Each run therefore sees its own inherited effects. Confirmed in the diff at the reviewed head.
  • crates/model/src/text.rs adds RunProps::own_effects, so a run's own effect list replaces the inherited one, as the issue requires for inherited shadows.

[#1662] Turning on a shadow:

  • The on branch of text_shadow copies inherited inner shadow, glow, reflection and soft edge onto the run before it sets the shadow. This keeps those effects through PPTX save.

Tests named in the PR cover inherited-shadow state, toggle off and on, undo, the table-cell case, and the ribbon click (ribbon::text_shadow_tests). Test results come from the PR description and author reports. The test bodies were not re-run in this assessment.

No non-coding requirements appear in #1662.

Full details: Out of Scope Changes check

Explanation

Each changed area supports #1662 or the inherited-shadow behavior that #1662 requires:

  • Ribbon (ui-egui/ribbon/home.rs, ribbon.rs, ribbon/text_shadow_tests.rs): adds the requested toggle and its UI test.
  • Engine state and command (cmd/format/painter.rs, cmd/format/text_effects.rs, cmd/format.rs, cmd/text.rs, cmd/text/formatting.rs): report and toggle inherited shadows. Inherited effects resolve per run, per paragraph, per shape and per table cell. Confirmed in the diff.
  • Model (model/src/text.rs): own_effects lets a run override inherited effects without dropping other inherited effects. The toggle-off behavior depends on it.
  • PPTX read and write (pptx/read/dml.rs, pptx/write/dml.rs, round-trip tests): keep run a:effectLst overrides through import and export. Without this, the run-level override would not persist in files.
  • Render (render/slide.rs, render/tests.rs): text_has_effects now detects shadows and glows from paragraph defRPr and the presentation default text style. The shadow case is needed to display inherited shadows that #1662 requires the toggle to reflect. The glow case is a related fix for the same inherited-effect sources, and the PR describes it. No concrete lack of connection is demonstrated.

The Font dialog option and the Format Shape pane's inherited-effects display are excluded by the PR. No unrelated change is demonstrated. The overlap with PR #1726 is a coordination concern, not a scope violation.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 24d3d0b and 3f77e3f.

Files selected for processing: 2

  • crates/engine/src/tests.rs
  • crates/model/src/text.rs
Files skipped from review as they are similar to previous changes: 1

  • crates/model/src/text.rs

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

@coderabbitai coderabbitai 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread crates/pptx/src/read/dml.rs Resolved
@ljkx

ljkx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up pushed: 4a83329 and a91ec03.

  • Both inline findings are fixed in a91ec03. See the replies on each thread.
  • Docstring coverage warning: partly addressed. I added doc comments where the reasoning isn't obvious: RunProps::inherit, text_shadow, and the new helpers in formatting.rs (format_run_inherited, format_runs, format_paragraphs, format_all, inherited_by_paragraph). I didn't add docs to the existing PPTX rpr reader and writer just to raise the percentage. Most functions in those files have none, so I kept to the file's style.
  • UI coverage: new kittest ribbon::text_shadow_tests puts text whose shadow is inherited on the Home tab. It checks that format.state (what the button is drawn from) reports the shadow, then clicks Text Shadow twice: the first click turns the inherited shadow off, the second sets the run's own.
  • Render bug found by that test (4a83329): a slide was drawn blank when a shadow or glow came only from a paragraph's defRPr or the presentation's default text style. needs_filters missed those sources, so the slide went to vello_cpu's multi-threaded dispatcher, which panics on filter layers. The render guard caught the panic and drew nothing. It's a separate commit with its own regression test, which fails without the fix. It touches text_has_effects, near what render: keep the slide's worker threads when a shape uses a filter effect #1516 changes, but not the same lines.

Tested: cargo test on deckcraft-model (102), deckcraft-pptx (130 integration), deckcraft-engine (529), deckcraft-render (199) and deckcraft-ui-egui (463, including the UI soak test), all passing. cargo clippy -D warnings on those five crates with --all-targets and cargo fmt --check are clean.

@echelon

echelon commented Nov 3, 2026

Copy link
Copy Markdown
Member

Thanks! This overlaps #1726 (same #1662 Text Shadow button, same lines in ribbon/home.rs and text_effects.rs), so we're holding both until one is picked.

Come say hi on Discord if you haven't already: https://discord.gg/artcraft

ljkx added 4 commits November 3, 2026 15:19
…hadows (storytold#1662)

The Font group had no shadow toggle although `format.textShadow` is registered
under Home › Font. It now sits between Underline and Strikethrough, as in
PowerPoint, and lights up from `format.state`'s new `shadow` key, which reads
the resolved run, so a shadow from the layout or master counts.

Turning such a shadow off did nothing: a run's `shadow: None` means "inherit".
A run can now carry its own empty effect list (`RunProps::no_effects`, PPTX
`<a:effectLst/>` in `a:rPr`), which stops shadows, glows, reflections and soft
edges from inheriting. Turning the shadow off sets it and copies the other
effects the text shows onto the run, so only the shadow goes away. PPTX import
and export keep the empty list.
…yle need filters

`text_has_effects` missed a shadow or glow that text inherits from its
paragraph's `a:pPr/a:defRPr` or the presentation's default text style.
Such a slide was drawn on the multi-threaded vello_cpu dispatcher, which
panics on filter layers; the render guard caught it and the slide came
out blank. Found by the new Text Shadow UI test.
…st always replaces the inherited one

Review follow-up for storytold#1662:
- Turning off an inherited shadow copied the first selected run's other
  effects onto every run. `format.textShadow` now goes through the new
  `format_run_inherited`, which gives each run what its own paragraph
  inherits (defRPr and list styles, resolved before the edit) across
  text ranges, shapes and table cells. A run only gets its own effect
  list when it actually inherits a shadow.
- PPTX import set the override only for an empty `a:effectLst`, so a run
  that kept a glow got the inherited shadow back after a save and reopen.
  Any run `a:effectLst` now replaces the inherited list, as in DrawingML.
  The field is renamed `RunProps::own_effects` to match.
- Tests: per-run effects across shapes and paragraphs (engine), a
  non-empty run effect list round trip (pptx), and a kittest UI test that
  clicks Home > Font > Text Shadow on text with an inherited shadow.
Rebasing onto main brought `alt_lang` and `normalize_height` into
`RunProps::inherit`, which pushed it over clippy's cognitive-complexity
limit (31/30). The effect-list part (skipped when the run has its own
`a:effectLst`) moves to `RunProps::inherit_effects`; behaviour is unchanged.
@ljkx
ljkx force-pushed the text-shadow-ribbon-toggle branch from a91ec03 to 45e08ed Compare November 3, 2026 16:12

@coderabbitai coderabbitai 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread crates/pptx/src/read/dml.rs Resolved
…adow

Turning the shadow on stored only the shadow on the run. The editor still
showed an inherited glow, but the run's `a:effectLst` was written with the
shadow alone and, since a run's list replaces the inherited one, the glow
was gone when the file was reopened.

Turning the shadow on next to inherited effects now gives the run its own
effect list with them copied in, as turning an inherited shadow off
already did (`own_effect_list`, shared by both). Test:
`text_shadow_on_keeps_an_inherited_glow_through_save_and_reopen` fails
without the fix.
@ljkx

ljkx commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. I compared the two. #1726 adds the same button and format.state key, plus a Font dialog checkbox and on/off state for screen readers, which this PR doesn't have. These cases are covered here but not there:

  • Turning off an inherited shadow (layout, master or defRPr). On UI: add Text Shadow button to ribbon Font group and Font dialog (#1662) #1726 the button lights up, but clicking it sets the run's shadow to None, which it already was, so the shadow stays. Unchecking the dialog box does the same. This is the Major finding CodeRabbit left open there.
  • PPTX: a run's own a:effectLst, including PowerPoint's empty one for "shadow off", is ignored on import today, so the inherited shadow comes back. Here it's kept and written back. A shadow turned on over an inherited glow also keeps the glow through save and reopen.
  • Render: text whose shadow or glow comes only from defRPr or the default text style draws a blank slide (needs_filters misses it, 4a83329).

If you'd rather merge #1726, I'm happy to rebase onto it and send just these cases and their tests as a follow-up. FYI, CI on this PR is still waiting for workflow approval, so it hasn't run yet.

@aiongg aiongg added bugfix Fixes something that is broken: wrong result, crash, data loss needs decision Needs a product or scope decision by a maintainer labels Nov 4, 2026

@eliets2 eliets2 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.

First-pass review notes (automated; combined from specialist angles: tests, docs and text). Please treat as suggestions and verify before acting.

Summary: This adds a Text Shadow toggle to Home › Font that reflects and can turn off an inherited text shadow, by giving runs their own effect list that replaces inherited effects, preserving other inherited effects when toggling, round-tripping that list in PPTX, and fixing filter detection for shadows/glows from paragraph or default text styles.

Logical units:

  • Ribbon Text Shadow button in ui-egui/ribbon/home.rs
  • format.state shadow reporting in engine/cmd/format/painter.rs
  • RunProps::own_effects model in model/text.rs
  • Toggle command logic in engine/cmd/format/text_effects.rs and engine/cmd/text/formatting.rs
  • PPTX read/write of a:effectLst in pptx/read/dml.rs and pptx/write/dml.rs
  • needs_filters fix in render/slide.rs

Findings:

  • [tests] crates/engine/src/cmd/text/formatting.rs, format_runs / format_all table branch: the new per-cell inherited_by_paragraph code for ShapeKind::Table has no test, and existing tests only cover shapes and text ranges. Add a test with a table cell inheriting a shadow/glow via defRPr and toggling format.textShadow off.
  • [docs] crates/model/src/text.rs, RunProps::own_effects doc: the doc lists shadow, glow, reflection and soft edge as non-inherited but omits inner shadow, unlike inherit_effects in the same file and own_effect_list in crates/engine/src/cmd/format. Add inner shadow to the own_effects doc list.

Overlaps: The description notes the Font dialog option and the Format Shape pane inherited-effects display (#1661, open PR #1685) are not part of this PR; no other overlaps are listed.

Verdict: needs changes — (1) add the missing table-cell test for the new table branch, (2) fix the own_effects doc to include inner shadow, (3) no other findings were reported.

@ljkx

ljkx commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the notes. Both are fixed in 3f77e3f:

  1. Table branch test: added text_shadow_off_in_a_table_uses_each_cells_inherited_effects. It gives three cells of a 2×2 table a shadow through their paragraphs' defRPr (two of them with a glow too) and turns the shadow off. First only row 0 is selected (table.selectCells): each cell keeps its own glow or none, and row 1 isn't touched. Then the whole table is selected: (1, 0) keeps its glow, and (1, 1), which inherits no shadow, doesn't get an effect list. I checked that it fails when the table cells get no inherited props (inh_of(id, None)) and when every cell gets cell (0, 0)'s.
  2. own_effects doc: now lists inner shadow. The inherit_effects doc left it out too, so I fixed that one as well.

deckcraft-engine and deckcraft-model tests, clippy and fmt pass.

- New engine test turns off a shadow that table cells inherit through their paragraphs' defRPr:
  each selected cell keeps its own inherited glow (or none), unselected cells are untouched, and a
  cell that inherits no shadow gets no effect list.
- RunProps::own_effects and inherit_effects docs name the inner shadow too.

@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.

Changes needed:

Adds a Text Shadow toggle to Home › Font, reports shadow state from the resolved run, and lets a run's own effect list replace inherited effects so an inherited shadow can be turned off and saved as such.

  • crates/render/src/slide.rs: this push drops the defRPr and default-text-style sources from text_has_effects, together with their test. Text whose glow or shadow comes only from those sources depends on a separate change for filter detection.
  • crates/ui-egui/src/ribbon/text_shadow_tests.rs:21-31: the harness now inherits the shadow from the text body's list style rather than the paragraph's defRPr. The UI test therefore no longer exercises the defRPr inheritance path.
  • crates/model/src/text.rs: own_effects replacing the inherited effect list as a whole matches how a run's a:effectLst works in PPTX. Other formatting still inherits.
  • crates/engine/src/cmd/text/formatting.rs: inherited effects are resolved per paragraph and per table cell, so mixed selections keep each run's own glow or reflection when the shadow is turned off.

Claims checked:

  • unverified: The Home › Font group gains a Text Shadow toggle between Underline and Strikethrough that lights up from format.state. (crates/ui-egui/src/ribbon/home.rs: file is in the PR, but its contents could not be read here. Only crates/ui-egui/src/ribbon/text_shadow_tests.rs changed in this push.)
  • unverified: format.state reports shadow from the resolved run, so inherited shadows count. (crates/engine/src/cmd/format/painter.rs: could not be read. crates/ui-egui/src/ribbon/text_shadow_tests.rs:21-31 sets up a list-style shadow for this check.)
  • unverified: Turning off an inherited shadow sets own_effects and copies the run's other inherited effects. Turning a shadow on next to inherited effects copies them too, resolved per paragraph. (crates/engine/src/cmd/format/text_effects.rs and crates/engine/src/cmd/text/formatting.rs: could not be read in this…
  • unverified: A run's a:effectLst, empty or not, is read as own_effects and written back. (crates/pptx/src/read/dml.rs and crates/pptx/src/write/dml.rs: could not be read. A roundtrip test is listed in crates/pptx/tests/it/roundtrip.rs.)

Reviewed at 540b792.

Recommendation: update the pull request; it will be reviewed again.

The `needs_filters` change (71ba9fe) fixes a blank slide that `main`
already draws for any text whose shadow or glow comes only from a
paragraph's `defRPr` or the presentation's default text style. It doesn't
depend on the Text Shadow button, so it goes to its own pull request with
its test, and this commit takes it out of this one.

The ribbon test took its inherited shadow from `defRPr`, so its slide hit
that render panic, and the UI soak test, which requires no caught render
panics in the process, failed after it. The test now takes the shadow
from the text box's list style (`a:lstStyle`), which `needs_filters`
already covers on `main`. It still checks that the inherited shadow
lights the button, that one click turns it off with the run's own effect
list, and that a second click sets the run's own shadow.

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

ljkx commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Pushed 540b792 and opened #2083. Point by point:

Overlap with #1726. Since I compared the two on Nov 3, #1726 has added 0061d28. Turning off an inherited shadow now works in its editor, through a RunProps::no_shadow flag. Checked at its head (8e67ca5), the flag only covers the outer shadow. The inner shadow, glow, reflection and soft edge still inherit one by one. In PPTX, a run's a:effectLst replaces the inherited list as a whole, so the two disagree:

  • Shadow off on text that also inherits a glow: UI: add Text Shadow button to ribbon Font group and Font dialog (#1662) #1726 writes <a:effectLst/>. PowerPoint draws no glow. DeckCraft reopens the file with the glow, because its reader sets only no_shadow and the glow is inherited again.
  • Shadow on next to an inherited glow: the run's list holds only a:outerShdw, so PowerPoint drops the glow. Here, own_effect_list copies it in (text_shadow_on_keeps_an_inherited_glow_through_save_and_reopen).
  • Import: a run with <a:effectLst><a:glow/></a:effectLst> under a master with a shadow and a reflection still shows the reflection in UI: add Text Shadow button to ribbon Font group and Font dialog (#1662) #1726. PowerPoint doesn't draw it.
  • Off on text with no inherited shadow: text_shadow sets no_shadow anyway, so every such run is written with an empty a:effectLst. That drops any effect it inherits in PowerPoint. This PR only gives a run its own list when it inherits a shadow.

#1726 also conflicts with main right now. It does have two things this PR doesn't: a Shadow checkbox in the Font… dialog, and the selected state of icon_toggle for screen readers. Neither depends on how shadow-off is modelled.

My recommendation: land this PR for the button, format.state and the effect-list model. Take the dialog checkbox and the accessibility change from #1726 on top of it, either rebased by @Naseq or ported by me with credit. If you'd rather merge #1726 first, I'll rebase onto it and send the effect-list model, the PPTX read/write and their tests as a follow-up.

Render fix (slide.rs:46-53). Agreed, it's separate. Text that gets a shadow or glow only from defRPr or the default text style draws a blank slide on main already, with or without the button. The issue's case, a shadow from the layout or master text styles, is already covered by needs_filters on main. So the fix is now #2083, with its test, and 540b792 takes it out of this PR. The ribbon test was the only part of this PR that needed it. Its inherited shadow came from defRPr, and the caught render panic then failed the UI soak test, which runs in the same process. The test now takes the shadow from the text box's a:lstStyle.

a:effectLst on import. This change is intended. In ECMA-376 the run's effects are EG_EffectProperties on a:rPr: one a:effectLst (or a:effectDag), not separate shadow and glow properties. Text properties inherit element by element, from the list-style levels through a:pPr/a:defRPr to a:rPr. So a run's a:effectLst replaces the inherited list, and an empty one means no effects, which is how PowerPoint turns off an inherited shadow. Before this PR, such runs imported with their own effects plus the inherited ones. That doesn't match what PowerPoint draws. empty_run_effect_list_round_trips and run_effect_list_with_effects_keeps_replacing_the_inherited_one cover the empty and non-empty cases.

Effects inherit as one list: same reason. A run's own list stops all inherited effects, and every other property still inherits.

Other run-effect commands: on main, format.textShadow is the only command that writes a run's effects. The Shape Effects galleries and the Format Shape pane go through shape.effects, which writes the shape's spPr effects, not the run's. Format Painter copies the run's own props, including own_effects. So nothing writes a partial run list today. If the pane gets text effects (#1661, #1685), those should go through own_effect_list too.

Tested after 540b792: cargo test -p deckcraft-ui-egui 469 passed, including the soak test and ribbon::text_shadow_tests. Two other runs of that test binary on this Windows machine stopped with an access violation before finishing. Neither run showed a failed assertion. cargo test -p deckcraft-render passed (203). cargo clippy -p deckcraft-ui-egui -p deckcraft-render --all-targets -- -D warnings and cargo fmt --all -- --check are clean.

autocraft-bot Bot pushed a commit that referenced this pull request Nov 18, 2026
…yle need filters

`text_has_effects` missed a shadow or glow that text inherits from its
paragraph's `a:pPr/a:defRPr` or the presentation's default text style.
Such a slide was drawn on the multi-threaded vello_cpu dispatcher, which
panics on filter layers; the render guard caught it and the slide came
out blank. Found by the Text Shadow UI test in #1691.

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

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 needs decision Needs a product or scope decision by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Text Shadow button on the ribbon

4 participants