Files
pi2d/web
yuez 01fd7b9922 fix(daemon): sample disk usage on the filesystems pi2d uses
The status tile read `—` on a fresh machine: the sampler ran `statfs` on the
daemon's state dir, which is created lazily on the first instance log, so the
call failed with ENOENT and `diskUsedBytes`/`diskTotalBytes`/`diskPercent` all
came back null — `/info` then dropped `disk` altogether and the failure was
indistinguishable from a full disk.

`probeMount()` now walks up to the nearest existing ancestor and then to the
filesystem boundary (`st_dev` change), so a sample describes a volume, not a
directory. Candidates are pi2d's own write targets — `/` (the home volume on
macOS, where `/` is the sealed read-only system volume), the pi session store
and the visible workspace roots — never a mount-table dump: an unrelated or
hung network mount must not stall the sampler. Rows are deduped by `st_dev`,
sorted most-constrained first, capped at four, and reported as `system.disks[]`
with the legacy scalars aliasing the worst row. A sample that yields nothing
now carries `diskError` instead of silent nulls.

The status tile shows the worst filesystem and, when several are in play, one
quiet row per mount instead of a single percentage that hides the full volume.
2026-10-30 16:17:43 +08:00
..

pi2-web

React port of the pi2 web UI prototype, built into web/dist and served statically by pi2 daemon.

Development

# Start dev server with proxy to daemon (:7676)
pnpm --dir web dev

# Typecheck
pnpm --dir web typecheck

# Run test suite
pnpm --dir web exec vitest run

# Run only changed tests or specific file
pnpm --dir web exec vitest run --changed
pnpm --dir web exec vitest run tests/chat.composer.test.tsx

# Watch mode
pnpm --dir web test

For performance tuning, concurrency settings, and DOM environment details, see docs/testing.md.