# Field: Information Visualization & Progressive Disclosure

**Why This Field Matters**: The view system chooses to render files in audience-appropriate ways — distraction-free HTML iframe, formatted Markdown, raw text. How to present visual information effectively is the domain of information visualization research.

---

## Canonical Concepts

| Concept | Definition | Use in View System |
|---------|-----------|-------------------|
| **Shneiderman's Visual Information Seeking Mantra** | "Overview first, zoom and filter, then details on demand" — canonical three-stage interaction sequence for effective information exploration | ViewFilePage form (overview: file path input) → rendered content (details) → raw mode (zoom/export) |
| **Progressive Disclosure** | Revealing features or information in stages; show essentials first, advanced capabilities on demand; reduces cognitive clutter while keeping power available | `/v` route shows file input form (simple overview); rendered view shows formatted content (essential); `?raw=1` mode exposes raw data (advanced) |
| **Visual Hierarchy** | Using size, color, position, contrast, and spacing to guide viewer attention to important information first; supports scanning and comprehension | ViewFilePage: large input field (primary action = load file), small badges (secondary metadata), full-width content (primary focus) |
| **Gestalt Principles** | Proximity, similarity, continuity, and closure; users perceive grouped elements as unified objects | File path input + submit button grouped together (proximity); distraction-free reading clusters content without borders (closure) |
| **Data-Ink Ratio** | Maximize proportion of visual elements representing actual data; eliminate chartjunk, decoration, or UI that does not encode information | Raw mode shows only content; rendered mode adds navigation chrome only as needed (high data-ink ratio for content) |
| **Cognitive Load & Extraneous Load** | Working memory is limited; effective design minimizes extraneous (irrelevant) cognitive load so working memory can focus on the task | Hiding navbar on `/v` routes reduces extraneous load during reading; reader can focus on content instead of navigation |
| **Distraction-Free Interface** | UI that minimizes non-essential visual elements, motion, and chrome; enables "flow" state for reading, writing, and focused work | `/v` routes show full-screen content; navbar hidden; minimal form interface; sidebar and breadcrumbs removed |

---

## Academic References

| # | Author(s) | Title | Year | Type | URL / DOI |
|---|-----------|-------|------|------|-----------|
| 1 | Shneiderman, B. | "The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations" | 1996 | Peer-reviewed | doi:10.1109/VL.1996.545307 |
| 2 | Nielsen, J. | "Progressive Disclosure" | 2006 | Practitioner (Nielsen Norman Group) | https://www.nngroup.com/articles/progressive-disclosure/ |
| 3 | Tufte, E.R. | *The Visual Display of Quantitative Information* | 1983 | Design Book | ISBN 0-9613921-0-X |
| 4 | Ware, C. | *Information Visualization: Perception for Design* (2nd ed.) | 2004 | Academic Textbook | ISBN 1-55860-819-9 |
| 5 | Wertheimer, M. | "Untersuchungen zur Lehre von der Gestalt" | 1923 | Peer-reviewed (foundational) | Psychological Research, 4:301-350 |
| 6 | Miller, G.A. | "The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information" | 1956 | Peer-reviewed (foundational) | doi:10.1037/h0043158 |
| 7 | Few, S. | *Information Dashboard Design: The Effective Visual Communication of Data* | 2006 | Design Book | ISBN 0-596-10016-7 |
| 8 | Carroll, J.M. & Carrithers, C. | "Training Wheels in a Word Processor" | 1984 | Peer-reviewed | doi:10.1145/358234.358244 |

*Verification Status*: Training-knowledge sourced; live-verify DOIs via https://doi.org

---

## Engineering Implications for View System

### 1. **Progressive Disclosure → Three Modes**

The form at `/v` is the "overview" (Shneiderman). Users provide file path, then:
- **Rendered view**: Details on demand (formatted, visual)
- **Raw mode**: Advanced feature (programmatic, unfiltered data)

**Implementation**:
```typescript
// /v route: simple form (overview)
// Rendered view: <ViewFilePage/> (details on demand)
// Raw mode: ?raw=1 → /api/v/raw (advanced feature)
```

