8561 Commits

Author SHA1 Message Date
.CooCoo d0d73ff553 Merge pull request #9131 from dotCooCoo/feat/js-es2017-async-await
JavaScript: .js scripts run async functions and await
2026-12-02 11:37:17 -08:00
.CooCoo 5cfc4cf100 Merge pull request #9041 from dotCooCoo/feat/scripts-api-d2-paths-colors
Scripts: documents give scripts their paths, path points and colors
2026-12-02 11:15:31 -08:00
.CooCoo dcb7085b2a Merge pull request #9139 from dotCooCoo/feat/plugin-api-events
Plug-ins: react to selection, layer, open and save events
2026-12-02 11:15:23 -08:00
.CooCoo 5d22b25bb7 Merge pull request #10333 from dotCooCoo/fix/script-new-document-overprint-links
Scripts: file.new takes Overprint Preview and reads the profile's linked files
2026-12-02 11:15:14 -08:00
.CooCoo 0a14ee1d23 Merge pull request #10363 from dotCooCoo/fix/close-native-range
Scripts: close with SaveOptions.SAVECHANGES saves a native file whose last save named a range
2026-12-02 11:15:06 -08:00
.CooCoo 9fe1d7ecfb Merge pull request #10586 from dotCooCoo/fix/script-back-document-bounds
Scripts: geometry read from a document in the back matches what the setters measure
2026-12-02 11:14:48 -08:00
.CooCoo d22a7330e1 Merge pull request #10589 from dotCooCoo/fix/pg9087-2
Scripts: a script chosen after the startup scripts may print to a printer
2026-12-02 11:09:18 -08:00
.CooCoo 491d1324cf Merge pull request #10572 from dotCooCoo/fix/pg9087-3
Print: maxPages turns a job away before raster effects are flattened
2026-12-02 11:09:01 -08:00
.CooCoo 1d829ef718 Merge pull request #10569 from dotCooCoo/fix/pg9087-4
Print: Document.print throws for CUSTOMPROFILE without a profile name
2026-12-02 11:08:31 -08:00
dotCooCoo 31d02e4821 Scripts: startup scripts at launch list no printers, and spool failures stay shown
The startup scripts run at launch no longer list the print service's
printers, so the first window does not wait on it; a script.startup.run
with any other reason still lists them. A script's print jobs that the
desktop's worker fails to send are shown in the status bar even when a
later line, a later batch that was sent or a startup script's failure
took it, and the startup script's notes stay in the hover.
script.startup.run's params text describes the print wait and the
launch rule.
2026-12-02 07:39:44 -08:00
dotCooCoo f8eb542e04 Scripts: geometry read from a document in the back matches what the setters measure
The bounds getters (position, left, top, width, height and the bounds
arrays) read an item in a document in the back without measuring its type,
while the setters measure it after the switch to that document since
#10538. A script that read t.width and assigned it back could resize the
item, and every geometry assignment switched to the document and back even
when nothing changed.

The getters now measure type not measured yet in a document in the back
for an item that holds type, a symbol instance or a placed document, the
way the switch measures it, and the check is skipped while the document is
unchanged. An assignment equal to the current value of an object without
such content in a document in the back returns without switching
documents, and no undo step is made.
2026-12-02 07:21:25 -08:00
dotCooCoo fffcca5cd2 CI: build paths without parent-step literals the read check counts as reads
The shared gate's undeclared-read check (select legs) reports two reads
on main: crates/text/build.rs reads the workspace root (`.`) and
crates/engine/src/tests/fontfiles.rs reads `crates`. Neither path names
another member's files.

- crates/text/build.rs takes the workspace root as the second ancestor
  of the crate directory instead of joining "../..". A relative
  CRAFT_FONTS_DIR still resolves from the same directory.
- the_fonts_folder_next_to_a_document_is_an_absolute_path builds its
  climb to the filesystem root from ParentDir components instead of
  formatting a repeated "../". The test still opens the document by a
  relative path to its temporary folder.

