Repository navigation
.ai import: Offset Path, Outline Object and Outline Stroke open live - #5148
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Filter parsing and validation crates/eps/src/import/ai/style.rs, crates/eps/src/import/ai/style/tests.rs, crates/engine/tests/import_fuzz.rs |
The parser records filter entry types and recognizes Offset Path only when its required typed values are present and valid. It recognizes outline effects with no dictionary entries. Tests and fuzz coverage exercise settings, ordering, visibility, malformed values, and import panic behavior. |
Path import and parity crates/eps/src/import/ai/tests.rs, crates/eps/src/import/tests_native.rs, docs/file-format-parity.md, docs/target-app-parity.md |
Import tests cover live path effects and drawn-look fallback when Offset Path settings are incomplete. Parity documentation describes supported effects, preserved settings, and unsupported effects on individual fills or strokes. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Suggested reviewers: aiongg, erickuck
Merge Risk: 
Minimal · previous review db33f
-
The imported outline effects remain live on type. No concrete issue identified here prevents merging after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the three effects (Offset Path, Outline Object, Outline Stroke) and the outcome (they open as live effects on .ai import). The changeset adds parsing, tests, and docs for exactly these effects, so the title matches the main change.
Full details: Description check
-
Explanation
The description includes the required What and why, How it was tested, and Checklist sections. It explains the behavior, fallback cases, test coverage, reported validation results, and marks all checklist items complete.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 5 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- 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.
db33fea to
dc363ec
Compare
|
Merged, thanks @dotCooCoo! It went in with this round's batch after a full CI run and a live check. Convert to Shape's test now expects Offset Path beside it to be read on any object, since this makes Offset Path live everywhere. |
Read the Pathfinder filter through the shared dictionary parser's Filter.kinds from storytold#5148 in place of the branch's own key tracker. Only Add (Command 0) is read: its keys and values come from a public LiveEffect XML example, and the other command numbers have no public source, so they keep the drawn look.
What and why
Part of #637.
A
.aior EPS path whose art style is one fill and one stroke at most, with Offset Path, Outline Object or Outline Stroke on the whole object, now opens as itself with those effects live, instead of as its drawn look. Type with Outline Object or Outline Stroke, on the object or on one of its fills or strokes, now keeps its art style live too. Effects can be applied to a whole object or to one of its fills or strokes (Help: apply and modify effects: "select the object and then select the attribute in the Appearance panel").Adobe Offset Path,Adobe Outline Type(Outline Object) andAdobe Outline Stroke, as in this MIT-licensed effect script (LE_Functions.js, whoseLE_OutlineObjectwritesAdobe Outline Type). Outline Object and Outline Stroke have no settings. Outline Stroke takes its width from the stroke it applies to.ofstin points,jntpandmlim(community post: "0 = round, 1=bevel, 2=miter"; archived aiscripts.com post: "mlim is the MiterLimit Value").An Offset Path with a missing key, an unknown key, a key of another type, a value that isn't a finite number, an offset beyond 100,000 pt, a miter limit outside 1 to 500 or a join other than 0, 1 or 2 now keeps the drawn look. Before, on type, a missing setting was read as 10 pt, miter or 4, and an out-of-range one was clamped. An Outline Object or Outline Stroke with any setting also keeps the drawn look. A path with one of these effects on one fill or stroke keeps its drawn look as before.
How it was tested
Synthetic art styles written in the tests, from scratch:
crates/eps/src/import/ai/style/tests.rs: Offset Path on the object with each join and a negative offset; Outline Object and Outline Stroke on the object, a fill and a stroke, Outline Object before the item's own style and Outline Stroke after it; two Offset Paths in order with the first one hidden; Offset Path before Transform on a fill and a stroke; and 15 Offset Path dictionaries that are not read (empty,ofstonly,jntponly, a missingmlim, an extra key, wrong types, a string, an infinite value, an offset or miter limit out of range, joins 3, -1 and 0.5), on the object and on a fill.crates/eps/src/import/ai/tests.rs: a path keeps its own geometry with Offset Path, a hidden Outline Object and Outline Stroke live; an Offset Path withoutmlimkeeps the drawn look.crates/eps/src/import/tests_native.rs: type keeps Outline Object on one fill. The Offset Path in that test now has itsmlim.crates/engine/tests/import_fuzz.rs: a new case with up to five of the three effects, shown or hidden, with any of Offset Path's keys and unknown ones as any type and value, on the object, a fill or a stroke of a path, a group and type; the hostile-data tokens include the filters and their keys.On
db33fea21e(base05d5f99fd7), macOS:cargo fmt --all -- --checkcargo clippy -p vectorcraft-eps -p vectorcraft-engine --all-targets -- -D warningscargo test -p vectorcraft-eps: 546 passedcargo test -p vectorcraft-engine --lib -- ai: 391 passedcargo xtask brands,layers,assetsThe branch merges cleanly with
mainat77274ac5ff. It changes the same lines ofcrates/eps/src/import/ai/style.rsas #5139, #5140, #5142 and #5144, and ofdocs/file-format-parity.mdas #5046, #5082 and #5132; whichever merges later needs a rebase.cargo xtask cipassed in this pull request's CI run ondb33fea21e: https://github.com/storytold/vectorcraft/actions/runs/41339491685/job/124946281520Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit
.aifiles now preserve supported live Offset Path, Outline Object, and Outline Stroke effects on eligible objects, including their settings, visibility, and order..aiformat guidance to clarify supported live effects and drawn-appearance fallback behavior.