Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Browser annotations sit behind native modal dialogs #16030

ClosedGrannoDev(GitHub profile, opens in a new tab) opened this issue 4 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Serve this HTML page and open it in the integrated browser:
<button onclick="document.querySelector('dialog').showModal()">Open modal</button>
<dialog><h2>Annotate this heading</h2><button onclick="this.closest('dialog').close()">Close</button></dialog>
  1. Open the modal, activate Annotate, and select its heading.
  2. Click the annotation comment field and try to type.

Expected behavior

The annotation outline and editor appear above the modal, and the comment field accepts input.

Actual behavior

The editor appears beneath the backdrop and cannot receive focus. Native modal dialogs render in the top layer and make elements outside the dialog inert; the annotation overlay is an ordinary fixed div outside it.

Impact

Minor bug or occasional failure. Comment entry is blocked while a native modal is open.

Version or commit

main @ 7812230572f2d7e042d8d14ada2381fc71377560

Environment

T3 Code Alpha 0.0.45's collaborative browser on macOS, Electron 44.4.2 / Chromium 152. The actual PickPreload.ts was bundled into a controlled fixture with an Electron IPC test bridge. This reproduced the rendering and input failure; screenshot delivery to the composer was not exercised.

Screenshots, recordings, or supporting files

Before: annotation editor beneath the modal backdrop

Before screenshot · Before recording

  1. Note

    Grok responding on behalf of Julius.

    Triage

    Thanks for the clear repro and the before screenshot, @GrannoDev! This reproduces from the code on current main (7812230572f2), the commit you reported, and no duplicate issue turned up. The desktop in-app browser is the only surface that injects this overlay.

    What I found

    • startAnnotation in PickPreload.ts builds one fixed host and appends it to document.documentElement at z-index: 2147483646. The outline, label, toolbar, and comment editor all live in that host.
    • A native <dialog> opened with showModal() sits in the top layer, above every document z-index, and makes the rest of the document inert. Because the overlay is outside the dialog, the editor, toolbar, and outline paint under the dialog's ::backdrop, and comment.focus() in updateStatus can't move focus onto the inert textarea. Clicks land on the backdrop instead of the editor.
    • Selecting the heading still works because the pick listeners are on window in the capture phase and hit-testing reaches the dialog contents. The failure is paint order and inertness, not the pick itself.
    • This is specific to modal dialogs: a non-modal show() dialog doesn't use the top layer, so the existing z-index still wins. Framework modals built from ordinary DOM are a separate case.

    Likely fix area

    startAnnotation in apps/desktop/src/preview/PickPreload.ts. One option is moving the overlay host into the active modal's top layer while a <dialog> is modal and putting it back on document.documentElement when the dialog closes. Reparenting alone wouldn't be enough if the host stays outside the top layer. Open PR #16031 is a patch from the same report.

    A maintainer will decide on the fix direction.

  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsvia-triage

  4. Also hitting this in daily use on T3 Code (Nightly) 0.0.46-nightly.20261015.3171, macOS, with a real React app (not only the fixture).

    Our app opens its modals with <dialog>.showModal(). With one open, Annotate → Select still outlines the element inside the dialog (the div.… label shows up), but the comment editor isn't usable, so nothing inside a modal can be annotated. Most of our forms live in modals, so this comes up a lot.

    Workaround for now: take a preview screenshot and describe the problem in the chat instead.

    +1 for the fix direction in #16031.

  5. Checked against main a12d6ed942. No duplicate found among open issues created in the last 90 days.

    Served the exact HTML with python3 -m http.server 18030 and opened it in the collaborative preview (Linux Chrome 154, 1280×800). Clicking Open modal succeeds and dialog.matches(':modal') returns true. The annotation step could not be exercised: this VM has no native Electron client, and the available preview automation does not expose Annotate. This is not a reproduction or a passing check of the annotation bug.

    The existing fix PR already records preload-level before/after evidence, with native Electron and delivery to the desktop composer still unverified. The remaining check needs a desktop client: open this fixture, open the modal, select its heading with Annotate, enter a comment, and attach it to the composer. Please include the tested build/commit and a recording of that full flow. Leaving this issue open pending that verification.

  6. juliusmarminge added labelsneeds more info

  7. Closing: no reply in 7 days after we asked for more information. Comment with the missing details and we will reopen.

Sign in to join this conversation.