FileExplorer
A project file tree where every file the agent touched carries M, A or D (modified, added, deleted) in a fixed right column, with a filter box and an Only changed toggle, so people find the agent's work without opening every folder.
Preview
FileExplorer
The project's files with every one the agent touched marked M, A or D, so people find its work without opening every folder.
Master
Changed files carry their letter in a fixed column on the right, in the status colour: M modified, A added, D deleted (struck through). A folder that holds a change shows a dot. Filter by name, or turn on Only changed to hide every untouched file. Click a file to pick it; its path shows in the footer.
Usage
Pass the project tree as nodes ({ name, children?, status? }); a node with children is a folder, and status (modified, added or deleted) goes on files only, since folders work out their own dot. Paths are folder names joined with /, as in src/app/page.tsx, and every callback speaks in paths. Each pair is controlled or not: open and defaultOpen, selected and defaultSelected, onlyChanged and defaultOnlyChanged, filter and defaultFilter. The filter keeps matching names plus the folders that lead to them and opens those folders; with no match, Empty shows with Clear filter. Only changed hides every untouched file and the footer reads 6 files changed. File icons come from the extension; pass fileIcon to choose your own Lucide icon. The tree grows to about 11 rows, then scrolls inside and fades the last row. Only live changes move: rows glide to their new places, new rows rise in, rows that leave fade where they were, folders open with an eased height and the footer path crossfades. One polite live region says only the filter result and the Only changed state.
Do's
- showing which files an agent touched inside the whole project tree
- finding a changed file by name, or hiding every untouched file
- picking a file to open next to the tree (a diff, a preview)
Don'ts
- reviewing and accepting the change itself — ChangeReview or InlineDiff
- a plain hierarchy with no file changes — TreeView
- files a person is uploading — FileUpload
When to use
- showing which files an agent touched inside the whole project tree
- finding a changed file by name, or hiding every untouched file
- picking a file to open next to the tree (a diff, a preview)
When not to use
- reviewing and accepting the change itself — ChangeReview or InlineDiff
- a plain hierarchy with no file changes — TreeView
- files a person is uploading — FileUpload
What an agent reads
import { FileExplorer } from "agentic-ds-kit";- must
- The tree is role=tree named by title, with role=treeitem rows, aria-level, aria-expanded on folders, aria-selected on files and role=group for children; closed groups are inert
- Keyboard from TreeView: Up/Down, Left/Right close, open or move to parent/child, Home/End, Enter or Space opens a folder or selects a file
- A changed file's name reads with its word (app.tsx, Modified); a folder with changes reads Contains changes. The letter and dot are aria-hidden
- The filter is labelled Filter files; Only changed is a button with aria-pressed
- One polite live region announces only the filter result count and the Only changed state
- Rows that leave fade as aria-hidden, inert copies that are removed after the fade; nothing moves on first render or under prefers-reduced-motion
- defaults
- defaultOnlyChanged false
- defaultFilter ""
- stops if
- Do not build a local file tree, file row or status column — use FileExplorer, or TreeView for a plain tree
- Do not show a status by colour alone; keep the M, A or D letter and its word
- Do not set status on folders; they work out their dot from their files
- Do not add an icon package; return a Lucide name or component from fileIcon
- Do not use raw hex
From contracts/fileexplorer.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
Props
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| tree | array | Yes | — | A node with children (even []) is a folder; omit children on a file. Paths are folder names joined with "/" (src/app/page.tsx). Set status on files only: folders that hold a changed file show a dot by themselves. |
| status | modified | added | deleted | No | — | Per file. Shown as the letter M, A or D in the status colour (warning, success, danger); the word is read with the name. Deleted names are muted and struck through. |
| title | string | No | — | Card heading and tree name. Default KitLabels files (Files). |
| open | string[] | No | — | Controlled folder paths the person opened. The filter and Only changed open the folders that lead to what they keep, on top. |
| defaultOpen | string[] | No | — | — |
| onOpenChange | function | No | — | (open: string[]) => void |
| selected | string | No | — | Controlled selected file path. Folders open and close; they are not selected. |
| defaultSelected | string | No | — | — |
| onSelectedChange | function | No | — | (path: string) => void when a file is clicked or picked with Enter or Space. The path shows in the footer. |
| onlyChanged | boolean | No | — | Controlled Only changed toggle: hides every untouched file; the footer reads 6 files changed. |
| defaultOnlyChanged | boolean | No | false | — |
| onOnlyChangedChange | function | No | — | (onlyChanged: boolean) => void |
| filter | string | No | — | Controlled filter text (case-insensitive name match). Keeps matching names and the folders that lead to them, and opens those folders. No match shows Empty with Clear filter. |
| defaultFilter | string | No | "" | — |
| onFilterChange | function | No | — | (filter: string) => void |
| fileIcon | function | No | — | (name: string) => KitIcon | undefined. Default: a Lucide file icon from the extension (code, data, text, image, plain). |
Related
- Block
Change review
Review an agent's change file by file, then accept or reject each file, or the rest at once.
- Component
InlineDiff
Proposed text or code edits you accept or reject in place: unified, split or inline phrase diff, always with + / − marks and counts ("+2 −2", read as "2 added, 2 removed"), then one line.
- Component
TreeView
Nested hierarchy people open and close level by level to browse, pick, or check items.
- Component
FileUpload
Choose files Button in a dashed drop zone (or a compact Button-only row) plus a list of file rows with progress, done, and error states.