# Programs explorer

The left column of the Programs page: a folder tree with a search panel behind a toolbar button.

```
tools/
  files/  web/  knowledge/  planning/  …
applications/
  browser/  meeting/  office_editor/  workflow_recording/
```

Rows and classification: [Programs source categories](https://fzkuji.github.io/OpenProgram/docs/reference/design/ui/programs/programs-source-categories.html).

## Search

| Control | Behaviour |
| --- | --- |
| Toolbar search button | Opens or closes the panel; closing clears the query |
| Filter (default) | Keeps matches and their ancestors; collapsed folders open while searching; no match shows an empty hint |
| Highlight | Keeps every row and marks matching characters |
| Fuzzy (default on) | Characters in order; off means a contiguous substring |
| Match target | Row name or catalog label, case-insensitive |
| Count | Current and total, as `2 / 5` |
| Previous, next, ArrowUp, ArrowDown | Move the current match and wrap around |
| Clear | Empties the query, keeps the panel open |
| Escape | Closes the panel |

## Tree

A branch row toggles with a click, Enter or Space, and its folder icon follows. Refresh rescans Programs.

## Incremental loading

| Client | Behaviour |
| --- | --- |
| Kept across navigation | Loaded directories, selection, expanded folders, call graphs |
| Revalidated | Visible folders and the selected graph, in the background every five seconds and on focus or manual refresh |
| Unchanged response | A revision acknowledgement only |
| Failure | Usable content stays; the read is tried again quietly with backoff. Nothing read yet: the place stays empty |

| Server | Behaviour |
| --- | --- |
| Dependencies | File and directory metadata recorded while a response is built; revalidation checks them and registry and catalog identity |
| Parsed modules | Invalidated by file identity, size, and nanosecond modification and change times |
| New or removed entries | Invalidate the parent directory |
| Limits | Existing containment checks and source limits remain authoritative |
| Storage | Bounded process memory; no filesystem watcher, no persistent user-data cache |

**Acceptance**

Warm navigation renders immediately; unchanged sources are neither read nor parsed; edits, additions and deletions update affected views; refresh preserves selection and expansion.

## Implementation status

Implemented in `apps/web/components/programs/programs-page.tsx`, `programs-cache.ts` and `openprogram/interfaces/server/routes/catalog/programs_cache.py`.
