Cargo warned that craft-theme is an unused dependency of craft-platform
(crates/platform/Cargo.toml:36) when the `appearance` feature is off. The
crate uses it in two places: the `From<appearance::Reading>` impl for
`craft_theme::SystemAppearance`, compiled only with `appearance`, and the
browser eyedropper in `screen`, which used `Srgba::from_hex` on the
EyeDropper's `sRGBHex` answer.
- craft-theme is optional, and `appearance` enables it.
- The eyedropper reads the `#rrggbb` answer with `eyedropper_color` in
screen.rs, so `screen` does not need craft-theme. Any other text is
still reported as an invalid color.
- README: the `SystemAppearance` conversion is listed under `appearance`
instead of "always".
Cargo.lock does not change.
`cargo test -p craft-platform --lib` failed one of the two `logs::crash`
tests on most runs. The panic hook and the last-panic slot are
process-wide, and `cargo test` runs the binary's tests on parallel
threads, so the panic in `logs_tests::a_poisoned_sink_still_logs`
(`poison the sink`) replaced the trial's own panic in `take_last`.
Each crash test now runs its body in a child process of the test binary
that runs only that test (`--exact`), and fails when the child fails or
did not run it. The serial lock between the two tests is removed.
core-graphics2 0.6.1, its latest release, depends on block 0.1.6, which
the compiler reports as code that a future version of Rust will reject.
The `screen` feature now takes Core Graphics from objc2-core-graphics
0.3, the objc2 family craft-platform already uses, and block and
core-graphics2 leave Cargo.lock.
The two calls that need `unsafe` (the active display list and an
image's pixel bytes) are in a new craft-appkit module, `display`, with
tests. The capture makes the same Core Graphics calls and checks as
before.
`drop_does_not_wait_for_a_synchronously_blocked_source` passed only when the watcher drop returned
within 1 s, so a slow runner could fail it. The source now stays blocked until the test releases it,
so a drop that waits for it never returns. The test waits for the drop under
`craft_testkit::deadline::with_deadline`, which fails only a drop that hangs. The file's other waits
on the source (its start, its shared state, its publishing and its exit) use the same guard in place
of 2 s timeouts.
`completion_between_pumps_cannot_reject_a_chained_request` spun on `yield_now` against 3 s
deadlines until the service settled. Its wake callback now sends on a channel, and the test pumps
once after each wake: the request's, the worker's ready signal and the picker's answer. The whole
test runs under one `with_deadline` hang guard. Every assertion is kept.
craft-platform takes craft-testkit as a dev-dependency.
On a GitHub Windows runner the temp folder's Administrators entry is
inherited and comes first, so the folder check reported it before the
Users entry the test adds and the assertion on Users failed.
create_private_dir created the folder with create_dir and set its access
list afterwards, so for a moment the folder carried its parent's list. It
now creates the folder under a name of its own with the user as owner
and the user and SYSTEM as its only entries (Directory.CreateDirectory
with a DirectorySecurity), then moves it to the path with
Directory.Move, which fails when the path exists. A missing parent is
NotFound; a relative path is made absolute first. When PowerShell is
ended, the folder under its own name is removed once PowerShell has
exited.
sddl_of read a folder through File.GetAccessControl, which leaves out
inherit-only entries, so a folder check could miss an entry that every
new file inherits. It now reads a folder through
Directory.GetAccessControl, and the check after create_private_dir
counts inherit-only entries. foreign_access still skips them for files.
Every whoami, PowerShell and icacls run in owner_only now goes through
run_until, which waits for the tool with try_wait and a deadline
(TOOL_LIMIT, 10 s) and ends it with Child::kill when the deadline
passes. The call then fails with ErrorKind::TimedOut. Before, each run
used output() or wait_with_output() with no limit, so a process left
suspended held create_token_file and every other caller indefinitely.
create_private_file writes the file under its own name beside the path
(.<name>.<pid>.<count>.tmp) and moves it to the path only once the
contents are written, so the path never holds a partly written file.
When PowerShell is ended, that file is removed once PowerShell has
exited.
server_token no longer reads a file left at the path by a create that
ran out of time as another process's token; it returns the timeout
error.
On Windows, create_token_file created the token file with its folder's
access list and only then restricted it to the user and SYSTEM. Another
local account that the folder lets read new files could open a handle in
between, and that handle keeps its read access after the list changes,
so it could read the token once it was written.
craft_platform::owner_only::create_private_file creates the file with an
owner-only security descriptor in the call that creates it, writes the
contents through that handle, and checks the result. The control token
file now uses it on Windows. Unix keeps mode 0600 at create, and losing
the create race to another process still reads the winner's file.
Conflicts resolved (upstream's design and defaults win; the port's opt-ins stay):
- ui-contract fonts: upstream's served-faces provider, catalog job queue and byte budget;
the port's FaceBytes::chain (Word subset siblings, F-8) re-done on the provider: a served
face lists its served chain faces before the interface faces, a sibling landing after its
owner remakes egui's fonts once, drawing a face marks its chain drawn. The port's chain
trial moves onto upstream's rig, plus a late-sibling trial.
- text editor HostCx follows FacesCx's job-based document_face and document_face_bytes.
- ui-widgets Swatch: upstream's SwatchFill (split, spectrum, image, empty) with the port's
Swatch::optional / SwatchFace::optional (new SwatchFill::None, the "no colour" diagonal)
and Swatch::icon (glyph on the empty well) on top; both word sets kept.
- draw PaintBar: upstream's MixerLoad fill.
- font-manager: upstream's sample band; host rows (port) use it too.
- ui-panels / ui-patterns dock grips: upstream's drag_origin and named slack.
- platform clipboard tests: both trials kept.
Co-Authored-By: Claude <noreply@anthropic.com>
Real fixes, no allows: split long functions (portal first reads, canvas wheel read, text editor input pass, list row toggle parts, notice action rows, thumbnails grid aspect and edit rules, comments row entries), boxed the large Entry item row, type aliases for complex types, a StatusMeasure for the status cell's measures, double #[must_use] removed where the type is #[must_use], Copy clones and useless conversions dropped, struct-update syntax in place of field reassignment, a split press-pass test.
platform (appearance, portal, clipboard, open), settings, host files, dialogs
service, print, i18n date. Settings take upstream's LocalStorageFiles, with
BrowserFiles a deprecated alias (L-313); Windows reduced motion is upstream's
native worker; the port's forced pick answers, write intent, GNOME text scale,
open-for and byte intake stay on upstream's code.
257 conflicted files staged with their conflict markers (630 hunks). The one
modify/delete, crates/ui-patterns/src/patterns/preferences/body.rs (deleted
upstream, modified by the port), keeps the port's file for its area to carry
into upstream's preferences/page.rs. Plan: landing/fw-sync-plan.md.
- Dialogs: ButtonPlace { Foot, Side, Body } beside the port's refusal notice and
ChildDialog; every side_buttons caller (find, hyperlink, paragraph, list manager,
form dialogs) takes button_place, keeping the port's held answers, close buttons
and name check.
- Colour picker: upstream's fixed Full arrangement, CompareSwatch and warning module;
the port's shown_model and tabbed Colors dialog kept (its buttons stand in the side
column, the Full layout's in the picker's slot); the Compact layout shows the
compare block beside its area when the host gives a compare colour; focus_on_open
goes as upstream.
- Task bar: the grip is the bar's first member on one floating surface, for the task
kind only; the selection kind and the close reason stay.
- Keymap: lookup_where's accept filter runs through upstream's winners().
- craft-gpu: upstream's provider-neutral crate, with the port's eframe start-up
choices behind a startup feature (facade gpu-startup); duplicate facade row removed.
- Facade features, ATTRIBUTION, BMP density probe, margin story fit, theme icon-pack
and dialog first-field trials: both sides kept; the clipboard presence code stays
replaced by the port's offer modules.