The check reports 0 problems on the result, down from 2 on main.
2026-12-02 06:20:29 -08:00
dotCooCoo 5886c70c8d Print: maxPages turns a job away before raster effects are flattened
file.print with maxPages flattened every raster effect in the document
before it counted the pages, so a job it then turned away still paid
for rendering each effect. The page count from the artboards now runs
first, on the artboards alone, and raster effects are flattened only
for a job that fits.

Follows up on #9087.
2026-12-02 05:55:33 -08:00
dotCooCoo 549a383942 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 05:32:57 -08:00
dotCooCoo c2a2f38a4e Merge main into feat/js-es2017-async-await 2026-12-02 05:32:01 -08:00
dotCooCoo d359bb7e1a Print: Document.print throws for CUSTOMPROFILE without a profile name
A script that set PrintColorManagementOptions.colorProfileMode to
CUSTOMPROFILE and assigned no name printed with the base settings'
profile, as though no custom profile had been asked for. The job now
throws before anything is written, as it does for an empty name.

Follows up on #9087.
2026-12-02 05:13:50 -08:00
.CooCoo 2498ef4682 Merge pull request #10185 from dotCooCoo/feat/js-object-set-prototype-of
Scripts: ES2015 realms have Object.setPrototypeOf
2026-12-02 02:36:46 -08:00
.CooCoo d100d66a06 Merge pull request #10250 from dotCooCoo/fix/retype-period-font-order
Retype: glyphs drawn alike in several fonts count as one outline in near matching
2026-12-02 02:22:02 -08:00
dotCooCoo 3ea259e6b9 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 02:20:34 -08:00
.CooCoo ce867b3d23 Merge pull request #10467 from dotCooCoo/fix/sr-art-limit
Step and Repeat: refuse a grid whose copies would hold more than 250,000 objects
2026-12-02 02:02:46 -08:00
.CooCoo 68b01f3a5d Merge pull request #10480 from dotCooCoo/fix/wrap-sources-no-copies
Text Wrap: Make's no-type warning checks the wrap objects without copying their shapes
2026-12-02 02:02:39 -08:00
.CooCoo d753c48d2e Merge pull request #10483 from dotCooCoo/fix/windows-evalfile-uri
Scripts: $.evalFile reads the URI paths File.parent gives, on Windows too
2026-12-02 02:02:31 -08:00
.CooCoo 907db2002f Merge pull request #10487 from dotCooCoo/fix/mark-bounds-tiny-objects
Arrange Tools: Mark Bounds of Each draws no empty group for an object too small for corner legs
2026-12-02 02:02:23 -08:00
.CooCoo e3e84bd4fb Merge pull request #10539 from dotCooCoo/fix/ai-save-options-compatibility-default
Scripts: new IllustratorSaveOptions reads compatibility as ILLUSTRATOR19
2026-12-02 02:01:50 -08:00
.CooCoo 02ca7c1148 Merge pull request #10538 from dotCooCoo/fix/script-setters-measure-after-activate
Scripts: width, height and position setters measure after the document comes to the front
2026-12-02 01:45:21 -08:00
.CooCoo b601a3bf44 Merge pull request #10540 from dotCooCoo/fix/script-write-holds-checked-folder
Save: checked writes go into the folder that was checked
2026-12-02 01:26:46 -08:00
.CooCoo 0c6aaa074d Merge pull request #10448 from dotCooCoo/fix/make-numbers-sequence
Type Tools: Make Numbers Sequence numbers the selected type objects
2026-12-02 01:10:32 -08:00
dotCooCoo 9b40798f6a Merge main into fix/retype-period-font-order 2026-12-02 00:40:20 -08:00
dotCooCoo 8c6ce6d5c9 Tests: read-only fixture test checks it caught its own panic
The test caught any panic from its closure, so a failed set_permissions
would also pass it while the file was still writable. It now asserts
the file is read-only before its panic and checks the caught payload is
that panic's message.
2026-12-01 23:53:39 -08:00
dotCooCoo 2690d0e133 Merge main into fix/script-write-holds-checked-folder 2026-12-01 23:24:23 -08:00
dotCooCoo 6cf9145890 Save: checked writes check the open folder's path as it is
The second check of a checked write passed the open folder's path as
text and looked it up again. A path that was not valid UTF-8 was refused,
and a folder on that path replaced by a link into an allowed folder
between the two lookups could let a place outside pass.
check_write_real compares the open folder's real path with the write
roots and the script's grants as it is, without looking it up again.

