Skip to content

Opening zoom: a fit within the opening check's 0.05 px of the floor opens fitted - #204

Closed
agorischek wants to merge 1 commit into
mainfrom
fix-opening-floor-slack
Closed

agorischek wants to merge 1 commit into
mainfrom
fix-opening-floor-slack

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 21d839e602fa556024c49588c721498732b5a896

Dimension Assessment Rationale
Change confidence 8/10 ↑ The kit's slack now equals the check's tolerance exactly (fitted text ≥ 7.95 px opens fitted; the check accepts ≥ 7.95 px).
↑ New unit cases pin the nuget-update zoom (1.005587 opens fitted) and that 7.9 px still zooms.
↑ tools check --fast passes.
↓ Kit unit and harness browser suites not run locally (need built workspaces); CI runs them.
Diagnosis confidence 9/10 ↑ The failure message reports fitted text 7.96 px at zoom 1.005587: above the check's 7.95 px threshold, yet above the kit's 1.004 zoom threshold.
Evidence fit 9/10 ↑ Same three failures on main's runs for 4567260 (#197) and 9da651c, and on #203; 65f5b22 (before #197) was green.

What changed

Main's browser (packages/renderers/harness, …) fails graph/nuget-update: built-in renderer checks pass since #197:

At 390px (390×700), the diff, div.graph-scroll.pk-dot-grid opens zoomed (1.005587) although fitted its smallest text would be 7.96px, at least the 8px floor; open fitted.

The kit and the check disagreed about "a hair below the floor". openingZoom zoomed whenever the fit fell more than 0.4% short of the floor (floorSlack = 0.004, 0.032 px of 8 px), while the opening check counts fitted text within 0.05 px of the floor (0.63%) as at it and fails a canvas that zooms there. #197's narrow-stage fit puts nuget-update's text at 7.956 px, between the two.

The kit's slack is now the check's tolerance, 0.05 / (8 − 0.05), so a fit the check calls fitted opens fitted. Each constant names the other. No public API changes.

This blocks v0.3.0 (#202, #203), which tags only a green main.

Evidence

  • npm run tools -- check --fast: pass.

  • New cases in packages/renderers/kit/test/layout.test.mjs: zoom 1.005587 opens fitted; 7.9 px still zooms to the floor.

  • Documentation that this change affects is updated, and generated reference
    pages are regenerated (npm run docs:generate). (No exported API or TSDoc changed.)

  • Fixes include a regression test.

  • No credentials, private source or machine-specific paths are included.

…pens fitted

The kit zoomed to the 8 px floor whenever a fit fell more than 0.4% short
(0.032 px), while the opening check counts fitted text within 0.05 px of
the floor as at it and fails a canvas that zooms there. graph/nuget-update
at 390px fits at 7.956 px since #197, so it opened at zoom 1.0056 and the
check failed it on main. The kit's slack is now the check's tolerance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The opening-zoom tolerance adjustment has no active review issues.

No open issues 🎉

What changed in this PR

Aligns the renderer kit’s opening-zoom tolerance with the built-in opening check to address the narrow-screen NuGet regression blocking v0.3.0. No public API changes.

Changes:

  • Derives the zoom threshold from a 0.05 px tolerance below the 8 px text floor.
  • Adds regression cases for the NuGet opening zoom and text that remains below the tolerance.
  • Updates comments to document the relationship between the kit and check tolerances.
File Description
packages/​renderers/​testing/​src/​checks/​frame/​opening.ts Comment-only clarification linking the check tolerance to the kit.
packages/​renderers/​kit/​test/​layout.test.mjs Tests fitted opening within tolerance and continued zooming below it.
packages/​renderers/​kit/​src/​zoom.ts Replaces fixed proportional slack with a threshold derived from the pixel tolerance.

Review effort: Balanced

@agorischek

Copy link
Copy Markdown
Collaborator Author

Superseded by #200, which merged the identical fix (kit floorSlack = 8/(8−0.05) − 1, equal to this PR's 0.05/7.95).

@agorischek agorischek closed this Dec 1, 2026
@agorischek
agorischek deleted the fix-opening-floor-slack branch December 1, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants