Repository navigation
REOPEN-F7 follow-up: empty-label test counts layouts through the measure seam, no test-only read in source (#32616 review P2) - #32799
Conversation
…s layout seam (review P2) Review of #32616 (REVIEW.md section 8): lastLaidOutString was a test-only read in production source. It is removed. LabelText.measure now takes its TextKit layout as a parameter (layOut, default laidOutMetrics), the seam a measure already has; anEmptyLabelLaysNoTextOut passes a counting layout and expects no layout for an empty text at an unbounded width, over 8 fonts (one with nonzero leading, and no font) and 4 shapes, and one layout each for text and for an empty text at a set width. The empty line is built in one place (emptyLine), not twice (review P3). (cherry picked from commit c1e340c)
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Base finding (not from this PR): the Swift test lane on feat-cmux-next 73ba3f9 ends with a failure about 665 s after the selected tests pass. Base step: d823cd6b71adc026df5cf8ce, https://github.com/manaflow-ai/cmuxterm-hq/actions/runs/41565867427. On the owned Macs it is xctest signal 6 after Contacts CoreData XPC errors (steps bee43816, 3554f3fe). The same tests pass in all of these runs. |
|
Review (subagent opus): SHIP at 8fedf1a
|
Summary
Follow-up to #32616 (REOPEN-F7, empty labels need no TextKit layout), which cmux-bot merged at 0b92974 before its review P2 was fixed. This PR is that fix, with no product change:
LabelText.lastLaidOutString, a test-only read in production source, is removed.LabelText.measuretakes its TextKit layout as a parameter (layOut, typeLabelText.Layout, defaultlaidOutMetrics).anEmptyLabelLaysNoTextOutcounts layouts through it.emptyLine(font:)builder instead of two copies; the test covers a font with nonzero leading (Times New Roman 14) and no font.Testing
EmptyLabelMeasureTests(CmuxNextDesignTests):anEmptyLabelLaysNoTextOut: 0 layouts for an empty text at an unbounded width over 8 fonts and 4 shapes; then 1 layout each for a text and for an empty text at a set width.anEmptyLabelLaysOutAsTextKitWould: the fast result equals TextKit at scales 1-3.layouts → 32 == 0andlayouts → 34 == 2. The parity test passed.Review
A review subagent gave SHIP at c1e340c (comment 6592935500 on #32616). It noted that
layOutis a parameter whose default is the production function, and that the parameter adds no stored or debug-only state (P3, no change needed).Observed / Not run
Changelog
none