file manager
git clone https://git.lucas.co/cce-files.git
CLAUDE.md: rejoin the Opening files note split by the MIME note
The previous commit's MIME bullet landed mid-sentence, leaving the
~/.local/bin and spawn_detached lines under the wrong heading. Also
point at the local spawn_detached: cce_ui::process is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index 8651018..b7d2412 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -69,8 +69,8 @@ Two things to know when touching it:
## Domain specifics
- **CCE projects**: a directory containing `state.json` or `state.kdl` is treated as a *project* (`is_project_dir`), gets MIME `application/x-cce-project`, and on double-click is opened by its handler rather than entered. "Enter Directory" in the context menu overrides this.
-- **Opening files**: `open_file()` resolves a handler via `get_mime_type` → `get_default_application`, which checks (1) `~/.config/cce/mime.kdl` custom associations, then (2) `xdg-mime` + `.desktop` parsing, looking the entry up in the XDG data dirs (`applications_dirs`: `$XDG_DATA_HOME`, then `$XDG_DATA_DIRS`) so it finds what `xdg-mime` named.
-- **MIME by extension**: `get_mime_type` decides .kdl and the 3D model formats (stl, obj, gltf, glb, ply → `mime_for_extension`) before shelling out to `xdg-mime query filetype`, because that falls back to content sniffing here and reads .gltf as JSON, .obj as text and binary STL/PLY as octet-stream, so Open never reached cce-model. PLY has no shared-mime-info type; `model/x-ply` is the one `cce-model.desktop` claims. The preview pane does not use the MIME (it sniffs UTF-8 itself). Bare command names are resolved against `~/.local/bin` before falling back to `xdg-open`. Always launch via `cce_ui::process::spawn_detached`.
+- **Opening files**: `open_file()` resolves a handler via `get_mime_type` → `get_default_application`, which checks (1) `~/.config/cce/mime.kdl` custom associations, then (2) `xdg-mime` + `.desktop` parsing, looking the entry up in the XDG data dirs (`applications_dirs`: `$XDG_DATA_HOME`, then `$XDG_DATA_DIRS`) so it finds what `xdg-mime` named. Bare command names are resolved against `~/.local/bin` before falling back to `xdg-open`. Always launch via `spawn_detached` (in `services/fs.rs`; it reaps the child so it never lingers as a zombie).
+- **MIME by extension**: `get_mime_type` decides .kdl and the 3D model formats (stl, obj, gltf, glb, ply → `mime_for_extension`) before shelling out to `xdg-mime query filetype`, because that falls back to content sniffing here and reads .gltf as JSON, .obj as text and binary STL/PLY as octet-stream, so Open never reached cce-model. PLY has no shared-mime-info type; `model/x-ply` is the one `cce-model.desktop` claims. The preview pane does not use the MIME (it sniffs UTF-8 itself).
- **Chooser modes**: launched with `--select`, `--select-dir`, or `--save`, the app becomes a file picker for other CCE apps — it shows a bottom action bar, prints the chosen path to stdout, and `std::process::exit(0)` on selection (or exit code 1 on cancel). This is why `SelectOpen`/`SelectCancel` call `process::exit` directly.
- **Persistence**: the last-visited directory is saved to `~/.config/cce/cce-files/cce-files-last-dir.txt` and restored on launch.
- **Double-click**: opening is temporal — `last_click_time` / `last_clicked_idx` in `update()` detect a double-click within 500ms rather than relying on a windowing double-click event.