Repository Guidelines
Project Structure & Module Organization
src/main.rsbootstraps theeframewindow and registers the application state inapp.rs.src/app.rsorchestrates UI state, message handling, and rendering; supporting modules live insrc/fs.rs,src/query.rs,src/scanner.rs,src/tree.rs, andsrc/util.rs.Cargo.tomldefines dependencies (egui UI stack, background utilities);Cargo.lockis checked in to pin versions.- There is no dedicated assets or tests directory yet—add new modules under
src/and keep helper files alongside their consumers.
Build, Test, and Development Commands
cargo check— fast validation of the codebase; run before every commit.cargo fmt— applies the Rust formatter; required prior to opening a PR.cargo run --release— launches the desktop UI with optimizations for realistic performance.cargo run— debug build with quicker rebuild times while iterating on features.
Coding Style & Naming Conventions
- Follow idiomatic Rust: 4-space indentation, snake_case for modules/functions, CamelCase for types, SCREAMING_SNAKE_CASE for constants.
- Keep UI labels and status strings concise; prefer
format!with named variables over concatenation. - Long workflows should be decomposed into helper functions inside the relevant module.
Testing Guidelines
- Leverage
cargo testas integration grows; organize tests intests/for integration flows ormod testsblocks for unit coverage. - Mock filesystem interactions by creating temporary directories (
tempfilecrate) when adding tests that touch disk state. - Name tests with intent, e.g.,
test_parse_query_with_size_filter.
Commit & Pull Request Guidelines
- Write commits in imperative mood (
Add scanner worker cancellation), grouping related changes per commit. - Ensure each PR includes: a clear summary, testing evidence (command output), and links to issues or design docs when applicable.
- Screenshot or screencast UI updates whenever visuals change; attach sample queries that were exercised.
Architecture Overview
- The UI thread (
app.rs) receives streamed filesystem updates overcrossbeam-channelfrom the backgroundscannerthread. - Queries combine glob filters (
globset) and size constraints parsed inquery.rs;tree.rsaggregates sizes for directory nodes. - When extending the scanner, keep work off the UI thread and prefer additional channel messages over shared mutable state.