Repository navigation
Format: Fill shows Color and Transparency only for fills they change - #1338
Conversation
…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%.
|
No actionable comments were generated in the recent review.
|
| 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:
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
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: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
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]
Comment @coderabbitai help to get the list of available commands.
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.rsonly.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
shape.fill {transparency}leaves that fill as it is.Tests
panes::tests::fill_color_and_transparency_show_only_where_they_change_the_fillchecks 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_transparencychecks 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 warningsandcargo fmt --all -- --checkexit 0.On Windows 11 (x86-64) with rustc 1.99.1, on top of
mainat38d2ade, with #1292, #1298 and #1300 merged in:cargo xtask cipasses its 8 steps: 1,886 tests passed, 0 failed, 6 ignored.git merge-treereports no conflicts withmainat38d2ade.Summary by CodeRabbit