Repository navigation
engine: pageLayout.printTitles only touches the axes it is given - #1527
Merged
Merged
Conversation
print_titles read both rows and cols as Options and assigned both
unconditionally, so {"rows":"2:2"} set title_cols = None and
{"cols":"A:A"} set title_rows = None: the repeated rows or columns
disappeared from every printed page with no message, and there was no
way to set or clear just one axis. The sibling pageLayout.pageSetup
already distinguishes "key absent" from "key present but empty"; read
both axes the same way — absent leaves the axis alone, empty/null clears
it, anything else that is not a range is an error rather than a silent
wipe.
Regression test: print_titles_keeps_the_axis_it_is_not_given — on main
the rows-only call clears the columns; with the fix each axis is touched
only when named, an explicit empty value still clears, and a bad range
errors.
This was referenced Oct 15, 2026
|
Verified against
Correct and precisely targeted at the actual bug (the unconditional double-assignment), matching the sibling |
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.
print_titlesreads bothrowsandcolsintoOptions and assigns both unconditionally (crates/engine/src/cmd/view.rs:234), sopageLayout.printTitles {"rows":"2:2"}setstitle_cols = Noneand{"cols":"A:A"}setstitle_rows = None: the repeated columns (or rows) disappear from every printed page, with no message and no way to set or clear just one axis. Reachable from any programmatic caller — control channel, MCPexecute_command, or the CLI.The sibling command already reads these the right way:
pageLayout.pageSetupdistinguishes "key absent" (leave alone) from "key present but empty/null" (clear) viaOption<Option<..>>(crates/engine/src/cmd/print.rs:1612). The two commands disagree about the same two settings today.Fix: read both axes the way
pageSetupdoes — an absent key leaves that axis alone, an empty/null value clears it, and anything else that isn't a range is an error rather than a silent wipe.Regression test:
print_titles_keeps_the_axis_it_is_not_given— on main the rows-only call clears the columns (left: (Some((1, 1)), None)); with the fix each axis is touched only when named, an explicit empty value still clears that axis on purpose, and a bad range errors. Fullgridcraft-enginelib suite green (287 passed).