Introducing a new way to review your PRs.

Read the announcement

opencut-app / opencut

The open-source CapCut alternative

View on GitHub

12 documents · Updated Nov 16, 2026

docs / web-editor-route


covers:

  • apps/web/src/routes/editor.tsx
  • apps/web/src/hooks/**
  • apps/web/src/lib/**

Web Editor Route

Overview

The browser editor flow currently consists of a TanStack Router route stub at apps/…/editor.tsx. The file registers /editor with createFileRoute('/editor') and renders the local Editor component as static markup: a <main> containing the Editor heading and a Coming soon. paragraph. There is no editor state, persistence, network I/O, media handling, or external service integration in this route yet.

The route does not currently consume the shared web hook or utility covered by this doc, but those files are the local support surface likely to be used as the editor UI grows:

  • apps/…/use-mobile.ts exports useIsMobile(), a React hook that tracks whether window.innerWidth is below the 768 px breakpoint. It initializes to undefined, registers a matchMedia('(max-width: 767px)') change listener in useEffect, sets state from window.innerWidth, removes the listener on cleanup, and returns a boolean via !!isMobile. The first render is therefore always false until the effect runs in the browser.
  • apps/…/utils.ts exports cn(...inputs), a class-name helper that runs clsx and then tailwind-merge. Use it for editor UI class composition when conditional classes or Tailwind conflict resolution are needed.

Coupling

  • If apps/…/editor.tsx changes the literal passed to createFileRoute, verify the app's generated/registered TanStack Router route tree still points browser navigation at /editor; the URL contract is encoded in that literal rather than in a separate route manifest in this file.
  • If editor components begin using useIsMobile() from apps/…/use-mobile.ts for layout decisions, account for its initial false return before the browser effect runs; mobile-only editor UI can briefly render as desktop unless callers tolerate that hydration-time default.
  • If editor UI code uses cn() from apps/…/utils.ts, keep Tailwind class ordering assumptions aligned with tailwind-merge; later conflicting classes win after clsx flattens conditional inputs.