### 2. **Visual Hierarchy → Form + Content**

The file path input is prominent (large, top position); the content fills the viewport below.

**Implementation**:
```tsx
<form className="...px-4 py-3...">  {/* prominent, top position */}
  <input placeholder="/absolute/path..." />
</form>
<main className="min-h-screen">  {/* full viewport, no competing elements */}
  {/* rendered content only */}
</main>
```

**Principle**: Size and position encode priority. Input (small, controlled) is secondary to content (large, dominant).

### 3. **Gestalt Proximity → Component Grouping**

File path input and submit button grouped together (same row, same form); content isolated in separate `<main>` region.

```tsx
<form action="/v">  {/* proximity: input + button in same form */}
  <input name="p" />
  <button type="submit">View</button>
</form>
```

**Principle**: Users perceive grouped elements as a single unit. Input + submit are visually bound; content is separate.

### 4. **Data-Ink Ratio → Distraction-Free**

Raw mode shows only content (100% data-ink). Rendered mode adds minimal chrome (form at top only).

**Implementation**: 
- Navbar *hidden* on `/v` routes (SiteChrome decision)
- No sidebar, breadcrumbs, or secondary navigation
- Minimal form styling (CSS badges instead of verbose labels)

**Principle**: Every pixel should encode information. Navigation UI during reading = wasted ink.

### 5. **Cognitive Load (Extraneous) → Hidden Navbar**

Working memory is limited (~4 chunks, Cowan 2001). Navbar, notifications, and sidebars compete for attention.

**Implementation**:
```tsx
// SiteChrome: conditional rendering
{!isViewerRoute && <Navbar forgeState={forgeState} />}
{!isViewerRoute && <AutoRefreshScript forgeState={forgeState} />}
```

**Principle**: During reading, navbar = extraneous load. Hide it. Reader can navigate when done.

### 6. **Distraction-Free Interface → Overflow Handling**

Content routes: `overflow-hidden` (full viewport, no scrollbars unless content requires)
Other routes: `overflow-y-auto` (normal scrolling, navbar visible)

```tsx
<div className={isViewerRoute ? "overflow-hidden" : "overflow-y-auto"}>
  {children}
</div>
```

**Principle**: Minimize visual clutter. Content should feel immersive, not cramped.

---

## Narrative / Chronicle Voice

**On Progressive Disclosure**:
> "The file path form is a door. The user opens it, and content appears. They don't see code, API calls, or server processes—just a space for a path, and then the file, rendered or raw, as they need it."

**On Visual Hierarchy**:
> "The toolbar disappears so the reader can think. When every pixel serves the content, reading becomes possible again."

**On Cognitive Load**:
> "Hiding the navbar during reading is an act of trust. We trust that the reader knows why they came. We promise not to interrupt."

---

## Cautions & Anti-Patterns

| Anti-Pattern | Risk | How View System Avoids It |
|---|---|---|
| **Modal on modal** | Adds z-axis complexity; breaks cognitive model | ViewFilePage uses full page (main element), not modals |
| **Persistent toolbar during read** | Extraneous load; impairs comprehension | SiteChrome hides navbar on `/v` |
| **Cluttered form** | Cognitive load from too many options | File input form is minimal: one input, one button, one badge |
| **Single-format presentation** | Locks content to one audience; no programmatic access | Three modes: HTML, Markdown, raw |
| **No visual grouping** | Users can't parse the interface; feels chaotic | Form grouped together; content isolated; clear spatial separation |

---

## Success Indicators

- [x] File path form is visually prominent (top position, large input)
- [x] Content dominates viewport after load (no competing elements)
- [x] Navbar hidden on `/v` routes (distraction-free)
- [x] Three disclosure modes available (overview, details, advanced)
- [x] Visual hierarchy guides user from input → rendered content → raw option
- [ ] User testing confirms reduced cognitive load during reading (future validation)

---

## Relevant Future Work

- Add keyboard shortcuts for next/previous file (flow state preservation)
- Consider "fullscreen" mode for HTML files (hide form temporarily)
- Implement breadcrumb history for file browsing (aid navigation while maintaining distraction-free ideal)
