Apply the storytold/cadcraft#3603 profile_root.rs reopen fix to PhotoCraft:
- Enforce directory-only check in private_subdirectory for existing non-directory entries
- Define PROFILE_FOLDERS for PhotoCraft's profile subfolders (Recovery, AgentFiles, Presets, logs)
- Distinguish regular files from folder-only entries in entries_stay_inside and validate regular files with private_regular_file (nlink == 1 on Unix, non-reparse/non-directory single-link check via winsafe on Windows)
- Add nightly_profile_reopens_after_saving_settings_and_session_state regression test
The sampling guard named the active document's main canvas while the queueing
route drives the canvas this request picked (the top dialog's own, else the
main one). Read the gesture state on that same canvas: ToolHost::in_gesture
(ctx, canvas) in place of canvas::tools::in_gesture(app). With a Color Picker
as the top dialog its declared canvas is the one the events would drive, so
the two reads answer the same today and every existing guard stays green;
the guard now states what it means.
A click with the Count tool stored the raw pointer position (99.3, 99.7)
and a drag dropped the marker at the raw release position. A plain click
on a marker changed nothing, because moves of 0.5 px or less were
dropped. The reference puts a new or moved marker on the centre of the
pixel under the pointer (99.5, 99.5), also on the pasteboard, and a
click on a marker re-centres it on the clicked pixel as one history
state.
`CountPass::press` now adds at the pixel centre, and remembers the
marker's own position instead of the press point. `release` moves the
marker to the release pixel's centre when that differs from where the
marker is, so a click on a marker is a move and a click in the pixel it
already sits on adds no history state. `count.add` and `count.move` are
untouched: called with coordinates, they keep them as given.
New tests in `crates/ui-egui/src/tools/count_pixel_centre_tests.rs`
cover the click (canvas and pasteboard), the drag and the re-centring
click. Two assertions in `analysis/tests.rs` that pinned raw positions
now expect pixel centres.
The Background exemption in menu_kind covered every lock: `background ||` skipped the
lock check altogether, so a Background that also carries the `all` or `artboard` lock
still routed its thumbnail to the short menu. The issue exempts only the transparency
and position locks a Background carries by itself - those are why its row stands in the
measured table - and lists a locked layer as not measured, keeping today's menu.
menu_kind now asks, for a Background, whether a lock beyond its own two is set, and
keeps the full lock check for every other layer. Locking the pixels stays out of the
new test: `Locks::set` clears the transparency lock when the pixels go on, and the
layer then stops being a Background at all, so the ordinary locked rule already covers it.
In an 8-bit Grayscale document and on a targeted layer mask, a default
Dodge or Burn click (Midtones, Protect Tones on, Exposure 50 %) now uses
its own single-channel curve, fitted to the reference's six measured
greys: Burn v - 0.236*v*(1-v)^1.15, Dodge v + 0.094*v^0.2*(1-v). Both
land within 1 level of every measured point (Burn 32/128/224 -> 26/114/219,
Dodge -> 46/138/227; before: 23/91/218 and 46/161/228).
RGB documents, 16- and 32-bit Grayscale and masks, the other ranges and
exposures, Protect Tones off, alpha channels, the Quick Mask and filter
masks were not measured and keep the RGB curve.
The bar's place is shared by the Free Transform, Crop and Frame bars, and an
unpinned drag (kept as the bar's offset) stayed for every later context.
Each bar now names its context (transform session, crop frame, frame layer,
with the document) before it reads the place; another context clears an
unpinned offset and position, a pinned bar keeps its place.
Fixes#16758.
After the Search button the options bar ends with a window icon and arrow,
tooltip "Choose a Workspace". Its menu lists the built-in workspaces
sorted by name with the current one checked, the saved ones as Window >
Workspace lists them, then Reset <current name>, New Workspace... and
Delete Workspace..., each running the Window > Workspace command of the
same row. The rows come from workspace_ui::switcher_entries. The options
bar's region version also holds the current and saved workspaces, which
the New and Delete dialogs change without a command.
The issue measures the thumbnail menu on visible, unlocked, unclipped rows and names a locked, hidden or clipped layer, a frame and an artboard as not measured, each keeping today's menu. The new guard carried only the frame and artboard half of that rule: right-clicking the thumbnail of a hidden, locked or clipped shape, smart object, type, adjustment or group row opened the short menu where it had the layer menu before. menu_kind now keeps those rows on today's routing - the short menu only where a pixel layer already had it, the layer menu for every other kind - and leaves the measured kinds on the new one. The Background's own transparency and position locks are not that locked state: its row stands in the measured table and opens the short menu.
The Layer lists of the Source and Mask groups dropped a pixel layer whose name a layer above already had, and the
engine reads a name as the topmost layer of that name. Such a layer now gets its own option, sent as its numeric layer
id, which source_layer reads directly.
With a Color Picker as the top dialog, a primary down and the moves of its drag
now run the picker's canvas pick (canvas_input::pick_color) at the request's
document points, at the request, and no window input is queued: the sampled
colour lands in the picker's new colour, the tool underneath is not driven and
no history state is added. Off the image nothing changes. The queued synthetic
events used to land under the dialog's modal layer or on the picker's own
controls, where the eyedropper never ran (docs/control-protocol.md:146).
A gesture the canvas is already running keeps its tool to its release; the
secondary button and a leading hover keep the queueing route and today's
behaviour. Six tests in control/pointer_color_picker_sample_tests.rs: three
fail on upstream/main 391cb01710, three guards pass before and after on purpose.
The options bar ends with a magnifier button, tooltip "Search for tools,
help, and more", in the bar's trailing group: it stays for every tool and
hides with the bar. A click runs edit.search, as Edit > Search... does; a
second click closes the search. The bar's region version holds whether the
search is open, so the button's selected look follows an Escape too.
dialogs.rs: kept the Source document rows and derive next to main's Mask group (#14489); both use main's shared apply_image_documents, layer and channel helpers.
* --version: name the commit of a dev build from git (#5247)
A plain cargo build reported only '0.8.2 (dev build)'. The desktop and
CLI build scripts now read the checkout's commit (git rev-parse HEAD,
rerun when HEAD moves) and the binaries hand it to build_info at start,
giving '0.8.2 (dev build, 6f8505421)'. Release builds keep
PHOTOCRAFT_BUILD_SHA and their format; without git, or when the
workspace isn't the root of the checkout (a source tarball unpacked in
another repository), it stays '(dev build)'. The engine itself still
doesn't shell out, so a commit doesn't rebuild it.
* --version: only watch git paths that exist (#5247)
Cargo treats a missing rerun-if-changed path as always changed: it re-ran
the build script and recompiled photocraft and photocraft-cli on every
build when packed-refs (or the branch's loose ref) did not exist. Watch
HEAD and packed-refs only when present, and for a packed branch the
nearest existing directory under refs/, so the first commit on it, which
writes the loose ref, still triggers a rebuild.
* --version: watch an unborn branch and reftable checkouts (#5247)
The git paths are now registered before asking for the commit, so the first
commit on an unborn branch re-runs the build script. A reftable checkout
watches reftable/tables.list, which every ref update rewrites, instead of a
loose ref or packed-refs.
* --version: git fixtures ignore the caller's repository and ref format (#5247)
The test fixtures run git without GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR,
GIT_INDEX_FILE and GIT_DEFAULT_REF_FORMAT, and the files-format fixtures pass
init.defaultRefFormat=files, so a reftable default or an inherited GIT_DIR
can't move or reshape them.
* --version: the git fixtures join the app's tests/it binary (#5247)
Main builds each crate's integration tests as one binary. The desktop
--version test now hands the checkout's commit to build_info as the
binary does, so both print the same dev build string.
---------
Co-authored-by: FredApps <[email protected]>
The dialog is titled with the document's name without its extension, and OK edits the document it opened on even if another tab becomes active. The Basic labels are already title case on current main.
Signed-off-by: MaheshDesu <[email protected]>
The parity report gets a headless column computed from the engine command registry that photocraft-cli and the MCP server load: 517 yes, 48 no (window), 0 partial, 99 unknown of 664 items, per RFC-0052.
The framework shows a document window on its fallback layer inside the app window in one more state than `desktop_origin` reads: while OS windows are available, a mount also falls back when the app window is full screen or, on Wayland, maximized (craft-libs `ui-contract/src/runtime/windows.rs`, `opens_over`). View > Screen Mode reaches that state inside the app.
`WindowHost::opens_windows()` answers for the viewport of the running pass and not for the app window, so a menu command cannot decide this from the app window's state; the gate therefore stays as it is, and the doc comment now says the offset is still added there and points at #16846, the epic's item for full-screen modes with floating document windows. No code change: only this function's doc comment.
`space` handed the framework the document area in the app window's own points, while a document window that opens as an OS window opens at a desktop rect. With the app window anywhere but at the screen's origin, Float in Window, Float All in Windows, New Window for Document and Cascade placed their windows at the document area's offset inside the app window read as a desktop place, so they landed outside the app window instead of over the document area.
The area now moves into desktop points by the origin the host reports for the app window, and the `position` a torn-off tab carries (a point of the app window) takes the same offset, so the window opens under the pointer where the tab was dropped. Window sizes, the cascade step and the docked panes keep what they are today: only the origin the placements work from changes. Where the host reports no rect for the app window, or where the document window shows on the framework's fallback layer inside the app window instead of an OS window of its own, the offset is zero and placement stays as it is today.
Tests go in the new file `crates/ui-egui/src/canvas/arrange_window_origin_tests.rs`: 11 tests run the real commands with the app window standing at a desktop rect away from the screen's origin, and compare every opened window's rect against the app window's rect and the document area the passes laid out, never against a literal pixel.