Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge main into worktree-agent-ab72a7623afb95196

Brandon Thomas5bd1d238c8ed
diff --cc crates/engine/src/lib.rs
index 092285bd7,afe665af1..e368b5968
--- a/crates/engine/src/lib.rs
+++ b/crates/engine/src/lib.rs
@@@ -18,9 -18,9 +18,10 @@@ pub mod files
pub mod import;
pub mod library;
pub mod media;
+ pub mod memory;
pub mod merge;
pub mod presets;
+pub mod rename;
pub mod sidecar;
mod view;
diff --cc crates/ui-egui/src/menus.rs
index 2307a4250,c3c979cf6..919b7f59e
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@@ -332,26 -338,8 +341,26 @@@ pub fn run_ui_command(app: &mut Lightcr
app.ui.dialog = Some(Dialog::NewSmartAlbum { name: p.get("name").and_then(Value::as_str).unwrap_or("").into() });
Ok(Value::Null)
}
+ "dialog.captureTime" => {
+ let time = app.session.active().and_then(|id| app.session.catalog.photo(id)).map(|p| p.date().replace('T', " ")).unwrap_or_default();
+ let mode = p.get("mode").and_then(Value::as_str).unwrap_or("set").to_string();
+ app.ui.dialog =
+ Some(Dialog::CaptureTime { mode, time: time.get(..19).unwrap_or(&time).to_string(), days: 0, hours: 0, minutes: 0, zone: 0.0 });
+ Ok(Value::Null)
+ }
+ "dialog.labelNames" => {
+ let names =
+ lightcraft_catalog::ColorLabel::ALL.iter().map(|l| app.session.catalog.custom_label_name(*l).unwrap_or("").to_string()).collect();
+ app.ui.dialog = Some(Dialog::LabelNames { names });
+ Ok(Value::Null)
+ }
+ "dialog.rename" => {
+ let template = p.get("template").and_then(Value::as_str).unwrap_or("{name}").to_string();
+ app.ui.dialog = Some(Dialog::Rename { template, start: p.get("start").and_then(Value::as_u64).unwrap_or(1) as u32 });
+ Ok(Value::Null)
+ }
"dialog.createPreset" => {
- app.ui.dialog = Some(Dialog::CreatePreset { name: String::new(), group: "User Presets".into() });
+ app.ui.dialog = Some(Dialog::create_preset());
Ok(Value::Null)
}
"dialog.copySettings" => {
diff --cc crates/ui-egui/src/panels/dialogs.rs
index cd3aaa503,3f08b0bc0..99d41aa07
--- a/crates/ui-egui/src/panels/dialogs.rs
+++ b/crates/ui-egui/src/panels/dialogs.rs
@@@ -426,29 -267,16 +413,34 @@@ pub fn confirm_dialog(app: &mut Lightcr
match dlg {
Dialog::NewAlbum { name, folder } => app.run("album.create", json!({"name": name, "folder": folder, "addSelected": !folder})),
Dialog::RenameAlbum { id, name } => app.run("album.rename", json!({"id": id, "name": name})),
+ Dialog::CaptureTime { mode, time, days, hours, minutes, zone } => app.run(
+ "photo.setCaptureTime",
+ match mode.as_str() {
+ "set" => json!({"time": time}),
+ "shift" => json!({"shift": *days as i64 * 86_400 + *hours as i64 * 3600 + *minutes as i64 * 60}),
+ _ => json!({"hours": zone}),
+ },
+ ),
+ Dialog::LabelNames { names } => {
+ let mut m = serde_json::Map::new();
+ for (l, n) in lightcraft_catalog::ColorLabel::ALL.iter().zip(names) {
+ m.insert(format!("{l:?}").to_lowercase(), if n.trim().is_empty() { serde_json::Value::Null } else { json!(n.trim()) });
+ }
+ app.run("label.setNames", json!({"names": m}))
+ }
+ Dialog::Rename { template, start } => app.run("photo.rename", json!({"template": template, "start": start})),
+ Dialog::RenameKeyword { from, to } => app.run("keyword.rename", json!({"from": from, "to": to})),
+ Dialog::MergeKeywords { from, into } => app.run("keyword.merge", json!({"from": from, "into": into})),
Dialog::AutoStack { gap } => app.run("stack.auto", json!({"gap": gap})),
Dialog::NewSmartAlbum { name } => app.run("album.createSmart", json!({"name": if name.trim().is_empty() { "Smart Album" } else { name }})),
- Dialog::CreatePreset { name, group } => {
- app.run("preset.create", json!({"name": if name.is_empty() { "My Preset" } else { name }, "group": group}))
- }
+ Dialog::CreatePreset { name, group, groups } => app.run(
+ "preset.create",
+ json!({
+ "name": if name.trim().is_empty() { "My Preset" } else { name },
+ "group": if group.trim().is_empty() { "User Presets" } else { group },
+ "groups": groups,
+ }),
+ ),
Dialog::CopySettings { groups } => app.run("develop.copy", json!({"groups": groups})),
Dialog::Export { opts, long_edge, limit_kb, dir } => app.run(
"app.export",
diff --cc docs/parity.md
index fc010bd76,5e893d298..60706f7df
--- a/docs/parity.md
+++ b/docs/parity.md
@@@ -63,20 -63,20 +63,17 @@@ Ordered by tier, then user value, then
Noise / Moiré / Defringe sliders, which are stored but not rendered. High value, medium effort.
4. **LR-REM-SPOT-EDIT + LR-REM-BRUSH-PARAMS** (P0) — select a spot pin, move target/source, delete with ⌫,
feather/opacity sliders, `[`/`]` size keys. Medium effort.
- 6. **LR-PRE-CREATE + LR-PRE-PANEL + LR-BEHAV-PREVIEW-HOVER** (P0/P1) — per-group checkboxes in Create Preset;
- live preview while hovering presets/profiles/versions. Medium effort.
- 7. **LR-PROF-DROPDOWN** (P0) — favourites/recent in the profile menu (and later a browser, LR-PROF-BROWSER).
- 9. **LR-PREF-GENERAL + LR-IMP-RAWDEFAULT** (P0/P1) — a Settings dialog: raw defaults (preset or camera-specific),
-5. **LR-VIEW-PHOTOGRID** (P0) — group the justified grid by capture date with headers. Low–medium effort.
-6. **LR-LIB-KEYWORD** (P0) — rename/delete a keyword library-wide; keyword list in the left panel for browsing.
+ 7. **LR-PREF-GENERAL + LR-IMP-RAWDEFAULT** (P0/P1) — a Settings dialog: raw defaults (preset or camera-specific),
XMP prefs, cache, GPU. Medium effort.
- 10. **LR-IMP-ADD-DIALOG + LR-IMP-LOCAL** (P0) — an import review grid with per-photo checkboxes and destination
+ 8. **LR-IMP-ADD-DIALOG + LR-IMP-LOCAL** (P0) — an import review grid with per-photo checkboxes and destination
album; browse folders before adding. Medium effort.
- 11. **LR-EXP-TYPE + LR-EXP-DIM** (P0) — Original (+XMP) and DNG export (writer exists in
+ 9. **LR-EXP-TYPE + LR-EXP-DIM** (P0) — Original (+XMP) and DNG export (writer exists in
`crates/raw/src/dngwrite.rs`), short edge / width / height / megapixels, "don't enlarge", ppi.
- 12. **LR-IMP-FORMATS** (P0) — CR3, compressed NEF/RAF/ORF, RW2 v4 (preview only today); HEIC/AVIF decode (no
+ 10. **LR-IMP-FORMATS** (P0) — CR3, compressed NEF/RAF/ORF, RW2 v4 (preview only today); HEIC/AVIF decode (no
permissive pure-Rust decoder yet). High value, high effort (clean sources needed).
- 13. **LR-VIEW-FULLSCREEN + LR-VIEW-NAVIGATOR + LR-VIEW-INFOOVERLAY** (P1) — view modes. Medium effort.
- 15. **LR-EXP-BITDEPTH + LR-EXP-COMPRESSION** (P1) — 16-bit TIFF/PNG and TIFF compression choice.
- 16. **LR-EDIT-OPTICS-PROFILE** (P1) — a lens-profile database of our own (embedded DNG/maker corrections work today).
+ 11. **LR-VIEW-FULLSCREEN + LR-VIEW-NAVIGATOR + LR-VIEW-INFOOVERLAY** (P1) — view modes. Medium effort.
-12. **LR-LIB-RENAME + LR-LIB-CAPTURETIME + LR-LIB-LABEL UI** (P1) — batch rename, capture-time edit, label menu/names.
+ 13. **LR-EXP-BITDEPTH + LR-EXP-COMPRESSION** (P1) — 16-bit TIFF/PNG and TIFF compression choice.
+ 14. **LR-EDIT-OPTICS-PROFILE** (P1) — a lens-profile database of our own (embedded DNG/maker corrections work today).
## Shortcuts: conflicts and missing bindings