Skip to content

Deposit UI degrades with many videos per project #2184

Description

@SylvainGirod

Note: this issue was drafted with AI assistance.

Summary

The project deposit page caps a project at 10 videos because the more videos there are, the more the UI laggs.
Below are the possible root cause and three fix proposals, ordered by potential gain, so the cap could be raised or removed.

Root cause

The page uses AngularJS's data binding, which relies on a digest cycle that re-evaluates every watcher on the page on each keystroke, scroll tick, returning request, or timer tick. Two things make this grow with the number of videos:

  1. One sub-form per video. In deposits.html (line ~115), ng-repeat mounts a full <cds-deposit> for every video. Watchers scale with videos × fields, so editing one field triggers a digest that checks all videos, and more importantly all fields in all forms. (e.g. editing the title of Video 1 would trigger the watchers for all the fields of all the video forms).

  2. Per-video polling. Each <cds-deposit> runs its own $interval (cdsDeposit.js line ~570). Every tick still triggers a full digest, so N videos means N digest triggers every 5s, even if the HTTP call is ignored.

Proposed fixes (ordered by impact)

  1. Lazy-render with ng-if. Show a light summary row for collapsed videos and mount the heavy form only when a panel is active. ng-if removes the node from the DOM and the digest cycle (unlike ng-show).

⚠️ Edge cases to validate: autosave when a form is unmounted, pre-publish validation of collapsed videos, in-progress uploads surviving a collapse.

  1. Single shared poller. Remove the per-instance $interval in cdsDeposit.js and lift one timer to the parent cdsDeposits, which fetches statuses once and distributes them. Replaces N digest triggers with one.

  2. One-time bindings + debounce. Use {{::value}} for static content (labels, collapsed titles, frozen statuses) and ng-model-options="{ debounce: 300 }" on editable fields. This will in the end reduce the number of watchers, and number of triggers while the user writes of scrolls.

Acceptance criteria

  • Page stays responsive with 50 to 100 videos (no input lag, smooth scrolling).
  • DEPOSIT_PROJECT_MAX_N_VIDEOS can be raised or removed safely.
  • Autosave, validation, and uploads work across collapse/expand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions