fix(reports): route usage-cell grey meta suffix through per-token runs - #2002
Conversation
#1968) The grey areaText/attachmentsNote suffix in the Usage column was emitted as a single pdfmake run, leaving any unbroken token wider than the column unprottected. Route it through buildUsageTextRuns (applying DEPOSIT_NOTE_TEXT_COLOR to each resulting run) to match the break-all treatment already applied to the body prose. Also updates: - splitUsageCell test helper: relaxes the "exactly one grey run" invariant to "all grey runs are contiguous at the tail", concatenating their text so all existing metaRun.text assertions remain unchanged - Channel enumeration comment: removes the grey suffix from the recorded-not-fixed list (three → two channels) - buildUsageCell function comment: describes the new multi-run behaviour Fixes #1968 Co-Authored-By: Claude frontend-developer <noreply@anthropic.com> Co-Authored-By: Claude qa-integration-tester <noreply@anthropic.com>
…pread rule Content is a union that includes string; spreading r: Content fails the TypeScript "spread types may only be created from object types" check. Use Object.assign instead to merge the color property. Co-Authored-By: Claude frontend-developer <noreply@anthropic.com>
…-run invariant (#1968) realRender.test.ts has its own splitUsageCell helper with the same strict one-grey-run invariant. Relax to "contiguous grey runs at the tail", concatenating their text into metaRaw/metaText so all existing assertions remain unchanged. Co-Authored-By: Claude qa-integration-tester <noreply@anthropic.com>
|
[ux-designer] Design Review — PR #2002Scope qualificationThis PR touches only Visual consistency (core review question)Before: body prose went through After: both body prose and grey meta suffix go through This makes the grey suffix more consistent with body prose, not less. The only pre-fix asymmetry was the missing word-break protection on the suffix; that gap is now closed. Object.assign correctness
Color value
Font and sizeBoth body and meta run under the Test helper updates
Both are structural invariants the production code genuinely maintains, and the reassembly of Render note (informational)Per my review protocol for FindingsNo findings. Nothing flagged. VERDICT: APPROVED |
|
[product-architect] Architecture/contract review of PR #2002 ( SummaryThe production change is correct — I verified the behaviour against pdfmake's own source rather than trusting the types, and the two questions I expected to be risky (per-run The blocker is coverage: this PR relaxed the only invariant that observed run structure and added nothing that observes the new structure. Reverting the fix leaves all 168 tests green. BlockingH1 — The fix has zero regression coverage; issue AC1 is not satisfiedNo test in this PR (or on
So the property the fix establishes is currently unobservable by any assertion. #1968 AC1 requires the no-overflow property measured against the real embedded font, and AC2 requires the all-tokens-fit case to be byte-unchanged — neither is asserted. This also trips the repo's test-file-parity rule (modified production file, no new test). The fixtures and helpers to do this already exist, so the ask is small:
Non-blockingM1 —
|
…n runs
Product-architect H1: reverting the production hunk left all tests green
because splitUsageCell synthesized a new { text, color } object and
discarded wordBreak. Add two levels of coverage:
overviewPdf.test.ts (unit):
- Return greyRuns[] from splitUsageCell (raw runs preserving wordBreak)
- space-containing areaText produces > 1 grey runs (proves per-token split)
- over-wide single token in areaText gets wordBreak: break-all on grey run
realRender.test.ts (real pdfmake render):
- 'W'.repeat(30) in areaText: metaText round-trips losslessly (AC1) and
the grey run carries wordBreak: break-all (proves fix path exercised)
Also fix two stale "one grey run per row" doc comments → "one or more".
Co-Authored-By: Claude qa-integration-tester <noreply@anthropic.com>
|
[product-architect] Re-review (round 2) — PR #2002, H1 — RESOLVED (independently verified, not taken on trust)Round 1's blocker was that the fix had zero effective regression coverage: I reverted the production hunk in runs.push({ text, color: DEPOSIT_NOTE_TEXT_COLOR });All three new regression tests fail, each on the assertion that encodes the fix:
Restored, both suites are green: 171/171 (97 The root cause of the round-1 gap is genuinely fixed, not papered over: On the invariant relaxation itself — this is the right shape. It drops the assertion that was merely incidentally true ("exactly one grey run") while keeping the two properties that are actually load-bearing for every reader of these cells: grey runs are contiguous and tail-anchored, each with its own explicit diagnostic message. Relaxing to "grey runs exist somewhere" would have been the failure mode here, and it was avoided. Vertical-height check (the non-obvious risk of this fix). Applying M1 —
|
|
🎉 This PR is included in version 2.14.0-beta.9 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.14.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
areaText/attachmentsNotesuffix as a single pdfmake run left any unbroken token wider than the Usage column without overflow protection; now routes throughbuildUsageTextRunsso break-all applies per token, matching the body prose treatment.splitUsageCelltest-helper invariant from "exactly one grey run" to "all grey runs contiguous at the tail", concatenating their text so all existingmetaRun.textassertions remain unchanged.buildUsageCellfunction comment.Fixes #1968
Test plan
🤖 Generated with Claude Code