Skip to content

Commit 0fbcba7

Browse files
committed
fix: resolve ~ in every path-taking command (v0.138.2)
`disk` was fixed in v0.138.1; `loc`, `repo` and `md2pdf` had the identical gap — `PathBuf::from(arg)` treats a leading `~` as a *relative* folder of that name, which never exists. Rather than patch three more call sites in place, the expansion moved into `path_arg`, so the next command that accepts a path inherits the behaviour instead of the bug. - expand_user resolves `~` / `~/…` and drops the quotes a path dragged in from a terminal carries; expand_user_str is the String form `loc` needs. - `~user` stays literal on purpose: resolving another account's home needs the password database, and guessing /Users/<name> is wrong on plenty of machines. Failing visibly beats scanning the wrong folder. - 5 tests, mutation-verified (collapsing the match to PathBuf::from turns two of them red). Verified live as well: `loc ~/claud` now reports `/Users/martin/claud` where it used to report `~/claud`. Also: the alias screenshot joins the gallery, and the capture script grew a focus retry — the terminal running it kept winning activation back, and the guard correctly refused to type into iTerm rather than the popup.
1 parent ff9c7dc commit 0fbcba7

20 files changed

Lines changed: 171 additions & 100 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to Inspector Rust are documented here.
44

55
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.138.2] — 2026-08-27
8+
9+
### Fixed
10+
11+
- **`~` now works in every path-taking command**, not just `disk`: `loc`, `repo` and `md2pdf` took a leading `~` literally too. The expansion moved into one shared, tested helper, so the next command that accepts a path inherits the behaviour instead of the bug.
12+
713
## [0.138.1] — 2026-08-27
814

