Files
artcraft/frontend/apps
Tanish Manku ac0c7b2210 PageScene: stop overlay click handler from silencing portal'd modal clicks
Two PageScene-only divergences from how the working pages
(PageDraw / PageImage / PageVideo) handle the same upload modals:

1. `handleOverlayClick` on the top/bottom controls overlays called
   `event.stopPropagation()` for every click that bubbled through
   them. Modals rendered as JSX children of `Controls3D` (the
   upload-3D / upload-image / upload-splat dialogs) are
   React-tree descendants even though `Modal`'s `Dialog.Portal`
   puts them at `document.body` in the DOM. React synthetic
   stopPropagation calls native `Event.stopPropagation()`, which
   silences `react-drag-drop-files`'s native `addEventListener("click", u)`
   on the file-input label — so clicking the drop zone never opens
   the OS file picker.
   Narrow the handler to `event.target === event.currentTarget` so
   it only fires on the transparent overlay area itself, never on
   bubbles from children. The original "control buttons don't
   interact with canvas" intent is preserved without the side
   effect — the canvas listener is bound to the canvas element only,
   so clicks on overlay siblings never reach it regardless.

2. `tabIndex={0}` + `outline: none` on the editor canvas. Added in
   `61c4936c29` "so [the canvas] can receive keyboard focus," but
   `useViewportKeyboard` listens at `document` (not on canvas) so
   the focus isn't actually required. Other pages don't make their
   canvas focusable; remove for parity.
2026-05-01 17:18:07 -07:00
..
2026-03-12 21:35:29 +07:00