# Design: Files

Status: **design** (Phase F). Interface for vault files
(`../vault-files.md`).

An IDE-style explorer that keeps an engagement's documents, evidence,
scripts and exports inside the vault, with Markdown documents opening in
the Research Notebook.

## Layout (`/files`, rail item "Files", G D)

- **Sidebar**: search; Pinned (bookmarked files and folders); Recent;
  the folder tree (shared with Notes) with expand and collapse, drag and
  drop to move, context menus (new file, new folder, upload here, rename
  F2, duplicate, download, archive, delete), counts; storage use at the
  bottom.
- **Main**: breadcrumb with the folder path; open file tabs (middle-click
  closes, like Repeater); a list view (name, kind, size, modified, by) or
  grid view with thumbnails for images; selection with click, Ctrl and
  Shift, Ctrl+A; a floating bulk bar (move, tag, archive, download, delete).
  Dropping files anywhere on the main area uploads into the current folder
  with a progress row per file.
- **Inspector** (right, collapsible): name and kind, size, SHA-256 with
  copy, mime, created and modified with actor (agent badge when an agent
  wrote it), provenance, tags and bookmark, linked research objects
  (findings, reports, conversations, requests) with links, revision
  history (compare in the Comparer, restore, download).

## Viewers

| Type | Viewer |
|---|---|
| Markdown | opens in Notes (Live, Source, Read) inside the Files tab |
| Text, JSON, YAML, XML, CSV, source | the message viewer's code view: line numbers, highlighting, find, wrap, folding; editable text files save as new revisions |
| Images | scaled preview with dimensions |
| PDF | the browser's viewer in a sandboxed frame |
| HTML, SVG | source view; rendered preview only in a sandboxed frame without scripts |
| Binary | bounded hex view (first 64 KiB) with type and checksum |
| Other | metadata and Download |

## States

Empty vault: a short explanation, "Upload files" and "Create starter
folders". Upload over the limit: the row says the limit and nothing is
stored. Conflict on save: keep mine, take theirs, compare.

## Keyboard

Arrows move in the tree and list, Enter opens, F2 renames, Delete asks to
delete in place, Ctrl+U uploads, Ctrl+Shift+N new folder, `/` focuses
search.