- The folder is opened with O_PATH on Linux, Android and FreeBSD, so a
  folder that can be written and searched but not listed takes the file.
  The folder flush opens it for reading, and an error there still
  reports the completed write.
- The replaced file's permissions are read after the new content is
  written, as write_atomic_with reads them, so permissions taken away
  meanwhile stay taken away. Its ACL is read only from the same file.
- A folder that changed while it was opened is no longer reported as a
  read-only location.
- Errors name the kept temporary file where its folder is now, after
  the folder moved.
- A file already at the name the old content is copied to is left as it
  is: only a copy this save made and could not finish is removed.
2026-12-01 23:24:20 -08:00
dotCooCoo 615d35f878 Merge main into fix/script-save-test-workspace 2026-12-01 22:54:36 -08:00
dotCooCoo 81c9588b26 Tests: read-only gate test sets up its cleanup before the first assertion
a_script_gate_does_not_write_over_a_read_only_file created its
ReadOnlyFixture guard after two assertions, so a failure in either left
the test folder behind. The guard is now created right after the file
path is made, before the file is written.
2026-12-01 22:54:36 -08:00
.CooCoo 7554b7fc30 Merge pull request #10196 from dotCooCoo/fix/script-module-scan-clock
Tests: the .mjs listing test lists the Scripts folder on a fixed clock
2026-12-01 22:48:46 -08:00
dotCooCoo 46dbb1fb28 Tests: script save tests remove their folders when an assertion fails
folder() in tests/script_save_open.rs returned a PathBuf, and each test
removed its folder only on its last line, so a failed assertion or a
panicking script left the folder in the system's temporary folder. It now
returns a Workspace guard, as tests/script_print.rs does, which removes
the folder when it is dropped and clears read-only flags first when the
first removal fails (Windows does not delete a read-only file).

a_script_gate_does_not_write_over_a_read_only_file in file_access.rs made
its file writable again and removed its folder only after its last
assertion; a guard now does both when the test ends.
2026-12-01 22:41:20 -08:00
.CooCoo 9cfa3f1d13 Merge pull request #10525 from dotCooCoo/fix/engine-test-pass
Tests: engine command and integration tests check what they claim
2026-12-01 22:31:51 -08:00
.CooCoo b15abf8a36 Merge pull request #10536 from dotCooCoo/fix/engine-src-tests-guards
Tests: engine tests that check every item also check the items exist
2026-12-01 22:30:11 -08:00
.CooCoo c45cdeff00 Merge pull request #10529 from dotCooCoo/fix/engine-src-tests-pass
Tests: engine tests assert results instead of only success
2026-12-01 22:29:55 -08:00
.CooCoo 95dd368c2c Merge pull request #10188 from dotCooCoo/fix/craft-fonts-pin-main
CI: move the craft-fonts pin to craft-fonts main in every workflow, so builds embed the tab-title face
2026-12-01 22:27:41 -08:00
dotCooCoo 4cb6f8f152 Save: checked writes go into the folder that was checked
While automation roots or a script's file grants are in force, a save,
export or print to a file checked its path and then wrote it by name: the
temporary file was created beside the target by name and renamed over it
by name. A folder on the path replaced by a link between the check and
the rename sent the file outside the allowed folders.

vectorcraft_format::write_atomic_checked opens the target's folder once,
checks the path that open folder has with the caller's check, and makes
the temporary file, the rename, the copy over the file where the folder
refuses the rename, and the folder flush through that open folder
(openat, renameat, fsync). A folder replaced before it is opened fails
the check; one replaced after it is opened does not receive the file. A
link put at the final name after the check is replaced, not followed.
The replaced file's permissions, group and ACL are copied through the
open handles.

