---
name: Files page
type: architecture-map-page
slice: 01-frontend
last_verified: 2026/05/09
---

# Files page

> **Where you are:** [Architecture map](../../README.md) → [Frontend](../README.md) → [Pages overview](../pages-overview.md) → Files

**Plain English summary.** Drag and drop or browse local audio/video files for transcription. Same engine as live dictation, just file mode. On finish, results land in the page (preview text, segments) and into `addToHistory`.

## At a glance

- **Path:** `src/lib/pages/FilesPage.svelte`
- **LOC:** 263
- **Imports (selected):**
  - Tauri: `invoke` (core), `listen` (event).
  - Stores: `settings`, `addToHistory` from `page.svelte.ts`. `profilesStore`. `toasts` (transitive via store helpers).
  - Components: `Card`, `EmptyState`.
  - Utils: `exportTranscript`.
  - External: `Upload` icon from `lucide-svelte`. `@tauri-apps/plugin-dialog` (lazy import).

## What's in here

### Drag and drop

- `onMount` registers three Tauri events:
  - `tauri://drag-drop` (`FilesPage.svelte:28`). Filters the dropped paths to supported extensions and starts transcription.
  - `tauri://drag-enter` (`FilesPage.svelte:34`). Sets `isDragOver = true`.
  - `tauri://drag-leave` (`FilesPage.svelte:35`). Sets `isDragOver = false`.
- `onDestroy` calls each unlisten.

### Browse

- `handleBrowse()` lazy imports `@tauri-apps/plugin-dialog` and opens with the audio/video filter (`mp3, wav, m4a, mp4, flac, ogg, webm, mov, mkv`).

### Transcription

- Calls `invoke("transcribe_file", { ... })` (`FilesPage.svelte:76`). Receives transcript text + segments.
- Optional `copy_to_clipboard` on completion.
- Pushes result into history via the store helper.

### State

- `fileTranscript`, `segments`, `isDragOver`, `progress`, `progressText`, `fileName`, `error`, `transcribing`.

## Tauri command surface

`transcribe_file`, `copy_to_clipboard`. Plus dialog plugin.

## Watch outs

- The drag and drop events require the Tauri config to declare drag drop on the relevant window. If the events do not fire, check `tauri.conf.json` and slice 02.
- Long files block the UI of this page until `transcribe_file` resolves. There is no abort.
- The supported extensions list is duplicated between the file dialog filter and (presumably) the Rust side. Drift risk.
- Multi file drag drop iterates serially. No queue UI.

## See also

- [Pages: dictation](dictation.md). The live counterpart.
- [Frontend ↔ Tauri bridge](../frontend-tauri-bridge.md).
