codex icon indicating copy to clipboard operation
codex copied to clipboard

[macOS] In-app browser device preview clips the right edge at 430 × 932 when the page reports DPR 0.90

Open zhulijin1991 opened this issue 2 weeks ago • 0 comments

What version of the Codex App are you using (From “About Codex” dialog)?

ChatGPT desktop 26.1111.21308 (build 27194), read from the installed app bundle. The issue is in the Codex in-app browser in the desktop app.

What subscription do you have?

Omitted. The issue concerns browser rendering.

What platform is your computer?

macOS 27.3 (26C5035r), Apple silicon (arm64). Chrome comparison: 157.0.8103.79.

What issue are you seeing?

The Codex device preview clips the right side of a responsive page. On the affected page, the device toolbar showed iPhone 15 Pro Max, 430 × 932, 100%, but the DOM laid out at 478 × 1035 CSS px with devicePixelRatio ≈ 0.90. The page did not horizontally overflow its own layout viewport (scrollWidth === innerWidth). The right-aligned controls were nevertheless clipped by the device preview. The same page showed both right-aligned controls in Chrome DevTools Device Mode at 440 × 956.

I reproduced the layout mismatch with the standalone HTML below in the same Codex session. With the in-app browser viewport set to 430 × 932:

Measurement Observed
innerWidth × innerHeight 478 × 1035 CSS px
document.documentElement.scrollWidth 478 CSS px
devicePixelRatio 0.90
Right edge of the bordered panel 465.8 CSS px
Right edge of the button 454.1 CSS px

The width ratio 430 / 0.9 ≈ 477.8 suggests a mismatch between page zoom and the device frame. The toolbar's 100% indicator was visible on the affected page. I could verify the effective ratio in the DOM, but did not independently confirm the webpage zoom setting in the browser options menu. Turning off the explicit viewport override brought the sample DOM to 430 × 932 CSS px while the displayed content area was still that size. Applying 430 × 932 again reproduced the mismatch.

What steps can reproduce the bug?

  1. Save the HTML below as index.html and serve it locally (for example, python3 -m http.server 8877 --bind 127.0.0.1).
  2. Open it in the Codex in-app browser. Enable device preview at 430 × 932 using the iPhone 15 Pro Max preset or set the in-app browser viewport to those dimensions.
  3. Check the displayed CSS width and the panel's right border and button. The affected browser reported DPR 0.90. If the issue does not reproduce at default webpage zoom, also test with webpage zoom at 90%. The 90% case is suggested by the measured ratio.
  4. Compare in Chrome DevTools Device Mode.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Device viewport clipping repro</title>
<style>
  * { box-sizing: border-box; }
  body { margin: 0; padding: 12px; font: 16px system-ui; background: #eef2ff; }
  main { position: relative; height: 160px; border: 2px solid #2451ab; }
  button { position: absolute; right: 10px; bottom: 10px; }
  pre { margin: 0; padding: 10px; }
</style>
<main><pre id="metrics"></pre><button>Right edge →</button></main>
<script>
  const showMetrics = () => {
    document.querySelector("#metrics").textContent =
      `${innerWidth} × ${innerHeight} CSS px | DPR ${devicePixelRatio.toFixed(2)}`;
  };
  addEventListener("resize", showMetrics);
  showMetrics();
</script>
</html>

What is the expected behavior?

The preview should render the entire emulated viewport, including the right border and button. At a nominal 430 × 932 and 100% effective zoom, the page should lay out at 430 × 932 CSS px. If webpage zoom changes how many CSS pixels fit, the device frame should scale the rendered surface consistently.

Additional information

Possibly related to #50961 and #57755, which also describe macOS device-preview geometry issues. This report adds an isolated HTML reproduction and the measured 0.90 ratio on macOS 27.3. The private workbench URL and screenshots are omitted.

zhulijin1991 avatar Nov 17 '26 03:11 zhulijin1991