Repository navigation
Headers and footers: first-page and even-page variants, Insert › Header & Footer edits in place (#344) - #404
Merged
h-a-n-a-s-h-i merged 1 commit intoOct 11, 2026
Conversation
…er & Footer edits in place (storytold#344) XLSX headerFooter kept only oddHeader/oddFooter: a workbook whose header is on a different first page (differentFirst + firstHeader) or on even pages showed no header, and saving dropped it. The model now keeps the first/even headers and footers and the differentFirst / differentOddEven / scaleWithDoc / alignWithMargins flags; XLSX reads and writes them; the PDF and the Page Layout view use the right pair per page; in-place editing edits the page's own pair, and the Header & Footer tab has Different First Page and Different Odd & Even Pages. pageLayout.headerFooter takes the variants and a page: odd|even|first for one-section edits. Insert › Header & Footer now switches to Page Layout view and edits the first page's centre header, as in Excel, instead of opening the codes dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Merged — thank you for the contribution! If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft |
dabaicai001
added a commit
to dabaicai001/gridcraft
that referenced
this pull request
Oct 16, 2026
storytold#404's header/footer variants landed after storytold#413's French table, leaving the translation-completeness test red.
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.
Fixes #344
Root cause
&L…&C…&R). That is easy to miss and isn't how Excel works. In-place editing in Page Layout view only arrived with View: Page Layout view with rulers and in-place headers and footers (#329) #334 (after 0.5.0).oddHeader/oddFooter. Many workbooks put their header on a different first page (differentFirst+firstHeader) or on even pages (differentOddEven+evenHeader). Those headers didn't show in Page Layout view or in the PDF, and saving dropped them.What changed
PrintSettings:first_header/first_footer,even_header/even_footer,different_first,different_odd_even, plus thescaleWithDoc/alignWithMarginsflags (serde defaults, so older JSON still loads).HfPagepicks which pair a page uses.pageLayout.headerFooteracceptsdifferentFirst,differentOddEven,firstHeader,firstFooter,evenHeaderandevenFooter, pluspage: odd|even|firstfor one-section edits, and returns them.Tests
first_and_even_pages_print_their_own_headersroundtriptests)tests/page_layout_view.rs:the_first_page_edits_its_own_header_when_different_first_page_is_on,insert_header_and_footer_switches_to_page_layout_viewcargo test -p gridcraft-engine --lib -- first_and_even header every_command,cargo test -p gridcraft-xlsx roundtrip,cargo test -p gridcraft-ui-egui --test page_layout_view,cargo test -p gridcraft-ui-egui --lib i18n, clippy-D warningson model/xlsx/engine/ui-egui (lib, that test, snapshot example),cargo fmt --check. The offscreen snapshot of an edit with Different First Page was checked.Not done
&G) and Excel's Scale with Document / Align with Page Margins behaviour. The flags are kept, but layout ignores them.headerFootercodes dialog is no longer on the ribbon; the command stays available.Unverified
&P), and "first page" means each sheet's first page. I believe this matches Excel, but I haven't checked it there.🤖 Generated with Claude Code