write_file, write_file_with and write_save_file_with use it while writes
are checked, and keep write_atomic_with otherwise. Outside Unix the check
runs on the path and the write is unchanged.
2026-12-01 22:06:44 -08:00
dotCooCoo e5df2445e3 Scripts: new IllustratorSaveOptions reads compatibility as ILLUSTRATOR19
A new IllustratorSaveOptions left compatibility unset, so a script that
read it before setting it got undefined. It now starts at
Compatibility.ILLUSTRATOR19, the documented default, which saveAs already
accepts without changing what it writes.
2026-12-01 21:31:56 -08:00
dotCooCoo 45bd5bb967 Tests: the plain column drawn for a design past the budget is checked as a rectangle
graph_column_params_are_checked_and_designs_too_big_are_drawn_plain checked
only the plain column's height, so an ellipse of the same height passed. It
now also checks that the column's path is the rectangle of its bounds.
2026-12-01 21:19:18 -08:00
dotCooCoo 70d70ca909 Scripts: width, height and position setters measure after the document comes to the front
Setting width, height, left, top or position on an item in a document in
the back measured the item before its document was made active. Making a
document active measures its type again where it is not measured yet or
where a composite font of the same name changed, so the scale ratio or the
move distance applied to bounds that no longer held, and the item ended
at a different size or place than the one asked for.

The measurement now runs inside the edit, after the switch, through a new
edit_item_with that edit_item also uses.
2026-12-01 21:09:17 -08:00
dotCooCoo b354c29de0 Type: Make Numbers Sequence keeps a seeded order and its doc line names skipped objects
A new test runs the same eight objects with seed 11, an end and
removeUnused in two fresh sessions and checks that each object gets the
same number and the same objects are removed. The progress doc line says
that in numbers and placeholder modes objects without a match are
skipped before ordering, so they take no number and are never deleted,
and that only a run that changes the document makes an undo step.
2026-12-01 20:31:43 -08:00
dotCooCoo bdf6454780 Merge main into fix/engine-test-pass 2026-12-01 20:28:57 -08:00
dotCooCoo 0a9ea7ad8d Merge branch 'fix/engine-test-pass' of github.com:dotCooCoo/vectorcraft into fix/engine-test-pass 2026-12-01 20:28:46 -08:00
dotCooCoo e97b699b95 Tests: folder search tests wait for the walker by handshake, not by sleeping
The deadline test and the kept-files test polled the search's progress
with a 2 ms sleep until the walker was blocked reading a file, which
test-lint rejects. The blocking visitors now send on a channel as their
read begins, and the tests wait on that channel instead.
2026-12-01 20:27:27 -08:00
dotCooCoo 02077bb5a3 Merge main into feat/js-object-set-prototype-of 2026-12-01 20:25:00 -08:00
.CooCoo 22bc29d69d Merge pull request #10460 from dotCooCoo/fix/test-lint-mirror-false-alarms
xtask: test-lint mirror leaves out entry reads, never-run follows #[path] modules
2026-12-01 20:19:50 -08:00
dotCooCoo c21cc4f3ff Tests: engine tests that check every item also check the items exist
Engine tests in crates/engine/src/tests that asserted something of every
item in a list passed when the list was empty. They now pin the count or
the exact value:

- keyguide, menucmds, recolor: the guide positions, the smart
  punctuation counts and the theme picker's colors are compared whole.
- overprint, script_text, stylepanel, textedit, typearea: the text is
  checked first, and character runs must exist; the Graphic Styles test
  checks the red fill itself, not only some fill.
- package, pattern, perspgrid, pixelalign, recolor, swatchcmds,
  symbollib, xform: the links, stored graph paints, corners, anchors,
  map rows, group colors, gradient stops and symbol sizes are counted.
- rastersettings: the white-background image has the size of the clear
  one.
- textcombos: both paragraphs take the composer and justification.
- textedit: a character style range past u32 leaves the text object
  unchanged.
2026-12-01 20:18:48 -08:00