# src/commands/view

`normalize view` subcommand implementations. Provides a unified view of files, directories, and symbols extracted from the index. Modules: `file` (render a file with syntax context), `symbol` (show a single symbol with docstring/signature/children), `tree` (directory/module tree), `lines` (line-range view), `history` (git blame-based line-range history for a path or symbol — uses gix blame with a line range, no git binary required), `search` (fuzzy symbol search across the index, `search_symbols`), `report` (unified `ViewReport` struct used for all view output modes, plus `ViewListReport` for `view list`, plus `ViewHistoryReport` for history), `chunked` (`ChunkedViewReport` + `build_chunk_view`/`build_around_view` for large-file navigation via `normalize view chunk`). Configuration via `ViewConfig` (depth, line numbers, show_docs, and `context_files` defaults). The `--full` flag emits raw file source; `--types-only` filters to type-bearing symbols. Data/config languages (JSON, YAML, TOML, HTML, CSS, XML) surface a warning when viewed.

## Architecture

All view output goes through a single `ViewReport` struct with fields that are populated based on context (directory/file/symbol). The old `ViewOutput` enum and per-kind structs (`ViewFileReport`, `ViewSymbolReport`, etc.) have been dissolved. `normalize view list` is a new subcommand returning `ViewListReport(Vec<ViewReport>)` for multi-result views; `--kind` on `view list` lists symbols by kind. Directory views populate a `summary` field by checking `context_files` (configurable via `[view] context_files` in config; default `["SUMMARY.md", ".context.md"]`); the first matching file per directory wins. `format_text()` and `format_pretty()` prepend the summary before the file tree, and `--json` output includes it as `"summary": "..."` (omitted when absent). `--dir-context` walks the full root→target path using the same `context_files` list and now also populates a `dir_context` field in `ViewReport` with the merged context content, so agents using `--json` receive the context.
