Repository navigation
fix(sheet): stop reordering sheets a partial write never touched - #1235
Open
Sean-Walker0 wants to merge 1 commit into
Open
Sean-Walker0 wants to merge 1 commit into
Sean-Walker0 wants to merge 1 commit into
Conversation
Sean-Walker0
force-pushed
the
fix/template-subset-sheet-order
branch
2 times, most recently
from
October 29, 2026 22:52
cfa69e7 to
3c6f52d
Compare
Sean-Walker0
force-pushed
the
fix/template-subset-sheet-order
branch
4 times, most recently
from
November 11, 2026 11:29
6c39113 to
7463ba5
Compare
WriteSheetWorkbookWriteHandler sorts every initialized sheet of the write by sheet number, regardless of how many sheets the workbook has. Filling a single sheet of a multi-sheet template therefore moved the written sheet ahead of sheets this write never touched: a template with tabs [T0, T1], filling only T1, produced [T1, T0]. Reorder only when the write initialized every sheet of the workbook, which keeps the by-sheet-number sorting for multi-sheet writes while leaving untouched template sheets in the author's order. Verified with WriteSheetOrderTest (the subset-fill case reorders to [T1, T0] before the change and keeps [T0, T1] after; the write-all case pins the sorting behavior on both sides) plus the full fesod-sheet suite (1120 tests) and spotless:check.
Sean-Walker0
force-pushed
the
fix/template-subset-sheet-order
branch
from
November 23, 2026 07:40
7463ba5 to
056407e
Compare
This branch has not been deployed
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.
Purpose of the pull request
WriteSheetWorkbookWriteHandlersorts every sheet this write initialized by sheet number — regardless of how many sheets the workbook actually has. Filling a single sheet of a multi-sheet template therefore moved the written sheet ahead of sheets this write never touched:A template author's tab order is silently changed by a subset fill (the standard
withTemplate(...).sheet("T1").doFill(...)flow), and the same applies to any partial write. Probed end-to-end on current main before this change.No issue exists for this yet; found while auditing the write handler chain.
What's changed?
The handler now reorders only when this write initialized every sheet of the workbook. Multi-sheet writes keep their by-sheet-number sorting (the feature's purpose, introduced for writing sheets out of order); partial writes leave sheets they never touched in the author's order.
Checklist
Verifying this change
WriteSheetOrderTest(both directions):fillingASingleTemplateSheetKeepsTheTemplateTabOrder— red before (expected: <[T0, T1]> but was: <[T1, T0]>), green after;writingEverySheetStillSortsBySheetNo— writes sheetNo 1 first, then 0, and pins that the full-write sorting still applies; green before and after../mvnw clean package -B -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet: 1120 tests, 0 failures, 0 errors../mvnw -pl fesod-sheet spotless:check: clean.Notes
WriteSheetWorkbookWriteHandler.