fix(ui): identify the active scratch directory in warnings

This commit is contained in:
FredApps committed 2026-11-06 17:51:33 +01:00
1 parent 1eba8f6c72
commit d41e29a24f
2 files changed
+13 -4

No files matched your search

+8 -2
View File
@@ -522,8 +522,14 @@ fn field_rows(ui: &mut egui::Ui, section: &str, obj: &mut Map<String, Value>, ke
if ui.small_button(tl!("Add disk")).clicked() {
items.push(json!({"enabled": true, "path": ""}));
}
if photocraft_raster::spill::free_space_unmeasured() {
ui.add(egui::Label::new(RichText::new(tl!("This scratch disk doesn't report its free space, so PhotoCraft can't stop before it fills up, and large files get no extra room from it without a Scratch Size Limit. Set a limit or use a local disk.")).color(t.warning)).wrap());
let scratch = photocraft_raster::spill::stats();
if scratch.free_space_unmeasured {
let dir = scratch.dir.as_deref().map(|p| p.display().to_string()).unwrap_or_else(|| tl!("Unknown").into());
let warning = crate::i18n::fmt(
tl!("The current scratch directory ({path}) doesn't report its free space, so PhotoCraft can't stop before it fills up, and large files get no extra room from it without a Scratch Size Limit. This warning applies to the current configuration; changes above take effect on Apply or OK. Set a limit or use a local disk."),
&[("path", &dir)],
);
ui.add(egui::Label::new(RichText::new(warning).color(t.warning)).wrap());
}
});
obj.insert(k, Value::Array(items));
+5 -2
View File
@@ -866,9 +866,12 @@ physical RAM (excluding swap) and, where measurable, system commit headroom:
opened without Photoshop layers.
Headless RPC and MCP report approval-required memory errors with byte counts (`required`,
`softLimit`, `hardLimit`, and `availableRam` when known). A hard-budget refusal reports
`softLimit`, `hardLimit`, and `availableRam` when known); here `availableRam` means available
physical RAM. A hard-budget refusal reports
`required` and `hardLimit`, plus `available` and `availableRam` when measured free memory set the
limit (the typed `free_memory` field); there is never a soft limit, because no approval can raise
limit (the typed `free_memory` field). Both fields then contain the smaller of available RAM and
commit headroom (or the one measurement available), so `availableRam` can represent commit
headroom rather than physical RAM. There is never a soft limit, because no approval can raise
that ceiling. A limit set by the caller, the platform cap, or an unknown capacity carries no
free-memory figure. This holds for `doc.open` and `doc.place` and for the MCP `doc_open` and
`doc_place` tools, including a refusal from `file.openAs`/`file.placeEmbedded` reached through a