Expand description
facett-git — a facett Facet that shows a git
repository: its branches, the commit log, the file tree, and
syntax-coloured source — all clickable. A consumer (e.g. nornir’s viz) drops
it into a FacetDeck to surface git for any repo.
- The repository data is a pure
RepoSnapshot(branches / commits / tree). With thegixfeature it is read live from disk viaRepoSnapshot::open; without it the host supplies a snapshot (and a blob), so the facet builds and tests with no git dependency. - Source is rendered with a deterministic Rust [
highlight]er into an eguiLayoutJob(egui can render coloured Rust text — this is how). - Everything observable (selected branch, open path, counts) is in
state_json(LAW 6 / FC-6), so it is headless-testable.
Re-exports§
pub use highlight::highlight;pub use highlight::Kind;pub use highlight::Span;pub use model::Blob;pub use model::Branch;pub use model::CommitRow;pub use model::RepoSnapshot;pub use model::TreeEntry;
Modules§
- highlight
- Deterministic Rust source syntax highlighter → coloured spans an egui
LayoutJobcan render. Pure (no egui, no I/O), so it is unit-tested without a window and produces bit-identical spans for the same input (FC-7). A tiny hand-written tokenizer — not a full parser — classifying the things that matter for reading code: keywords, types, strings/chars, line+block comments, numbers, attributes, and punctuation. - model
- Pure git snapshot model — the data a
crate::GitViewrenders: branches, the commit log, and a directory listing of the tree. The data types are always available + serializable (so the facet builds, tests, andstate_jsons with no git dependency); the live reader [RepoSnapshot::open] is gated behind thegixfeature.