Skip to content

Format: Fill shows Color and Transparency only for fills they change - #1338

Merged
aiongg merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/fill-pane-color-transparency
Oct 25, 2026
Merged

aiongg merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/fill-pane-color-transparency

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #1335. This branch carries #1335's commit, and the diff shows it until #1335 merges; the change here is the last commit, in crates/ui-egui/src/panes.rs only.

Format Shape ▸ Fill showed the solid-fill Color button with a gradient, a picture or no fill, and picking a color there replaced the fill with a solid one. With a gradient it also showed a Transparency slider that did not change anything: shape.fill {transparency} changes a solid fill (an automatic one through its effective color) and a picture fill, and leaves a gradient as it is. With a picture fill the slider always started at 0%, so a 40% transparent picture showed as opaque.

The Fill pane documentation lists Color and Transparency under Solid fill, Transparency under Picture or texture fill, and a Transparency for each gradient stop, "not the overall fill" (Format Object (Fill pane)). The page does not describe Automatic, which keeps the Color button and the Transparency slider.

What changes

  • The Color button shows only when the Fill options show Solid fill or Automatic.
  • The Transparency slider shows for a solid, automatic or picture fill. A gradient keeps the Transparency of its selected stop.
  • A fill that follows the group or the slide background shows as Automatic and has no Transparency slider, because shape.fill {transparency} leaves that fill as it is.
  • With a picture fill, the slider starts at the picture's transparency.

Tests

  • panes::tests::fill_color_and_transparency_show_only_where_they_change_the_fill checks the fill's Color button and the Transparency rows for automatic, solid, gradient and picture fills and for no fill. It fails without this change.
  • panes::tests::picture_fill_transparency_slider_shows_the_picture_transparency checks that a 40% transparent picture fill shows 40%, and that clicking the row leaves the picture's alpha at 0.6. It fails without this change, with the slider at 0%.

Checks

  • cargo test -p deckcraft-ui-egui --lib -- --test-threads=1 panes::tests pattern_fill background: 17 passed.
  • cargo clippy -p deckcraft-ui-egui --all-targets -- -D warnings and cargo fmt --all -- --check exit 0.

On Windows 11 (x86-64) with rustc 1.99.1, on top of main at 38d2ade, with #1292, #1298 and #1300 merged in:

  • cargo xtask ci passes its 8 steps: 1,886 tests passed, 0 failed, 6 ignored.

git merge-tree reports no conflicts with main at 38d2ade.

Summary by CodeRabbit

  • New Features
    • Format Shape and Format Background now offer all 54 preset fill patterns, with previews using the current colors.
    • Choose separate foreground and background colors for pattern fills in either pane.
  • Changes
    • Fill color controls are shown for automatic and solid fills. Transparency controls are available for automatic, solid, and picture fills; gradients and patterns no longer have a fill-level transparency slider.

…and Background colors

Format Shape's Pattern fill set 25 % in accent 1 on background 1 and
offered no way to change it, and Format Background listed 10 of the 54
presets by their XML names. Both panes now show the same editor: a
gallery of the 54 DrawingML presets drawn in the fill's own colors,
each named in words, and Foreground and Background color menus.

With a pattern fill, Format Shape no longer shows the solid-fill Color
button, which replaced the pattern with a solid fill, or the
Transparency slider, which did not change a pattern. The renderer
exports the preset list and tiles for the gallery to draw.
Format Shape's Fill section showed the solid-fill Color button with a
gradient, a picture or no fill, and picking a color there replaced the
fill with a solid one. With a gradient it also showed a Transparency
slider that did not change the fill.

The Color button now shows only when the Fill options show Solid fill
or Automatic, and the Transparency slider shows for a solid, automatic
or picture fill. A fill that follows the group or the slide background
shows as Automatic and has no Transparency slider. With a picture fill
the slider starts at the picture's transparency instead of 0%.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 38d2ade and be56b0a.

Files selected for processing: 7
  • ROADMAP.md
  • crates/render/src/lib.rs
  • crates/render/src/pattern.rs
  • crates/ui-egui/src/fillui.rs
  • crates/ui-egui/src/panes.rs
  • crates/ui-egui/src/pattern_fill_tests.rs
  • docs/ui-parity.md

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

The change adds a shared editor for 54 pattern-fill presets, with previews in current colors and foreground and background color menus. Format Shape and Format Background use the editor. Format Shape also changes which fill types show color and transparency controls.

Changes: Pattern Fill Controls

Layer / File(s) Summary
Pattern presets and shared editor
crates/render/src/pattern.rs, crates/render/src/lib.rs, crates/ui-egui/src/fillui.rs
The renderer exposes preset and tile functions. The shared editor labels and previews all 54 presets, and lets users select a preset or change its foreground or background color.
Pane integration and UI validation
crates/ui-egui/src/panes.rs, crates/ui-egui/src/pattern_fill_tests.rs, ROADMAP.md, docs/ui-parity.md
Format Shape and Format Background use the shared editor. Format Shape shows fill color controls for automatic and solid fills, and transparency controls for automatic, solid, and picture fills. UI tests cover pattern selection, color changes, undo, and transparency behavior. The roadmap records the pattern gallery changes; the UI parity row remains unchanged.

Priority: Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant FormatPane
  participant pattern_editor
  participant pattern_tile
  FormatPane->>pattern_editor: Draw pattern editor with current fill
  pattern_editor->>pattern_tile: Get preset tile for preview
  pattern_editor-->>FormatPane: Return updated pattern after selection
  FormatPane->>FormatPane: Apply updated pattern fill
Loading

Possibly related PRs

  • storytold/deckcraft#1335: Adds the shared pattern editor and renderer preset support that this change uses in the Format Shape and Format Background panes.

Suggested reviewers: echelon

Merge Risk: Minimal · up to be56b

No actionable issue was identified in the pattern-fill controls or picture transparency behavior; the change is ready for normal merge checks.

Security architecture risk: Low · up to be56b

The shared editor preserves the existing document-editing commands and undo behavior. No new security issue was identified in the inspected paths. The assessment is bounded and does not establish behavior after abrupt process termination.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The inspected edit paths retain document-scoped ownership: shape appearance commands resolve selected targets and group descendants, while background commands resolve the existing background target or explicit all-background mode. The shared editor does not introduce a new target-selection mechanism.

Trust Boundaries and Controls

  • inferred — In the traced callers, document-derived pattern values remain rendering and command data rather than selecting operations or acquiring authority. Preset choices come from the renderer’s fixed inventory, command names remain fixed in pane code, and the new helpers perform rendering or serialization without direct document mutation or external I/O.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 5 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the Format Shape Fill pane shows the Color and Transparency controls only for the fill types they affect. The raw summary and PR objectives agree. The changeset also i…
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 names the main change: the Format Shape Fill pane shows the Color and Transparency controls only for the fill types they affect. The raw summary and PR objectives agree. The changeset also includes related pattern-fill editor work, which the title does not mention, but the title still describes the primary change accurately and specifically.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 5 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 7
  • Waived: $1.75 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
[!WARNING]
⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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

@aiongg
aiongg merged commit cc4629c into storytold:main Oct 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants