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 whetherwindow.innerWidthis below the768px breakpoint. It initializes toundefined, registers amatchMedia('(max-width: 767px)')change listener inuseEffect, sets state fromwindow.innerWidth, removes the listener on cleanup, and returns a boolean via!!isMobile. The first render is therefore alwaysfalseuntil the effect runs in the browser. - apps/…/utils.ts exports
cn(...inputs), a class-name helper that runsclsxand thentailwind-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 initialfalsereturn 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 withtailwind-merge; later conflicting classes win afterclsxflattens conditional inputs.