S007: file operations engine, freedesktop trash and trash:/// backend
Jobs with progress, cancel, conflict and error requests; scan pass, copy_file_range and stream copies, rename moves; per-filesystem trash with .trashinfo, restore and empty; ops smoke example. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
64ec86bf3b
commit
d90bf731bc
1 changed files with 2031 additions and 20 deletions
|
|
@ -35,5 +35,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
|
|||
- Not done: press squeeze is invisible in PNGs (software renderer ignores `transform-scale`, D-025); live hover/tooltip/animation not watched (no hidden session); `TextField` uses `TextInput`, not `LineEdit` (D-025).
|
||||
- Later: focus ring on `TextField` is its 2 px border only; long tab bars (more tabs than fit) need scrolling.
|
||||
|
||||
## S007 — File operations engine and trash
|
||||
- Done: `tunal-core::ops` — `Jobs`/`JobHandle`/`JobKind::{Copy, Move, Delete, Trash, Restore, EmptyTrash, Mkdir, Rename, Link}`, `Progress { phase: Queued/Scanning/Running/Finished, total/done files+bytes, current }` (event ≤ every 100 ms), `ConflictRequest { source, source_entry, target, target_entry, reply }` → `ConflictChoice { action: Skip/Overwrite/Rename(name)/AutoRename, apply_to_all }`, `ErrorRequest { uri, error, reply, needs_elevation() }` → `ErrorAction::{Retry, Skip, SkipAll, Abort}`, `Report { done_files, done_bytes, failures, cancelled }`; `numbered`/`auto_rename` (`name (2).ext`, `.tar.*` kept), `is_inside`. Scan pass, local `io::copy` chunks (copy_file_range), stream copy for other backends, same-fs move = rename, else copy + delete; mtime/mode kept on local targets; partial files removed on cancel/error.
|
||||
- `tunal-core::trash`: home trash + `$topdir/.Trash/$uid` (sticky check) / `.Trash-$uid` from mountinfo; exclusive `.trashinfo` reservation, percent-encoded Path, local DeletionDate (jiff 0.2); `items()`, `original()`, `restore()`, `TrashLocation` (`trash:///<id>:<name>`, list/stat/open_read/delete), registered by `Locations::with_local()`; `LocalLocation::trash` now works. Example `ops` (refuses unless `XDG_DATA_HOME` is inside its dir). URI format and job API: D-026.
|
||||
- Verified: workspace build, clippy -D warnings, `cargo fmt --check -p tunal-core`; `XDG_DATA_HOME=<scratch>/data cargo run -p tunal-core --example ops -- <scratch>`: progress, auto-rename conflict, same-folder copy → `a (3).txt`, folder-into-itself refused, merge move, trash/list/restore with rename conflict, duplicate names `dup (2).txt`, non-UTF-8 name encoded `%FF`, copy out of trash by original name (stream path), cancel mid-file (partial removed), chmod 000 → PermissionDenied flagged, rest copied; empty trash; real `~/.local/share/Trash` untouched.
|
||||
- Not verified: per-mount `.Trash-$uid` trash and cross-device move (no second filesystem inside the scratchpad). Workspace `cargo fmt --check` fails only on S005's in-progress `crates/tunal/src/main.rs`.
|
||||
- Later: trash `directorysizes` cache; orphan `.trashinfo` cleanup on empty; trash watch for live trash view; checking free space before copy.
|
||||
|
||||
## Later
|
||||
-
|
||||
|
|
|
|||
Loading…
Reference in a new issue