Merge pull request #1623

Let clicks pass through empty No Fill shapes
This commit is contained in:
Brandon Thomas
2026-11-02 04:51:18 -05:00
6 changed files with 187 additions and 7 deletions
+3 -1
View File
@@ -2,7 +2,7 @@
**Stage: alpha** · next: beta, ~20 points and ~120–210 h away
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-30 · **Change:** trivial (print-preview tests use egui's emitted URL, and macOS removes its previews before exit; parity scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-11-01 · **Change:** trivial (locked No Fill and no-outline click-through regression coverage added; No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-30 · **Change:** trivial (progress log: read-only `slide.actions` lists shape and table text actions; parity scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-27 · **Change:** trivial (progress log: Set Up Slide Show ▸ Keep mouse cursor visible, #1445; stage and scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-26 · **Change:** trivial (progress log: dragging several selected slides moves them all; previous: trivial, progress log: Edit Points handle drags with Shift, Ctrl/Cmd or Alt/Option set the point type; previous: trivial, progress log: scroll bars on the zoomed slide pane, #1157; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: ~60 landed items in the progress log, among them the Font, Paragraph, Photo Album, theme colour and font and Date and Time dialogs, presenter and show controls, the SmartArt Text Pane and PPTX corpus slices; breadth 84% after `cargo xtask parity`, ready stays ~55%, stage stays alpha; duplicated rows and headers folded; previous: minor, hours to ~95% per audience added) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
@@ -148,6 +148,7 @@ app's JSON control channel (`deckcraft --control PORT`).
| Date | What landed |
|---|---|
| 2026-10-31 | No Fill shape interiors allow selection and editing of underlying objects, even when a quick style remains; hit-testing uses the renderer’s fill resolution. Outlines, rotation, text targets and actual fills keep their hit behaviour (#1621) |
| 2026-10-30 | Print-preview tests use the URL emitted by egui and its exact file path; previews are explicitly removed before the macOS process exits |
| 2026-10-30 | `slide.actions` lists shape click and hover actions and text-run hyperlinks (including table cells and grouped shapes) for audit; listing never runs an action. The UI pane is a follow-up |
| 2026-10-29 | Slide Show: going back to the previous slide plays the transition of the slide being left, reversed, as PowerPoint does, instead of the previous slide's own entrance transition (#1531); a jump (Go to Slide, links) still plays the target slide's transition |
@@ -318,6 +319,7 @@ app's JSON control channel (`deckcraft --control PORT`).
| Date | Change | Summary |
|---|---|---|
| 2026-10-31 | trivial | No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged |
| 2026-10-30 | trivial | Progress log: read-only slide action inspection; parity scores unchanged |
| 2026-10-29 | trivial | Progress log: going back in the slide show reverses the left slide's transition (#1531). Scores and milestone names unchanged |
| 2026-10-29 | trivial | Progress log: the Picture Styles row leaves room for Crop and Size (#1232). Scores and milestone names unchanged |
+164
View File
@@ -5604,6 +5604,170 @@ fn edit_points_conversion_is_one_undo_step() {
assert!(preset(&s), "the only step was the conversion");
}
/// #1621: build overlapping objects with an ordinary quick style on the foreground shape.
fn no_fill_overlap(s: &mut Session, text: bool) -> (ShapeId, ShapeId) {
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
let under = s
.execute(
if text { "insert.textBox" } else { "shape.insert" },
&json!({"preset": "rect", "rect": [100, 300, 300, 60], "text": if text { "UNDERLYING TEXT" } else { "" }}),
)
.unwrap()["id"]
.as_u64()
.unwrap();
let over = s.execute("shape.insert", &json!({"preset": "rect", "rect": [80, 270, 350, 140]})).unwrap()["id"].as_u64().unwrap();
(ShapeId(under as u32), ShapeId(over as u32))
}
/// No Fill passes interior clicks through while preserving outline and actual-fill targets.
#[test]
fn no_fill_shape_allows_selecting_and_editing_underlying_text() {
let mut s = session();
let (under, over) = no_fill_overlap(&mut s, true);
s.execute("shape.fill", &json!({"none": true})).unwrap();
assert!(s.doc().unwrap().shape(over).unwrap().style.is_some(), "the ordinary quick style remains");
s.execute("edit.deselect", &json!({})).unwrap();
let p = deckcraft_geom::Point::new(200.0, 310.0);
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, .. }) if id == under));
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(tev(kind, p.x, p.y)).unwrap();
}
assert_eq!(s.doc().unwrap().selection.shapes, vec![under]);
assert_eq!(text_sel(&s).unwrap().shape, under);
// The transparent foreground also leaves an already-active text editor's caret alone.
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(tev(kind, p.x + 20.0, p.y)).unwrap();
}
assert_eq!(text_sel(&s).unwrap().shape, under);
s.execute("edit.deselect", &json!({})).unwrap();
// The rectangle's outline is still a target, and selecting it does not remove its style.
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(tev(kind, 80.0, 330.0)).unwrap();
}
assert_eq!(s.doc().unwrap().selection.shapes, vec![over]);
assert!(s.doc().unwrap().shape(over).unwrap().style.is_some());
// A real fill still catches clicks, even with 100% transparency (distinct from No Fill).
for transparency in [0.0, 1.0] {
s.execute("edit.select", &json!({"ids": [over.0]})).unwrap();
s.execute("shape.fill", &json!({"color": "#336699", "transparency": transparency})).unwrap();
s.execute("edit.deselect", &json!({})).unwrap();
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, .. }) if id == over));
}
}
/// Rotation and pointer tolerance must preserve both pass-through interiors and outline hits.
#[test]
fn no_fill_shape_hit_testing_respects_rotation_and_pointer_tolerance() {
let mut s = session();
let (under, over) = no_fill_overlap(&mut s, false);
s.execute("shape.fill", &json!({"none": true})).unwrap();
s.execute("shape.rotate", &json!({"deg": 30})).unwrap();
let x = s.doc().unwrap().shape(over).unwrap().xfrm.unwrap();
let p = x.affine() * deckcraft_geom::Point::new(x.w / 2.0, x.h / 2.0);
let edge = x.affine() * deckcraft_geom::Point::new(0.0, x.h / 4.0);
for tol in [0.5, 3.0, 8.0] {
s.execute("edit.deselect", &json!({})).unwrap();
assert!(matches!(s.hit_test(p, tol), Some(tools::Hit::Shape { id, .. }) if id == under));
assert!(matches!(s.hit_test(edge, tol), Some(tools::Hit::Shape { id, .. }) if id == over));
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(PointerEvent { tol, ..tev(kind, p.x, p.y) }).unwrap();
}
assert_eq!(s.doc().unwrap().selection.shapes, vec![under]);
}
}
/// Style, theme and absent fills follow rendering, with explicit fill taking precedence.
#[test]
fn no_fill_hit_testing_resolves_style_and_theme_fills() {
use std::sync::Arc;
for source in ["style", "theme", "absent"] {
let mut s = session();
let (under, over) = no_fill_overlap(&mut s, true);
{
let st = s.doc_mut().unwrap();
let doc = Arc::make_mut(&mut st.doc);
if source == "theme" {
Arc::make_mut(&mut doc.masters[0]).theme.format.fills[0] = model::Fill::None;
}
let sh = Arc::make_mut(&mut doc.slides[st.selection.slide]).shapes.iter_mut().find(|sh| sh.id == over).unwrap();
assert!(sh.fill.is_none(), "the shape has no explicit fill override");
if source == "absent" {
sh.style = None;
} else {
sh.style.as_mut().unwrap().fill_ref.0 = if source == "style" { 0 } else { 1 };
}
}
s.execute("edit.deselect", &json!({})).unwrap();
let p = deckcraft_geom::Point::new(200.0, 310.0);
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, .. }) if id == under), "{source}");
// An explicit fill takes precedence over the no-fill style/theme.
s.execute("edit.select", &json!({"ids": [over.0]})).unwrap();
s.execute("shape.fill", &json!({"color": "#336699"})).unwrap();
s.execute("edit.deselect", &json!({})).unwrap();
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, .. }) if id == over), "{source}");
}
}
/// Text on a foreground No Fill shape retains its selection and editing target.
#[test]
fn no_fill_text_shapes_keep_their_interior_text_target() {
let mut s = session();
let (_, over) = no_fill_overlap(&mut s, true);
s.execute("text.set", &json!({"id": over.0, "text": "FOREGROUND TEXT"})).unwrap();
s.execute("shape.fill", &json!({"none": true})).unwrap();
s.execute("edit.deselect", &json!({})).unwrap();
let p = deckcraft_geom::Point::new(200.0, 310.0);
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, text: true }) if id == over));
s.pointer(tev(PointerKind::DoubleClick, p.x, p.y)).unwrap();
assert_eq!(text_sel(&s).unwrap().shape, over);
}
/// A locked No Fill shape remains selectable on its outline, but dragging cannot move it.
#[test]
fn no_fill_locked_shape_keeps_outline_selection_without_moving() {
let mut s = session();
let (under, over) = no_fill_overlap(&mut s, true);
s.execute("shape.fill", &json!({"none": true})).unwrap();
s.execute("shape.lock", &json!({"locked": true})).unwrap();
let before = s.doc().unwrap().shape(over).unwrap().xfrm;
s.execute("edit.deselect", &json!({})).unwrap();
let inside = deckcraft_geom::Point::new(200.0, 310.0);
assert!(matches!(s.hit_test(inside, 3.0), Some(tools::Hit::Shape { id, .. }) if id == under));
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(tev(kind, inside.x, inside.y)).unwrap();
}
assert_eq!(text_sel(&s).unwrap().shape, under);
s.execute("edit.deselect", &json!({})).unwrap();
let edge = deckcraft_geom::Point::new(80.0, 330.0);
assert!(matches!(s.hit_test(edge, 3.0), Some(tools::Hit::Shape { id, .. }) if id == over));
s.pointer(tev(PointerKind::Down, edge.x, edge.y)).unwrap();
s.pointer(tev(PointerKind::Drag, edge.x + 40.0, edge.y + 20.0)).unwrap();
s.pointer(tev(PointerKind::Up, edge.x + 40.0, edge.y + 20.0)).unwrap();
let st = s.doc().unwrap();
assert_eq!(st.selection.shapes, vec![over]);
assert_eq!(st.shape(over).unwrap().xfrm, before);
assert!(st.shape(over).unwrap().locked);
}
/// Removing both fill and outline leaves the empty interior transparent to clicks, locked or not.
#[test]
fn no_fill_shape_without_text_or_outline_passes_interior_clicks() {
for locked in [false, true] {
let mut s = session();
let (under, _) = no_fill_overlap(&mut s, false);
s.execute("shape.fill", &json!({"none": true})).unwrap();
s.execute("shape.line", &json!({"none": true})).unwrap();
s.execute("shape.lock", &json!({"locked": locked})).unwrap();
s.execute("edit.deselect", &json!({})).unwrap();
let p = deckcraft_geom::Point::new(200.0, 310.0);
assert!(matches!(s.hit_test(p, 3.0), Some(tools::Hit::Shape { id, .. }) if id == under));
for kind in [PointerKind::Down, PointerKind::Up] {
s.pointer(tev(kind, p.x, p.y)).unwrap();
}
assert_eq!(s.doc().unwrap().selection.shapes, vec![under]);
}
}
/// #931: while the text of a placeholder is being edited, a shape in front of it still takes a
/// click (as in PowerPoint); a click on the text where nothing is in front still moves the caret.
#[test]
+6 -2
View File
@@ -216,6 +216,7 @@ pub(super) fn in_table_cell(st: &crate::DocState, id: ShapeId, p: Point) -> bool
})
}
/// Resolve a shape's target at slide point `p`, using its effective fill for interior hits.
pub(super) fn hit_shape(st: &crate::DocState, sh: &Shape, p: Point, tol: f64) -> Option<Hit> {
let x = xfrm_of(&st.doc, &st.selection, sh);
let inv = x.affine().inverse();
@@ -267,8 +268,11 @@ pub(super) fn hit_shape(st: &crate::DocState, sh: &Shape, p: Point, tol: f64) ->
return None;
}
let has_text = matches!(sh.kind, ShapeKind::Shape) && (sh.text.as_ref().is_some_and(|t| !t.is_empty()) || sh.ph.is_some() || sh.text_box);
// Empty interiors of unfilled, text-less shapes don't catch clicks.
let filled = !matches!(sh.fill, Some(deckcraft_model::Fill::None)) || sh.style.is_some();
// Match rendering: an explicit No Fill overrides the style, and style/theme fills
// can themselves be No Fill. Empty, text-less interiors then let clicks through.
let fill =
cmd::text::ctx_for(&st.doc, &st.selection).map(|ctx| deckcraft_model::resolve::fill(&ctx, sh).0).unwrap_or_else(|| sh.fill.clone());
let filled = !matches!(fill, None | Some(deckcraft_model::Fill::None));
let geo = deckcraft_render::shape_geometry(sh, x.w, x.h);
let in_geo = {
use deckcraft_geom::KurboShape;
+2 -1
View File
@@ -1,6 +1,6 @@
# Where DeckCraft falls short of PowerPoint
> **Last reviewed:** 2026-10-30 · **Last updated:** 2026-10-30 · **Change:** minor (slide-show hit testing follows each shape’s own animation state; scale and rotation covered; previous: trivial, AutoFormat lists run independently of Replace text as you type; previous: minor, slide-show click targets follow animated shapes and text links; previous: minor, Animation Pane ▸ Play From; previous: minor, native chart payloads stored in bounded ZIP members; previous: major, community PR wave 2026-10-14: soak tests, PPTX corpus, comment threads (#70), embedded fonts, SmartArt Text Pane, Animation Pane timeline, Hunspell spelling, thesaurus, AutoCorrect, 14 new dialogs, pen pressure and trackpad gestures; duplicated entries and headers folded; previous: minor, 3-D bevel, camera and face lighting rendered) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-30 · **Last updated:** 2026-11-01 · **Change:** trivial (locked No Fill and no-outline click-through regression coverage added; No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
Every known shortfall, one entry each, ranked by how much it stops someone who presents with
PowerPoint from switching. This is the work list: pick from the top. Numbers are summarized in
@@ -368,6 +368,7 @@ Detail in [localization-parity.md](localization-parity.md).
| Date | Change | Summary |
|---|---|---|
| 2026-10-31 | trivial | No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged |
| 2026-10-30 | minor | Slide-show click targets use each shape’s own animation state; scale and rotation test added |
| 2026-10-28 | trivial | Automatic lists now run independently of Replace text as you type; proofing gap description updated |
| 2026-10-27 | minor | Refreshed against merged PRs: removed the Morph alignment entry (#67 merged 2026-10-14); #77 (animation rewind, PR #83) is fixed, leaving #74 in the round-trip gap; #75 was closed unmerged, so #60 stays open with no fix PR; #53 is closed and the image-paste gap is now Windows #1414; Reuse Slides (#1103) and Compare reject (#850) noted in the smaller rows; the duplicate header line is gone |
+9 -1
View File
@@ -2,6 +2,8 @@
> **Generated:** 2026-10-14 (bullets/numbering remain D after empty-line marker review; summary by `cargo xtask parity`; rows re-scored by the 2026-10-14 community PR wave, duplicate Thesaurus, AutoCorrect, Artistic effects and Corrections rows folded; Preview in editor re-scored 2026-10-13; earlier rows re-scored 2026-10-10 against PowerPoint for Mac 16.113.4; video/animated GIF row re-scored 2026-10-11, #171) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last updated:** 2026-11-01 · Locked-shape and no-outline regressions added for #1621; fill row re-assessed: remains D; No Fill hit-testing now follows resolved appearance. Scores unchanged.
The summary between `<!-- SUMMARY -->
**Weighted breadth parity: 84%** over 191 features.
@@ -118,7 +120,7 @@ Open P0 items: Contextual tabs (Shape Format, Picture Format, Table Design/Layou
| Shapes | Text warp transforms | P2 | P |
| Shapes | Shape quick styles | P1 | D |
| Shapes | Set as default shape | P2 | D |
| Format | Solid fill and transparency | P0 | D |
| Format | Solid fill and transparency (No Fill interiors pass clicks through, #1621) | P0 | D |
| Format | Gradient fill (linear, radial, rectangular, path) | P0 | D |
| Format | Picture and texture fill | P1 | P |
| Format | Pattern fill | P2 | P |
@@ -233,3 +235,9 @@ Open P0 items: Contextual tabs (Shape Format, Picture Format, Table Design/Layou
| Platforms (✱) | macOS, Windows, Linux builds | P0 | P |
| Platforms (✱) | Web (WASM) build | P1 | D |
| Platforms (✱) | BSD build | P2 | P |
## Revision history
| Date | Change | Summary |
|---|---|---|
| 2026-10-31 | trivial | No Fill interior hit-testing follows resolved fill (#1621); fill row remains D and summary scores are unchanged |
+3 -2
View File
@@ -1,6 +1,6 @@
# UI parity with PowerPoint
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-29 · **Change:** trivial (Picture Format: the Picture Styles row leaves room for Crop and Size, #1232; previous: trivial, Edit Points: Shift, Ctrl/Cmd or Alt/Option on a handle drag sets the point type; previous: trivial, scroll bars on the zoomed slide pane, #1157; previous: major, community PR wave 2026-10-14: 14 new dialogs (41 in all), Eyedropper, Export button, New Window, Grid Options, WordArt gallery and handles, Slide Sorter sections, Quick Access Toolbar, Format Background and Format Shape depth, rich-text clipboard; duplicated rows and headers folded; previous: minor, File tab / Backstage, #76) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-11-01 · **Change:** trivial (locked No Fill and no-outline click-through regression coverage added; No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-26 · **Change:** trivial (dragging several selected slides moves them all; previous: trivial, Edit Points: Shift, Ctrl/Cmd or Alt/Option on a handle drag sets the point type; previous: trivial, scroll bars on the zoomed slide pane, #1157; previous: major, community PR wave 2026-10-14: 14 new dialogs (41 in all), Eyedropper, Export button, New Window, Grid Options, WordArt gallery and handles, Slide Sorter sections, Quick Access Toolbar, Format Background and Format Shape depth, rich-text clipboard; duplicated rows and headers folded; previous: minor, File tab / Backstage, #76) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-22 · **Change:** trivial (group fill and outline edits reach members, #1079; scores unchanged) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-24 · **Change:** trivial (Edit Points: Shift, Ctrl/Cmd or Alt/Option on a handle drag sets the point type; previous: trivial, scroll bars on the zoomed slide pane, #1157; previous: major, community PR wave 2026-10-14: 14 new dialogs (41 in all), Eyedropper, Export button, New Window, Grid Options, WordArt gallery and handles, Slide Sorter sections, Quick Access Toolbar, Format Background and Format Shape depth, rich-text clipboard; duplicated rows and headers folded; previous: minor, File tab / Backstage, #76) · **Target:** Microsoft PowerPoint for Mac 16.113 (Microsoft 365)
@@ -81,7 +81,7 @@ menu colours taken from the theme tokens (menu `chrome`, page `card`).
| Behaviour | PowerPoint | DeckCraft |
|---|---|---|
| Selection handles, rotation handle, yellow adjustment handles | yes | yes |
| Selection handles, rotation handle, yellow adjustment handles | yes | yes; an empty No Fill shape passes interior clicks to underlying objects while its outline and handles remain selectable. Explicit, style and theme fills resolve as rendered; tests also cover locked outline targets and empty interiors without an outline (#1621) |
| Marquee, Shift/Cmd multi-select, Tab to cycle | yes | yes |
| Objects off the slide: drawn on the area around it in Normal view (full strength, master graphics too), selectable and movable there; clipped in the show, exports and thumbnails | yes | yes (#270) |
| Scroll bars on the slide pane when the zoomed slide is larger than the window | yes | yes, on each axis that overflows: drag the thumb or click the track; the wheel and trackpad still pan. The vertical bar does not turn the page (#1157) |
@@ -171,6 +171,7 @@ consistency is open (#73, #56).
| Date | Change | Summary |
|---|---|---|
| 2026-10-31 | trivial | No Fill hit-testing follows resolved fill instead of the presence of a style (#1621); scores unchanged |
| 2026-10-29 | trivial | Picture Format: the Picture Styles row shows as many styles as fit beside the groups after it (at least two) and a More arrow with all 24, as the Transitions and Animations galleries do; Crop and Size are in view in the default window (#1232) |
| 2026-10-26 | trivial | Thumbnail pane and Slide Sorter: dragging one of several selected slides moves the whole selection |
| 2026-10-24 | trivial | Table cells: dragging across cells selects a range of cells |