SlateGet Slate
Docs / Start

Concepts

Bursts, intents, the classifier and the source — the four ideas behind Slate's reactive pane.

On this page
The burstThe intentThe classifierThe sourceReplay

The burst

A single agent action produces dozens of filesystem events — a write, a rename of a temp file, a formatter pass, a test runner touching a cache. Reacting to each one would make the pane strobe.

Slate collects events into a burst: everything that lands within a 90 ms quiet window, gitignore-filtered, deduplicated by path. One burst means "the agent just did a thing".

// types.rs
pub struct FileBurst {
    pub events: Vec<FileChange>,   // path + Created | Modified | Deleted
}

The intent

A burst is turned into a ViewIntent — the pane's instruction for what to render.

IntentRenders
Spec { path }That markdown file, rendered
Diff { paths }Unified diff of exactly those files
TreeWorking-tree status
LogCommit history
SearchThe search surface

The classifier

One pure function maps a burst to an intent. It is I/O-free so it can be unit-tested in isolation, and it runs in microseconds.

// classifier.rs — rules, in priority order
// 1. markdown created, or markdown dominates the burst
if md_created || md_live.len() >= non_md {
    return ViewIntent::Spec { path: last_markdown }
}
// 2. structure changed more than content
if structural >= 2 && structural >= modified.len() {
    return ViewIntent::Tree
}
// 3. otherwise: the files that changed
if !modified.is_empty() {
    return ViewIntent::Diff { paths: modified }
}
ViewIntent::Tree

Two consequences worth internalising. A spec merely touched during a code edit does not hijack the pane — code has to be the minority for spec to win. And a burst of pure renames reads as structural, so you get the tree rather than a diff of nothing.

Why not a model

An LLM here would add latency, cost and nondeterminism to a decision that is three if statements. The pane has to be right before you finish looking up.

The source

Every switch is attributed in the pane header, so you always know why you are looking at something:

  • classifier — Slate inferred it from a burst.
  • override — an agent asked for it via the override API.
  • manual — you clicked or pressed a shortcut.

A manual choice suppresses auto-switching for a short window; ⌘. suppresses it indefinitely.

Replay

The last 20 bursts keep their diff snapshot in memory. The Activity and Timeline views let you scrub back and re-open any of them — useful precisely when a change from ten minutes ago turns out to be the culprit.