Commit Graph
3038 Commits
Author SHA1 Message Date
dotCooCoo c04f773850 hayro-syntax: tests check that valid entries survive an unreadable value, and Debug prints the closing brace
Dict's and Array's Debug impls built their output with debug_struct and
debug_list but returned Ok(()) instead of calling finish(), so the
closing brace or bracket was never written: a dictionary printed as
Dict { "B": Boolean(true). Both now end with finish(), as upstream
hayro's do.

The tests from #165 only checked that nothing panics. They now parse a
dictionary with a valid entry on each side of an unreadable value (/#zz,
12-.5, and a dictionary followed by stream with no endstream) and check
that both valid entries come back with their values. The array test
checks that the items before an unreadable item (/#zz, 12-.5) come back
with their values. Both tests also check the Debug output.

Update the local hashes of dict.rs and array.rs and the repair list in
SOURCE.json, and note the change in vendor/README.craft-reader.md.
2026-10-31 21:03:34 -07:00
dotCooCoo 0b4f632596 keymap: test that Shift on the ISO key typing a symbol is dropped
On a layout where Shift and the key next to left Shift type a symbol egui
has a key for, such as [, egui reports the physical key IntlBackslash,
so the press needs Shift to type [ and resolves to [, as Shift on other
symbol keys does. A Shift+[ binding recorded from this key before it had
a physical key no longer runs.

a_symbol_typed_with_shift_on_the_iso_key_drops_shift pins that: the press
runs a [ binding and not Shift+[, and the same press without a physical
key still runs Shift+[.
2026-10-31 21:02:31 -07:00
aiongg f8f8829cc7 Merge pull request #463 from dotCooCoo/fix/keymap-intl-backslash-key
keymap: the ISO key next to left Shift can be bound to shortcuts
2026-10-31 23:42:00 -04:00
dotCooCoo b373482f0b krilla: a gray stop in a CMYK gradient becomes its exact black (patch 17)
A gray stop rewritten into a CMYK space took K as 1 - gray in f32, so gray 0.96 wrote K 0.04000002 and the 8-bit gray 128 wrote 0.4980392 rather than 127/255. K is now subtracted from the shortest decimal that writes the gray, and an 8-bit gray n gives (255 - n) / 255. Patch 17, SOURCE.json and the ledger are updated.
2026-10-31 20:35:25 -07:00
aiongg 970fd6fa39 keymap: test the UK ISO key; the Turkish Q item applies to Windows and Linux 2026-11-01 03:31:51 +00:00
.CooCoo fb08be5fa1 krilla: CMYK, gray and spot colors keep their exact inks (patch 17) (#417)
* krilla: CMYK, gray and spot colors keep their exact inks (patch 17)

Gray, CMYK, Separation and DeviceN colors stored each component as a
u8, so every ink was written as a multiple of 1/255: C75 became
0.7490196 and C4 M4 Y4 K4 became 0.039215688.

- cmyk, luma, separation and device_n Color::new_f32 take components
  from 0 to 1 and write them as given. The u8 constructors are
  unchanged.
- Gradient stops rewritten into one DeviceN, Separation or CMYK space
  keep their components.
- Mesh gradients write corner colors at 16 bits a component.

* Tests: the 75% K mesh corner comment gives the asserted 0.749996
2026-10-31 23:30:23 -04:00
.CooCoo 9d17829194 hayro-syntax: skip a dictionary entry whose value does not parse (#165)
Dict validates a dictionary by skipping its values, and the skip accepts
some values that the parser cannot read: a name with a broken # escape
(/#zz), a number such as 12-.5, and a dictionary followed by stream with
no endstream. Dict::entries and Dict's Debug output unwrapped the result
of parsing every value, so either one panicked on such a dictionary.

Port LaurenzV/hayro#1501 to the vendored copy: entries skips an entry
whose value does not parse, and Debug prints the entries. ArrayIter::next
already ends the iteration on such an item here. Add LaurenzV/hayro#1501's
two tests, update the local hashes of dict.rs and array.rs and the repair
list in SOURCE.json, and note the change in vendor/README.craft-reader.md.
2026-10-31 23:30:03 -04:00
.CooCoo 69c268014e craft-print: serialize calls to the Windows PrintTicket provider (#171)
The first time a process opens a PrintTicket provider for a queue whose
provider is PrintConfig.dll, winspool.drv creates a process-wide cache
without a lock. When two threads make those first calls together,
winspool can keep a pointer to a cache it has already freed, and a later
PTOpenProvider call crashes the process with an access violation in
ntdll. Listing printers from several threads at once reaches it through
two_sided.

Hold one process-wide lock around every call that reaches the provider:
PrintCapabilities::fetch in two_sided and driver_ticket, the
PrintTicketBuilder in driver_ticket, fetch_xml_for_ticket in
imageable_margin, and the start of print_with_progress, where winprint
converts the ticket to a DEVMODE. The job releases the lock at its first
progress report, before it sends progress to the submitting thread. A
lock poisoned by a panic is still taken.
2026-10-31 23:29:47 -04:00
RWoldbergandClaude Opus 5.5 ab2bcccf84 crw: refuse an entropy stream cut short
When the entropy stream ends before the frame does, the stream-end rule gives the
remaining samples their predictor values. That was silent: a raw-data record cut
short inside an intact CIFF heap decoded as a smeared image instead of an error.

`decode` now counts those samples (`Image::stream_end_fill`) and returns
`Error::Corrupt` when there are more than `Limits::max_stream_end_fill` (default
64, one block). `Limits` is non-exhaustive, so the field is additive. The frozen
format is unchanged: a fill within the limit decodes exactly as before.

Every real file measured fills none: 1,318 files of all seven verified bodies
(1,308 EOS D60), whose last samples come from an end-of-block code. The CC0 sample
test still decodes all ten files exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:22:59 -06:00
KotovGGG 3685bae898 fix(ui): suppress trailing drops for host-owned groups 2026-11-01 02:09:38 +03:00
KotovGGG 9a9755568f test(ui): enumerate dock edges without unreachable branches 2026-11-01 01:45:06 +03:00
KotovGGG 4f263edcdd fix(ui): omit stock body bands for host-owned dock groups 2026-11-01 01:31:53 +03:00
KotovGGG 235fffbdbe fix(ui): preserve host docking geometry and split ownership 2026-11-01 00:02:55 +03:00
KotovGGG dcd94c27e7 feat(ui): add host-owned docking surfaces and fitted resize chrome 2026-10-31 18:57:49 +03:00
Carsten KrügerandClaude Opus 5.5 1702fe5782 window: cascade new windows on the real monitor
egui reports a monitor's size but not its place, so Viewports guessed that
monitors tile the desktop. A maximized window's corner is a few points outside
its monitor on Windows, which took a monitor up and to the left that doesn't
exist, and every window cascaded from it opened off screen. The guess is also
wrong whenever monitors differ in size or sit at other offsets.

Add Viewports::set_monitors: the app lists the monitors in physical pixels and
the driver picks the one showing most of the previous window, at that window's
scale. For apps that don't list them yet, the guess now allows for a maximized
window's frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:20:44 +01:00
JeremyandClaude Opus 5.5 cb39b5e8ca test: accept any well-formed account SID, not only S-1-5-
A Microsoft Entra ID account's SID starts S-1-12-1-, so the test failed on
those machines although the lookup works. It now checks the SID's shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:56:25 +00:00
JeremyandClaude Opus 5.5 c591798d51 fix(update): read an MSI's install context without starting PowerShell
msi_context::probe now reads Windows Installer's own registration keys (the
packed product code under HKLM Classes\Installer\Products, HKCU
Installer\Products and HKLM Installer\Managed\<SID>) instead of a hidden
PowerShell ProductsEx lookup. Same route as storytold/craft-launcher#1082.
msi_context.ps1 is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:26:05 +00:00
dotCooCoo fc37b20235 keymap: the ISO key next to left Shift can be bound to shortcuts
craft_keymap::Key gains IntlBackslash, the key between left Shift and Z
on ISO keyboards (`<` and `>` on Turkish Q). Key::from_egui and to_egui
map it to egui's IntlBackslash, so the shortcut recorder records it and
the dispatcher runs its bindings. Its shortcut text is `IntlBackslash`
(`Cmd+IntlBackslash`, `Shift+IntlBackslash`), read without regard to
case; `<` and `>` still parse as no key.

The key counts as a symbol position: Shift stays in the chord, and once
the layout has typed `<` there, display_for shows `Ctrl+<`.
MAX_CHORD_TEXT goes from 64 to 72 bytes so that the longest canonical
trigger, `Cmd+Ctrl+Alt+Shift+IntlBackslash` pressed twice, reads back.
2026-10-30 23:00:40 -07:00
Dylan M. Taylor c39e435cc3 Merge pull request #462 from aiongg/update-result-dialog
update: CheckResultDialog for the result of a manual update check
2026-10-31 01:04:55 -04:00
Dylan M. Taylor 487b4d4270 Merge pull request #461 from aiongg/docs-tidy
docs: tidy AGENTS.md and clean-room doc
2026-10-31 01:04:43 -04:00
aiongg c5a1cbfb5f update: CheckResultDialog shows the result of a manual update check 2026-10-31 04:39:40 +00:00
aiongg a2be97cf8e docs: tidy AGENTS.md and clean-room doc 2026-10-31 04:17:35 +00:00
marshiyar 61bde471fd update: a package manager's copy and another app's bundle do not self-update on macOS and Windows
self_update::detect fell back to Install::Standalone for any executable it
could not place, so on macOS a Homebrew, MacPorts or Nix copy, or a program
inside another app's bundle, was replaced in place, and on Windows so was a
scoop, winget, Chocolatey or Store copy. The package manager's record then
stays on the old version, and the bundle belongs to another app.

macOS now treats executables under /opt/homebrew, /usr/local/Cellar,
/usr/local/Homebrew, /usr/local/opt, /opt/local and /nix as owned by a package
manager, and any executable inside an .app bundle that is not this app's own
as not ours; none of them self-update. Windows does the same for scoop, winget,
Chocolatey and WindowsApps folders. The rules are plain path functions, so
they are tested on every platform.

Tested: three new tests failed before the change (the macOS and Windows folder
rules, and detect on an executable in another app's bundle) and pass after it.
cargo test -p craft-update (209 tests), clippy -D warnings and fmt pass on
macOS; the Windows branch was not compiled here.

Fixes #390 for macOS and Windows; the Linux side is #388.
2026-10-30 20:02:37 -07:00
Dylan M. Taylor 4323a0f90e Merge pull request #406 from solarmaster961/fix/flatpak-system-bundle-self-update
fix(linux): self-update a system-wide Flatpak bundle in place
2026-10-30 22:56:43 -04:00
Dylan M. Taylorandcoderabbitai[bot] 003f133f6d Update crates/update/src/install.rs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-10-30 22:48:52 -04:00
VoiceLessQ 7ec82661cb fix(update): cap a GitHub rate-limit wait at one hour
An absurd x-ratelimit-reset or retry-after stopped the API until restart.
GitHub's quota refills within the hour.
2026-10-30 22:44:18 -04:00
VoiceLessQ f0b5b22dce fix(update): read GitHub API answers up to a 16 MiB cap
get_api shared the 4 MiB limit for small answers. A launcher version list of
100 releases can pass that: SolidCraft's was 6.5 MB (craft-launcher#1021).
Other small requests keep 4 MiB.
2026-10-30 22:43:46 -04:00
Dylan M. Taylor 2b8bd856ce Merge pull request #458 from storytold/fixup/crw-365-follow-up
fixup(crw): trim derivation artifacts (follow-up to #365)
2026-10-30 22:42:50 -04:00
Dylan M. Taylor a0fdc73717 fixup(crw): trim shipped derivation artifacts 2026-10-30 22:41:55 -04:00
Dylan M. Taylor b645a09174 Merge pull request #365 from rwoldberg/clean-room-crw-format-decode
Clean room crw format decode
2026-10-30 22:40:13 -04:00
Dylan M. Taylor 0ad3952f5e docs(crw): declare table generator Python version 2026-10-30 22:40:07 -04:00
Zinadin ZidanandClaude Opus 5.5 7070670d5f Merge main into fix/391-safe-release-link
Brings in main's launcher version pins (craft-update: apps respect the
launcher's per-app version choice, and the follow-ups through 9817c81).

One conflict, in updater.rs's tests: main made the newer() helper
pub(super) for updater_pin_tests.rs, and this branch added its two #391
tests (download_opens_only_a_safe_release_page,
every_releases_page_is_a_safe_web_link) just above it. Kept both tests
and main's pub(super). Everything else merged cleanly: Download still
goes through download_action (safe_web_link, then the app's releases
page), "What's new" still checks safe_web_link, and main's pin checks
in offer, check_now, finish_check and start_install are untouched. Main
adds no new way for the prompt to open a URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:09:40 +06:00
Dylan M. Taylor 8846e5d34a Merge pull request #449 from Jeremy8776/feat/update-version-pins
craft-update: apps respect the launcher's per-app version choice
2026-10-30 20:55:18 -04:00
JeremyandClaude Opus 5.5 9817c81fd2 craft-update: the version-choice file sits in a host folder Flatpaks can read
A Flatpak launcher wrote versions.json inside its own sandbox, and no Flatpak
app could read the launcher's folder, so pins never reached Flatpak apps, nor
host apps started from their menu entry. The file now sits in its own folder,
ArtCraft/versions under the host's per-user data folder, found from inside a
Flatpak too (HOST_XDG_DATA_HOME, else ~/.local/share). A Flatpak app reads it
with one read-only grant for that folder alone (pins::FLATPAK_GRANT).

folders::host_data_local_dir replaces install's private copy of the same rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:55:00 +00:00
Martin Ball 9dce709a53 Merge storytold/wordcraft#4191 2026-10-30 21:16:12 +00:00
Martin Ball 12c0bd61e3 Merge storytold/wordcraft#4575 2026-10-30 21:16:12 +00:00
Zinadin ZidanandClaude Opus 5.5 35b908febb update: only ureq's Trace logs print the GitHub token (#391)
ureq 3.5's Debug request log lists an allow-list of safe headers and
leaves Authorization out; the unredacted wire is its Trace output
(ureq-proto's log_data). `Http::with_github_token` now says so: apps
should redact Bearer tokens or keep `ureq` and `ureq_proto` at Debug or
quieter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:56:36 +06:00
Zinadin ZidanandClaude Opus 5.5 7ae5bbf07d update: Download falls back to the app's releases page (#391)
Download closes the prompt, so a release link that fails
`release::safe_web_link` left the user with nothing opened. It now opens
`App::releases_url()` instead, which passes the check for every app in the
suite; a release link with `&` or another shell metacharacter is still
refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:56:36 +06:00
Zinadin ZidanandClaude Opus 5.5 3f21cfa0ae update: the prompt opens only a safe release link; document token logging (#391)
`Release`'s fields are public, so an app that builds one from its own
feed or cache could hand any URL to the prompt's "What's new" link and to
Action::OpenUrl after Download. Both now go through
`release::safe_web_link`, as the launcher does before every open_url.
`Http::with_github_token` says that ureq's debug logs print the Bearer
token, so apps should redact it or keep ureq below Debug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:22:32 +06:00
MarekSpodBiedry a2c28ae762 hayro-interpret: pad a missing low byte in 16-bit image data instead of panicking (#328) 2026-10-30 16:38:22 +01:00
JeremyandClaude Opus 5.5 0ada678488 craft-update: every check answer uses the launcher's choice as it stands when the check ends
finish_check now re-reads the choice before looking at the answer, so an app
the launcher pinned mid-check reports UpToDate and an up-to-date managed()
whether the network found a release, nothing, or an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:52:57 +00:00
JeremyandClaude Opus 5.5 a710ab7897 craft-update: a pin made while a check runs still holds its answer
finish_check used the choice cached when the check started, so a launcher
pin made during the network request still opened the stable prompt. It now
re-reads the choice when the check finishes, as offer does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:42:23 +00:00
JeremyandClaude Opus 5.5 0db8c1ba47 craft-update: a pin closes a stale prompt; tracks() skips stable; isolate the pretend test
Review fixes for #449:
- A prompt opened while the app followed stable stayed open after the
  launcher pinned it, and its Update button still installed the stable
  release. Reading a managed choice now closes a prompt that is not
  installing, and an install re-reads the choice before it starts. A
  running or finished install keeps its prompt, which tick reports through.
- Pins::tracks listed an explicit Stable entry despite its docs.
- The pretend-version child test read the developer's real pins file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:36:42 +00:00
JeremyandClaude Opus 5.5 7d303b4b50 craft-update: apps respect the launcher's per-app version choice
The launcher lets someone keep an app on an older release or on nightlies,
but the app's own update check never knew, so a pinned app prompted to
update on every start and "Update and restart" undid the downgrade.

`pins` is one small file the launcher writes (versions.json in its per-user
data folder, or the absolute path in CRAFT_VERSIONS_FILE) and apps read:
app id to Stable, Nightly or Pinned(tag), the launcher's own serde shape.
A missing or damaged file means everyone follows stable; an entry a newer
launcher wrote is left to the launcher and kept on save.

`Updater` reads it before each check and before an offer. An app kept off
stable gets no prompt and no network call; a requested check reports
UpToDate, and `Updater::managed()` says why, so the public Status enum is
unchanged and no app breaks on a rev bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:22:38 +00:00
Dylan M. Taylor 04aa1703b3 update: honor pretend versions in app release checks (#436) 2026-10-30 02:12:36 -04:00
Dylan M. Taylor 1065653e75 craft-update: the startup prompt shows the app's icon, accent colour and developer (#434)
The update prompt drew the app name's first letter in a blue square and used that blue for
its buttons and highlights. App gains accent and developer, and the prompt now draws:

- App::icon_png (decoded once per context, PNG only, at most 1024 px a side and never past
  the renderer's texture limit), keeping the letter badge for an app without a usable icon;
- App::accent filling its buttons, the badge and an UPDATE chip, with white or black text,
  whichever contrasts more, so every Craft app's accent reaches WCAG AA (4.5:1) for these
  small labels; the What's new link is body text with an accent underline (accent-coloured
  text missed 4.5:1 for several apps). No accent keeps the default blue;
- "by <developer>" beside the app name: App::developer, ArtCraft (app::DEVELOPER) for every
  app in the storytold organisation unless the app passes its own;
- its own button states: backgrounds for unfilled buttons (LATER, DISMISS) when hovered and
  pressed, as the host app's style can hover in a colour its dark text doesn't read on, and a
  2 px focus ring in the body text colour on every button (egui shows focus in that state)
  and on the What's new link.

Apps opt in by passing their own App, e.g.
App { icon_png: Some(include_bytes!("…128x128…png")), accent: Some([0x3f, 0x5f, 0xe0]), ..suite::WORDCRAFT }.
2026-10-30 01:25:19 -04:00
Dylan M. Taylor 733a038aa5 craft-print: log why the printer list is empty when lpstat can't run; document Flatpak needs (#429)
* craft-print: log why the printer list is empty when lpstat can't run; document Flatpak needs

Flatpak apps saw "No printers found" with working CUPS printers: the Freedesktop
runtime has libcups but not lpstat/lp, and the sandbox had neither the CUPS socket
nor Avahi (driverless printers come from lpstat -e). Log the spawn failure and say
in the README what a Flatpak must bundle and grant.

* craft-print: log a failed lpstat -p -d; README separates what each Flatpak piece is for

Review (CodeRabbit): a non-zero lpstat exit was dropped silently, and the README
said any missing piece empties the printer list when only lpstat and the socket do.

* craft-print README: driver options need the PPD, remote servers need network, socket paths are remapped

Review (CodeRabbit): printer_options reads /etc/cups/ppd before lpoptions, so it is
the PPD, not lpoptions, that a Flatpak lacks; a client.conf server is reached only
with --share=network.

* craft-print README: scope the CUPS_SERVER override to one app; describe the stricter socket wrapper

Review (CodeRabbit): flatpak override without an app id applies to every app.
2026-10-29 18:48:26 -04:00
VoiceLessQ 0d6fbfc403 Merge origin/main
main split Czech's suggest_in into one helper per round for the
cognitive_complexity limit (storytold/wordcraft#4501). On this branch that code is the
shared affix_suggest::suggest_in (36 of 30), so cs/suggest.rs stays the
thin wrapper and the shared function gets the same split. The candidates
are offered in the same order; a dump of 13,081 calls over every
language's test dictionary matches the old engine except one: the typo
round counts the lower-cased letters, so "İ" (two letters lower case)
now gets "I" in Polish, where the old count stopped one letter short.
2026-10-29 14:55:30 -02:00
Don Omondi 67cbb60759 pdf reader: a five-point open polyline is not a rectangle
`path_as_rect` in the vendored hayro-interpret took any five-element path whose
points reached all four corners of its bounding box for that box. An open
polyline of one MoveTo and four LineTo passes that test when its ends sit on
the corners, so it was drawn as a closed rectangle and a clip of that shape was
dropped. VectorCraft #2920: an open zigzag in an .ai file opened as its
bounding box.

Port PdfCraft #3327 (hayro-interpret patch 35): a path is a rectangle only when
its four points are distinct, each step runs along one axis, and the last point
returns exactly to the first, closed with ClosePath or a fourth line.

Tests: `rectangles` in crates/pdf/tests/interpretation.rs (4 of its 5 tests
fail without the change) and `context::path_as_rect_tests` in the vendored
crate. SOURCE.json and the reader ledger record the change.
2026-10-29 19:10:31 +03:00
aiongg 1b5582a72e Merge pull request #423 from Jeremy8776/feat/self-update-migrate-to-machine
craft-update: an app installed for one account moves to an install for everyone on its update
2026-10-29 11:44:02 -04:00