Skip to content

Tray layout: zoom<->auto-fit scrollHeight mismatch (tall cards clipped at zoom >100%) + proof-harness anchor overflow #265

Closed

Description

@Finesssee

Tray layout bugs surfaced by the #261 repro rig

While running the seeded-repro investigation for #261 (seeded proof harness driving the ambient Codex provider card), two layout bugs in adjacent code turned up. Neither reproduces #261, both are confirmed numerically. They are tracked here so they aren't lost when #261 closes.

1. useTrayPanelLayout measure uses zoom-invariant scrollHeight while TrayPanel applies CSS zoom

  • apps/desktop-tauri/src/surfaces/TrayPanel.tsx applies style={{ zoom: trayScale }} on the rendered surface; useTrayPanelLayout.measure / auto-fit sizes the WIN32 window from DOM metrics (body scrollHeight + bottom offsets).
  • Measured: body scrollHeight is IDENTICAL at tray zoom 100/150/200 (800-ish px in all runs — see probe in proof-261-seed/zoom*/probe trace), but rendered visual height scales with zoom. Outcome: at tray zoom >100% the window is sized to the PRE-zoom height and tall cards are clipped below the fold; a horizontal scrollbar appears mid-flyout.
  • Repro path: apply tray zoom 150% in Settings -> Menu -> Tray panel scale (or the settings preset), open tray flyout with a tall card (e.g. Codex with long top-model + reset credits) and observe the clipped bottom content + horizontal scrollbar.
  • Suspected fix area: apps/desktop-tauri/src/hooks/useTrayPanelLayout.ts measure/apply block — multiply measured content height by the active zoom factor before clamping (or compute content height in post-scale px).
  • Evidence: proof-261-seed/zoom150-ds1/, proof-261-seed/zoom200/ capture folders in run 2026-08-06 (rects.json, panel_series.json, screenshots).

2. Proof-harness anchor point overflows work area on tall auto-fit flyouts

  • apps/desktop-tauri/src-tauri/src/proof_harness.rs anchor positioner anchors the flyout at y=252 for the default initial size; after auto-fit settles a tall panel (≥ ~790px) the bottom edge drops below the 1040px work bottom on 1920x1080 displays, clipping content against the screen edge (harness-only behavior).
  • Not user-facing under normal use — impact scoped to proof runs; fix entails re-anchoring the flyout to the selection nearest the bottom edge (justified-above-taskbar) when measured height > available space, or clamping auto-fit max-height to workBottom - anchorY - inset and letting content scroll.
  • Evidence: proof-261-seed/zoom200/rects.json (settled rect bottom y > work bottom).

Both findings are independent of the #261 Codex-tab resize-loop investigation; their triggers are orthogonal (static tall content / static anchor math).

Note: the first finding's measured probe values come from a temporary resize probe injected for investigation (cleanly reverted; no main-line diff remains). The second is observable WIN32-geometry behavior.

Activity

  1. added
    bug
    on Aug 6, 2026
  2. Finesssee commented on Aug 6, 2026

    @Finesssee
    CollaboratorAuthor

    Fixed in #266 (squash-merged as 02971a7).

    1 — zoom × auto-fit mismatch: useTrayPanelLayout auto-fit measures through a new scaledContentHeight(rawHeight, zoom) helper applied at both derivations (scrollHeight/rect seed + bottom-edge walk) before the existing min/max clamp — the window is now sized in post-zoom px. useTrayPanelController passes the active trayScale. Plus min-width: 0 re-asserted on .menu-surface--tray (cascade-order override): the base 260px floor was zoom-multiplied (390px at 150%), causing the horizontal scrollbar. Test: TrayPanel.test.tsx commits 328×762 from raw 505 at 150% (round(505×1.5)+4) and still caps at the 884 work-area clamp for raw 700.

    2 — proof-harness anchor overflow: proof_window_position now justifies the anchor with proof_anchor_y = anchor.min(work_bottom − 8 − max_settle) (max settle = frontend's 920px auto-fit cap), so even the tallest settle keeps its bottom edge at work_bottom − 8. Anchors that already fit are unchanged. (set_max_size was tried first — Win32 ignores it for programmatic setSize.) Test: tall_panel_bottom_edge_never_passes_work_bottom_minus_inset asserts 252 → 112 on the 1080 rig and bottom == 1032.

    Live CUA verification (1920×1080, work area 1920×1040, tray zoom driven to 150% via the footer slider and persisted trayScalePercent: 150, CODEXBAR_PROOF_MODE=trayPanel + seed of the proof-261-seed/full shape):

    • Settled rect (1580, 112, 328, 920) → bottom edge 1032 = 1040 − 8 inset ✓ on screen
    • DOM: bodyScrollWidth == clientWidth == 328 → no horizontal scrollbar; footer bottom 841 ≤ 920 inner height → card's bottom content (cost block + footer through Quit) fully visible (was clipped pre-fix)
    • Screenshot: proof-265/zoom150-tallcard-fixed.png; rects: proof-265/zoom150-tallcard-fixed-rects.json; observation: proof-265/zoom150-tallcard-fixed-observation.json

    Gates on the committed tree: tsc clean, vitest 227 passed, cargo test 332 passed, clippy -D warnings clean, rustfmt clean; CI "Local check" green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions