Repository navigation
View: Page Layout view with rulers and in-place headers and footers (#329) - #334
Merged
Merged
Conversation
…torytold#329) View › Page Layout (and the status-bar button) now shows the sheet as printed pages on a desk instead of overlaying page outlines on the grid. - Model/XLSX: per-sheet view mode (normal / pageLayout / pageBreakPreview), saved as <sheetView view="…"> and read back. view.* commands set it per sheet ({sheet?}) without an undo step or dirtying a clean workbook. - Engine: paper::PageGrid paginates the sheet from A1 with the print pagination (print::split_bands, shared with PDF export and printing) and maps cells to pages and back; header/footer section helpers (split/join, &[Page] field names) shared with the PDF header code. pageLayout.headerFooter takes {part, section, text} for one section and a sheet; header/footer strings are capped at 255 characters. view.ruler toggles the rulers. - UI: Geo carries the page grid, so painting, hit-testing, selection, editing, objects and scrolling work through the page transform; frozen panes are ignored in this view. Pages with margins and gaps, "Click to add data" pages, rulers in inches (English) or centimetres, headers/footers drawn on printed pages, click a margin section to edit it in place; a click elsewhere commits (one undo step), Escape cancels. Header & Footer contextual tab: presets, Page Number, Number of Pages, Current Date/Time, File Path, File Name, Sheet Name, Go to Header/Footer. View › Ruler. - New strings in every catalog; new code-drawn icons; desk colour token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…torytold#266), frozen-pane clipping (storytold#217), right-to-left mirroring and freeze handles (storytold#310, storytold#309); es/de/cs strings for headers and footers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Merged — thank you for the contribution! (I merged main into your branch: pages now keep the gliding selection from #266, frozen-pane clipping from #217, and right-to-left mirroring and freeze handles from #310/#309; I also added Spanish/German/Czech strings for the header/footer UI.) If you haven't already, come join us on the ArtCraft Discord: https://discord.gg/artcraft |
This was referenced Oct 11, 2026
This was referenced Nov 18, 2026
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 #329
What
view.pageLayoutused to overlay the Page Break Preview outlines on the normal grid. It now shows the sheet as printed pages, as Excel's Page Layout view does:normal/pageLayout/pageBreakPreview) in the model. It's saved as<sheetView view="…">in XLSX and read back.view.normal,view.pageLayoutandview.pageBreakPreviewtake{sheet?}. They don't record an undo step and don't mark a clean workbook as changed, the same as zoom. TheSession::view_modestring is gone; the status-bar buttons read the active sheet's view.engine::paper::PageGridruns the print pagination (print::split_bands, whichlayout_sheetnow uses too) over the sheet from A1. It goes as far right and down as the view needs, and it maps cells to page positions and back (cell ↔ layout point, page/margin/gap hit tests, header/footer zones, printed page numbers).Geocarries the page grid, so painting, hit-testing, selection, the in-cell editor, objects, fill handle, resizing and scrolling all go through the page transform:view.ruler, an app option) turns them off.expand_header_footeras PDF export.&[Page],&[Pages],&[Date],&[Time],&[Path],&[File],&[Tab].pageLayout.headerFooteras one undo step. Escape cancels.pageLayout.headerFooteralso takes{sheet?, part: header|footer, section: left|center|right, text}(field names or codes) so agents can set one section. Header and footer strings are capped at 255 characters.print::split_header_footer,join_header_footer,codes_to_fields,fields_to_codesandhf_date_time.desktheme token, and the new strings in every catalog (ja, zh, ko, ru, pt).Tests
engine::paper::tests(3):cmd::print::tests::header_sections_split_join_and_field_names: split/join/field round trip, dangling&, expansion and hostile strings.cmd::print::tests::header_footer_section_edits_are_undoable_and_views_are_per_sheet: section edits, undo, bad params, the 255 cap, the per-sheet view, clean workbook stays clean,view.ruler.xlsxround trip:sheetView view="pageLayout"is written and read back.crates/ui-egui/tests/page_layout_view.rs):&[Page], then clicking a cell, commits&LLeft&CReport &Pand selects the cellCommands run (touched crates only):
I didn't run the full
cargo xtask ci; CI covers it.Not done
&Gshows as&[Picture]but isn't drawn), Different First Page, Different Odd & Even Pages, Scale with Document and Align with Page Margins options.zoomScalePageLayoutView).Unverified assumptions (need confirmation in Excel)
🤖 Generated with Claude Code