---
path: /studio/aja/gap-filling
surface: studio
domain: aja
auth: signed-in + studio entitlement
source: apps/oshun/web/src/app/studio/aja/gap-filling/page.tsx
status: walked + e2e-covered
last_walked:
  '2026-07-02 cleanup-lane console addendum — Playwright real-dev-infra coverage
  now proves signed-in render, route-map contract, quick-action href order,
  ready missing-data model, 44 px submit target, empty-joint client guard with
  no POST, real BFF missing-frame fill result, fail-closed
  loading/unauthorized/malformed-catalog states, mobile no-overflow, and direct
  BFF 401/403/400/200 gates. Spec:
  apps/oshun/web/e2e/studio-aja-cleanup-lane-consoles.spec.ts.'
  '2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data
  (2xx), console/page-errors, expected content, screenshot verified; live
  screen-reader, touch, offline, and telemetry-delivery checks pending a manual
  AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md; body
  re-derived 2026-06-03 from current source (lane-console architecture)'
---

# Studio Aja · Gap Filling

## Purpose

Admin lane console for reconstructing missing-data gaps in a tracked joint. It
wires the real `@aja/motion-processing` `detectGaps` + `fillShortGaps` pipeline
via `/v1/admin/aja/gap-filling`: detect missing frames in a joint X-track
(entered as empty / "null" / "-" segments) and reconstruct them by linear
interpolation between the valid boundary keyframes, returning gaps detected,
frames recovered, and the filled track.

## Entry points

- **Direct URL / bookmark** — `/studio/aja/gap-filling`; metadata sets
  `alternates.canonical`
- **Linked from `/studio`** Domain-bridge studios section (Aja sub-area)
- **Quick action** — "Open Aja Retiming workspace" (`/studio/aja/retiming`)

## Layout regions

`page.tsx` renders inside `<ShellLayout active="studio">`:

- **Workspace** `StudioAjaGapFillingWorkspace` — `<h1>` "Aja Gap Filling
  Workspace" + summary (`data-aja-gap-filling-summary`), the model line
  (`data-aja-gf-model`, gap type + fill method), then the fill form
- **Route Map panel** (`data-aja-gap-filling-route-map`, `<h2>`) — 5 entries
  from `STUDIO_AJA_GAP_FILLING_ROUTE_MAP`
- **Quick-action lane** — `quickAction` links: retiming, `/studio`

## States

- [x] **Loading** — `data-aja-gf-loading` "Loading gap-filling model…" while
      `GET /v1/admin/aja/gap-filling` is in flight
- [x] **Unauthorized (gated)** — `data-aja-gf-unauthorized` on 401/403; admin
      scope message ("Aja workspace scope required to view gap filling.")
- [x] **Error** — `data-aja-gf-error` on non-OK / malformed / network failure
- [x] **Ready (form)** — `data-aja-gf-fill-form` once the catalog loads
- [x] **Result** — `data-aja-gf-result` (`-gaps-detected`, `-frames-recovered`,
      `-filled-track`, per-gap rows) after a successful POST; validation error
      in `data-aja-gf-fill-error`
- [x] **Offline** — SSR shell; lane error state when `fetch` unavailable
- [x] **Standalone PWA** — desktop layout; `quickAction` anchors wrap
- [x] **Empty** — N/A; catalog is constant

## Interactions

### Fill form

- [x] **Joint name** (`<input data-aja-gf-field-joint>`) — required
- [x] **Joint X-track** (`<input data-aja-gf-field-track>`) — comma-separated;
      "null" marks a dropped frame (≥2 entries)
- [x] **Frame rate (Hz)** (`<input data-aja-gf-field-rate>`) — positive number
- [x] **"Detect & fill gaps"** (`<button data-aja-gf-fill-submit>`) — POSTs
      `{ jointName, track, frameRate }` to `/v1/admin/aja/gap-filling/fill`

### Route Map panel

- [x] **5 entries** (`<article>` per `path` + `purpose`) — non-interactive

### Quick-action lane

- [x] **"Open Aja Retiming workspace"** → `/studio/aja/retiming`
- [x] **"Back to Studio workspace index"** → `/studio`

## E2E coverage

- [`apps/oshun/web/e2e/studio-aja-cleanup-lane-consoles.spec.ts`](../../../../apps/oshun/web/e2e/studio-aja-cleanup-lane-consoles.spec.ts)
  covers signed-in shell render, ready missing-data catalog (`missing_data`,
  `linear`), empty-joint client guard with no `POST`, real BFF fill output
  (`gaps detected: 1`, `frames recovered: 2`, filled track `0, 1, 2, 3, 4, 5`),
  route-map count, exact quick-action hrefs, 44 px submit target, loading /
  unauthorized / malformed-catalog fail-closed states, mobile no-overflow, and
  direct BFF auth/schema/happy-path gates.

## Data & contracts

- **Reads**: `GET /v1/admin/aja/gap-filling` (catalog: `gapType`,
  `interpolationMethods`, `consoleMethod`) on mount, `cache: 'no-store'`,
  `buildBffAuthHeaders()`
- **Writes**: `POST /v1/admin/aja/gap-filling/fill`
- **Realtime**: none
- **Caching**: client fetch on mount (no-store); SSR shell
- **Auth/role check**: BFF endpoints admin-scoped, fail-closed (401/403 →
  unauthorized render); route gated signed-in + studio via the proxy

## Cross-references

- Parent: [`../../studio-overview.md`](../../studio-overview.md)
- Sibling routes: [`./studio-aja-retiming.md`](./studio-aja-retiming.md)
- Component sources:
  - `apps/oshun/web/src/components/studio/StudioAjaGapFillingWorkspace.tsx`
  - `apps/oshun/web/src/components/studio/StudioAjaGapFillingRouteMap.ts`

## Known downstream boundaries

- The lane fills a single joint X-track; multi-axis / multi-joint clip fill is
  not yet an input.
- Route-map sub-routes are descriptive contracts; implementation status of those
  child pages is tracked separately from this leaf console.
