Repository navigation
test(content): state which branch the Fix run's Length hint test takes (#1553 review) - #1558
Merged
Merged
Conversation
ansvisor#1553 review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
approved these changes
Oct 27, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with a follow-up.
The #1553 review's item (state which branch the Fix test takes) is done.
What I checked:
- The assertions fit the fixture.
- The Length is 20, so the top of its band is
lengthBand(20).max, which is round(20 × 1.2) = 24.overLengthForsends the status'smaxas it is. - The page counts 53 characters: the H1's 20 and the paragraph's 33. So the Length is open as long.
- The Length is held. With no last rewrite,
lengthOutOfReachholds it when the rewrite floor is past 24. HererewriteFloorcomes to 120: the H1's 20 plus the least summary (LEAST_SUMMARY, 100), because the Summary rule is on by default. - So the Fix run sends no Length rule, and
overLengthForgives{ count: 53, max: 24 }.toEqualmatches it exactly, with no other key.
- The Length is 20, so the top of its band is
- It passes on main and fails without the hint.
- The two new lines are the old
elsebranch plus the opposite of the oldif. In this fixture only theelseran, so the test passes on main's code as it did before. - Main's web hasn't changed since the PR's base. 3b650fb changed only server files.
- If the hint were dropped, by
overLengthForor by the Fix call (_draft-editor.tsx:2402-2405),sent.overLengthis undefined and the second line fails. - If the Length stopped being held and were sent as a rule, the first line fails. The old test passed in that case.
- I read the test but didn't run it.
- The two new lines are the old
- Merge.
Follow-up:
- The comment gives the wrong reason for the hold (
page.test.tsx:6946).- Being far past the Length isn't why it's held. A page far past its Length still gets the rule sent when a rewrite could reach it: that's the other branch.
- It's held here because a rewrite keeps the H1 and writes at least a summary, 120 characters, which is past the top of 24.
- Fix:
// A rewrite keeps the H1 and writes a summary, at least 120 characters, past the // Length's top of 24: the Length is held from Fix, and the hint goes instead.
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1553's review. The editor test "tells a Fix run how far past its Length the page is when it doesn't send the Length" accepted either outcome:
In its fixture the page is far past a 20-character Length, so the Length is held and only the second branch ran. If the fixture changed so the Length wasn't held, the test would still pass but stop checking the call.
Now it states the branch:
Test only; no behavior change.
Related issue
Follow-up to #1553 (review item 1).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn test(427 files, 4,080 tests) andyarn build, both pass.🤖 Generated with Claude Code