915
### Fixed

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ A hidden trigger (`isXTrigger`, exact `x!` — never in `COMMANDS`, so autocompl
525525

526526
**Navigation + speed (v0.137.0 / v0.138.0).** The walk parallelises at the root (`walk_root_parallel` — `std::thread::scope`, top-level dirs dealt round-robin over `available_parallelism().clamp(1,8)` workers; the deeper recursion stays sequential, which is where the shared `top_files` list would otherwise need a lock). With no path argument the target is the **Finder-selected folder** (`commands::finder_folder`, a file resolving to its parent), else the home folder — the same affordance `touch`/`mkdir` have. The panel is a real browser now: a **path bar** always spells out the absolute path of what's on screen (pure `pathCrumbs`), `⌫`/`←` and an ↑ button climb — **past the scan root**, by re-scanning the parent (`parentPath` returning `null` at `/` is what stops it walking off the top) — and `R` re-scans. Two click behaviours, deliberately different: a folder that HAS children in the tree drills **in-tree and instantly** (the sizes are already computed; only the LISTING is capped at 24 children + "Sonstiges"), while one at the walk's **pruning boundary** — no children to show — triggers a fresh scan there, which is what makes the depth effectively unlimited. ⚠️ The scan target is React state (`target`), not the raw `arg`: every re-scan trigger (refresh button, `R`, post-trash) must use it, or trashing a file while navigated three folders deep teleports the view back to the typed argument. ⚠️ **The `[arg]` effect must `setTarget`, never `run` directly** — on mount it fires with the value `target` was seeded from, and React bails out of an identical state write, so there is exactly ONE walk; the pre-v0.138 shape (`useEffect(() => run(arg), [arg])`) plus a target effect scans the home folder twice on every open (pinned by `scans exactly ONCE on mount`, which fails on exactly that mutation). ⚠️ **A guard against that via a `firstArg` ref was written, then deleted as dead code** — the mutation probe showed the test stayed green with the guard removed, because the state bail-out already covers it; a guard that protects nothing is worse than none, since the next reader trusts it. `DiskPanel.test.tsx` (13 behavioural tests, all four load-bearing pins mutation-verified) + `parentPath`/`joinPath`/`pathCrumbs` in `lib/disk.ts`. Historic note: the footer advertised "R neu scannen" from v0.120.0 while the keydown handler only ever matched `Escape` — the shortcut did not exist until v0.138.0.
527527

528-
⚠️ **A typed path argument needs `expand_user` (v0.138.1).** `PathBuf::from(arg)` takes a leading `~` literally — a *relative* folder named `~`, which never exists — so `daisy ~/Downloads`, the example the command's own CommandDoc gives, silently scanned nothing. `disk_usage::expand_user(arg, home)` (pure, tested) resolves `~`/`~/…` and drops surrounding quotes (a path dragged in from a terminal arrives quoted); `~user` is deliberately left literal, because resolving another account's home needs the password database and guessing `/Users/<name>` is wrong on any machine that doesn't use that layout. **The same gap is UNFIXED in `md_to_pdf_run` (`commands.rs`, `PathBuf::from(p)`) and untested in `loc`/`repo`** — they were out of scope when this was found; fix them with the same helper.
528+
⚠️ **Every typed path argument goes through `path_arg::expand_user` (v0.138.2).** `PathBuf::from(arg)` takes a leading `~` literally — a *relative* folder named `~`, which never exists — so `daisy ~/Downloads`, the example the command's own CommandDoc gives, silently scanned nothing. `path_arg::expand_user(arg, home)` (pure, 5 tests, mutation-verified) resolves `~`/`~/…` and drops surrounding quotes (a path dragged in from a terminal arrives quoted); `expand_user_str` is the `String` form for `loc`, which feeds tokei a `&[String]`. `~user` is deliberately left literal, because resolving another account's home needs the password database and guessing `/Users/<name>` is wrong on any machine that doesn't use that layout — failing visibly beats scanning the wrong folder. Wired into **all four** path-taking commands: `disk_scan`, `loc_count`, `resolve_repo_target` (Local branch only; the URL branch is matched first) and `md_to_pdf_run`. **A new path-taking command must use it** — that is why it lives in its own module rather than beside the first caller.
529529

530530
**Screenshots for the docs gallery: `scripts/screenshot-macos.sh <name> <query> [wait] [--no-enter] [--preview-only]`.** Three things it exists to encode, all learned the hard way: (1) **focus** — the keystrokes are synthetic, so an active **Screen Sharing** window forwards them to the REMOTE machine (this happened: text landed in a stranger session's text field and two stray messages were sent), hence Finder is brought to the front and the script REFUSES to type unless that took; (2) **one character at a time with a 40 ms pause** — a single `keystroke "disk ~/x"` outruns the React input and the letters arrive shuffled (`di~claude/insk /spector-rust`); (3) **the popup hotkey TOGGLES**, so a leftover popup from the previous capture must be Esc'd away first (Esc inside a panel only steps back one level, so it loops). ⚠️ **Privacy: the left column is the live clipboard history.** A query that leaves clips visible must be shot `--preview-only` (right column only) — `clock` and `alias` are, `disk`/`clown`/`repo` filter the list to nothing and are safe as full-window shots. Never publish a gallery image with real clips in it.
531531

‎Cargo.lock‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["core/rust-lib", "win/src-tauri", "macos/src-tauri", "linux/src-tauri"]
44

55
[workspace.package]
6-
version = "0.138.1"
6+
version = "0.138.2"
77
edition = "2021"
88
authors = ["Martin Pfeffer <martinpaush@gmail.com>"]
99
license = "MIT"

‎README.de.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@
6464

6565
### 🧰 Tech-Stack
6666

67-
Tauri 2 (WebView2 / WKWebView) · Rust-Workspace (`core/rust-lib` geteilt, 2-Zeilen-Per-OS-Bundle-Shells) · React 19 + TypeScript 5 + Tailwind v4 + Vite 7 · Helligkeit via CoreGraphics/GDI-Gamma + DDC/CI (`ddc-hi`). **3795 Unit-Tests (1404 Rust + 2391 Frontend).** MIT-lizenziert.
67+
Tauri 2 (WebView2 / WKWebView) · Rust-Workspace (`core/rust-lib` geteilt, 2-Zeilen-Per-OS-Bundle-Shells) · React 19 + TypeScript 5 + Tailwind v4 + Vite 7 · Helligkeit via CoreGraphics/GDI-Gamma + DDC/CI (`ddc-hi`). **3797 Unit-Tests (1406 Rust + 2391 Frontend).** MIT-lizenziert.
6868

6969
<!-- ── Headline-Kennzahlen — XXL Hero-Badges ─────────────────── -->
7070
<p>
7171
<a href="https://github.com/pepperonas/inspector-rust" title="Codezeilen (Rust + TypeScript Quellcode)">
7272
<img src="https://img.shields.io/badge/lines%20of%20code-~153k-2b3137?style=for-the-badge&logo=rust&logoColor=white" height="64" alt="Lines of code" />
7373
</a>
7474
&nbsp;
75-
<a href="https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml" title="Unit-Tests — 1404 Rust + 2391 Frontend, alle grün">
76-
<img src="https://img.shields.io/badge/unit%20tests-3795%20passing-2ea043?style=for-the-badge&logo=vitest&logoColor=white" height="64" alt="Unit tests" />
75+
<a href="https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml" title="Unit-Tests — 1406 Rust + 2391 Frontend, alle grün">
76+
<img src="https://img.shields.io/badge/unit%20tests-3797%20passing-2ea043?style=for-the-badge&logo=vitest&logoColor=white" height="64" alt="Unit tests" />
7777
</a>
7878
</p>
7979

@@ -95,7 +95,7 @@
9595
[![Issues](https://img.shields.io/github/issues/pepperonas/inspector-rust?style=flat-square)](https://github.com/pepperonas/inspector-rust/issues)
9696
[![Stars](https://img.shields.io/github/stars/pepperonas/inspector-rust?style=flat-square)](https://github.com/pepperonas/inspector-rust/stargazers)
9797
[![Maintenance](https://img.shields.io/badge/maintained-yes-brightgreen?style=flat-square)](https://github.com/pepperonas/inspector-rust/commits/main)
98-
[![Unit tests](https://img.shields.io/badge/unit%20tests-3795%20(1404%20Rust%20%2B%202391%20TS)-success?style=flat-square)](https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml)
98+
[![Unit tests](https://img.shields.io/badge/unit%20tests-3797%20(1406%20Rust%20%2B%202391%20TS)-success?style=flat-square)](https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml)
9999
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](./CONTRIBUTING.md)
100100
[![Code Style](https://img.shields.io/badge/code%20style-clippy%20%2B%20eslint-orange?style=flat-square)](./scripts/check.sh)
101101
[![Downloads](https://img.shields.io/github/downloads/pepperonas/inspector-rust/total?style=flat-square&label=downloads&color=8957e5)](https://github.com/pepperonas/inspector-rust/releases)
@@ -162,7 +162,7 @@
162162
<!-- ── Quality ─────────────────────────────────────────────── -->
163163
[![ESLint](https://img.shields.io/badge/ESLint-flat%20config-4B32C3?style=flat-square&logo=eslint&logoColor=white)](https://eslint.org)
164164
[![Vitest](https://img.shields.io/badge/Vitest-3-6E9F18?style=flat-square&logo=vitest&logoColor=white)](https://vitest.dev)
165-
[![cargo test](https://img.shields.io/badge/cargo%20test-1404%20passing-success?style=flat-square&logo=rust&logoColor=white)](#)
165+
[![cargo test](https://img.shields.io/badge/cargo%20test-1406%20passing-success?style=flat-square&logo=rust&logoColor=white)](#)
166166
[![vitest](https://img.shields.io/badge/vitest-2391%20passing-success?style=flat-square&logo=vitest&logoColor=white)](#)
167167
[![cargo clippy](https://img.shields.io/badge/cargo%20clippy-D%20warnings-success?style=flat-square&logo=rust&logoColor=white)](#)
168168
[![tsc strict](https://img.shields.io/badge/tsc-strict-3178C6?style=flat-square&logo=typescript&logoColor=white)](#)
@@ -196,7 +196,7 @@
196196
[![exe size](https://img.shields.io/badge/.exe-~14%20MB-blue?style=flat-square&logo=windows&logoColor=white)](#)
197197

198198
<!-- ── Features (numerical) ────────────────────────────────── -->
199-
[![Tests](https://img.shields.io/badge/tests-3795%20passing-success?style=flat-square)](#)
199+
[![Tests](https://img.shields.io/badge/tests-3797%20passing-success?style=flat-square)](#)
200200
[![IPC commands](https://img.shields.io/badge/IPC%20commands-284-blueviolet?style=flat-square)](./core/rust-lib/src/commands.rs)
201201
[![Search-bar commands](https://img.shields.io/badge/search--bar%20commands-74-blueviolet?style=flat-square)](./core/rust-lib/src/commands.rs)
202202
[![Tauri events](https://img.shields.io/badge/events-33-blueviolet?style=flat-square)](#)
@@ -406,8 +406,8 @@
406406
| **`?`** — eingebauter Befehls-Index & Inline-Hilfe | **`disk`** — Speicher-Sunburst; die Pfadleiste durchstöbert die ganze Platte |
407407
| ![repo — Git-Aktivitätsstatistik](docs/screenshots/repo.png) | ![clock — Weltzeituhr](docs/screenshots/clock.png) |
408408
| **`repo`** — Git-Historie auf einen Blick, als eine HTML-Datei exportierbar | **`clock`** — Weltzeituhr; jede IANA-Zone, Sommerzeit macht das OS |
409-
| ![clown — alberne Textstile](docs/screenshots/clown.png) | |
410-
| **`clown`** — zwölf Textstile; du nimmst den, den du siehst | |
409+
| ![clown — alberne Textstile](docs/screenshots/clown.png) | ![alias — geführter Alias-Baukasten + Verwaltung](docs/screenshots/alias.png) |
410+
| **`clown`** — zwölf Textstile; du nimmst den, den du siehst | **`alias`** — Shell-Alias anlegen und bestehende verwalten |
411411

412412
## Download
413413

@@ -931,7 +931,7 @@ Inspector Rust hält seine **pure Logik** — Parser, Mathematik, State-Machines
931931
932932
```bash
933933
pnpm test # Frontend-Unit-Tests (vitest + happy-dom) — 2391 Tests
934-
cargo test --workspace # Rust-Unit-Tests — 1404 Tests
934+
cargo test --workspace # Rust-Unit-Tests — 1406 Tests
935935
```
936936
937937
Ein einzelnes Modul während der Iteration:

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@
6464

6565
### 🧰 Tech stack
6666

67-
Tauri 2 (WebView2 / WKWebView) · Rust workspace (`core/rust-lib` shared, 2-line per-OS bundle shells) · React 19 + TypeScript 5 + Tailwind v4 + Vite 7 · brightness via CoreGraphics/GDI gamma + DDC/CI (`ddc-hi`). **3795 unit tests (1404 Rust + 2391 frontend).** MIT-licensed.
67+
Tauri 2 (WebView2 / WKWebView) · Rust workspace (`core/rust-lib` shared, 2-line per-OS bundle shells) · React 19 + TypeScript 5 + Tailwind v4 + Vite 7 · brightness via CoreGraphics/GDI gamma + DDC/CI (`ddc-hi`). **3797 unit tests (1406 Rust + 2391 frontend).** MIT-licensed.
6868

6969
<!-- ── Headline metrics — XXL hero badges ────────────────────── -->
7070
<p>
7171
<a href="https://github.com/pepperonas/inspector-rust" title="Lines of code (Rust + TypeScript source)">
7272
<img src="https://img.shields.io/badge/lines%20of%20code-~153k-2b3137?style=for-the-badge&logo=rust&logoColor=white" height="64" alt="Lines of code" />
7373
</a>
7474
&nbsp;
75-
<a href="https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml" title="Unit tests — 1404 Rust + 2391 frontend, all passing">
76-
<img src="https://img.shields.io/badge/unit%20tests-3795%20passing-2ea043?style=for-the-badge&logo=vitest&logoColor=white" height="64" alt="Unit tests" />
75+
<a href="https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml" title="Unit tests — 1406 Rust + 2391 frontend, all passing">
76+
<img src="https://img.shields.io/badge/unit%20tests-3797%20passing-2ea043?style=for-the-badge&logo=vitest&logoColor=white" height="64" alt="Unit tests" />
7777
</a>
7878
</p>
7979

@@ -95,7 +95,7 @@
9595
[![Issues](https://img.shields.io/github/issues/pepperonas/inspector-rust?style=flat-square)](https://github.com/pepperonas/inspector-rust/issues)
9696
[![Stars](https://img.shields.io/github/stars/pepperonas/inspector-rust?style=flat-square)](https://github.com/pepperonas/inspector-rust/stargazers)
9797
[![Maintenance](https://img.shields.io/badge/maintained-yes-brightgreen?style=flat-square)](https://github.com/pepperonas/inspector-rust/commits/main)
98-
[![Unit tests](https://img.shields.io/badge/unit%20tests-3795%20(1404%20Rust%20%2B%202391%20TS)-success?style=flat-square)](https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml)
98+
[![Unit tests](https://img.shields.io/badge/unit%20tests-3797%20(1406%20Rust%20%2B%202391%20TS)-success?style=flat-square)](https://github.com/pepperonas/inspector-rust/actions/workflows/ci.yml)
9999
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](./CONTRIBUTING.md)
100100
[![Code Style](https://img.shields.io/badge/code%20style-clippy%20%2B%20eslint-orange?style=flat-square)](./scripts/check.sh)
101101
[![Downloads](https://img.shields.io/github/downloads/pepperonas/inspector-rust/total?style=flat-square&label=downloads&color=8957e5)](https://github.com/pepperonas/inspector-rust/releases)
@@ -162,7 +162,7 @@
162162
<!-- ── Quality ─────────────────────────────────────────────── -->
163163
[![ESLint](https://img.shields.io/badge/ESLint-flat%20config-4B32C3?style=flat-square&logo=eslint&logoColor=white)](https://eslint.org)
164164
[![Vitest](https://img.shields.io/badge/Vitest-3-6E9F18?style=flat-square&logo=vitest&logoColor=white)](https://vitest.dev)
165-
[![cargo test](https://img.shields.io/badge/cargo%20test-1404%20passing-success?style=flat-square&logo=rust&logoColor=white)](#)
165+
[![cargo test](https://img.shields.io/badge/cargo%20test-1406%20passing-success?style=flat-square&logo=rust&logoColor=white)](#)
166166
[![vitest](https://img.shields.io/badge/vitest-2391%20passing-success?style=flat-square&logo=vitest&logoColor=white)](#)
167167
[![cargo clippy](https://img.shields.io/badge/cargo%20clippy-D%20warnings-success?style=flat-square&logo=rust&logoColor=white)](#)
168168
[![tsc strict](https://img.shields.io/badge/tsc-strict-3178C6?style=flat-square&logo=typescript&logoColor=white)](#)
@@ -269,7 +269,7 @@
269269
[![exe size](https://img.shields.io/badge/.exe-~14%20MB-blue?style=flat-square&logo=windows&logoColor=white)](#)
270270

271271
<!-- ── Features (numerical) ────────────────────────────────── -->
272-
[![Tests](https://img.shields.io/badge/tests-3795%20passing-success?style=flat-square)](#)
272+
[![Tests](https://img.shields.io/badge/tests-3797%20passing-success?style=flat-square)](#)
273273
[![IPC commands](https://img.shields.io/badge/IPC%20commands-284-blueviolet?style=flat-square)](./core/rust-lib/src/commands.rs)
274274
[![Search-bar commands](https://img.shields.io/badge/search--bar%20commands-74-blueviolet?style=flat-square)](./core/rust-lib/src/commands.rs)
275275
[![Tauri events](https://img.shields.io/badge/events-33-blueviolet?style=flat-square)](#)
@@ -406,8 +406,8 @@
406406
| **`?`** — built-in command index & inline help | **`disk`** — usage sunburst; the path bar browses the whole disk |
407407
| ![repo — git activity statistics](docs/screenshots/repo.png) | ![clock — world clock](docs/screenshots/clock.png) |
408408
| **`repo`** — git history at a glance, exportable as one HTML file | **`clock`** — world clock; any IANA zone, DST handled by the OS |
409-
| ![clown — silly text styles](docs/screenshots/clown.png) | |
410-
| **`clown`** — twelve text styles; pick the one you can see | |
409+
| ![clown — silly text styles](docs/screenshots/clown.png) | ![alias — guided shell-alias builder + manager](docs/screenshots/alias.png) |
410+
| **`clown`** — twelve text styles; pick the one you can see | **`alias`** — build a shell alias, and manage the ones you have |
411411

412412
## Download
413413

@@ -933,7 +933,7 @@ Inspector Rust keeps its **pure logic** — parsers, math, state machines, arg-b
933933
934934
```bash
935935
pnpm test # frontend unit tests (vitest + happy-dom) — 2391 tests
936-
cargo test --workspace # Rust unit tests — 1404 tests
936+
cargo test --workspace # Rust unit tests — 1406 tests
937937
```
938938
939939
Iterate on one module:

‎core/frontend/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "inspector-rust-frontend",
33
"private": true,
4-
"version": "0.138.1",
4+
"version": "0.138.2",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

0 commit comments

Comments
 (0)