Repository navigation
Conversation
view.freezePanes, home.rowHeight, home.columnWidth, the AutoFit, Hide and Unhide row/column commands and home.defaultWidth always changed the active sheet: a `sheet` parameter was silently ignored, so a programmatic caller laying out a sheet that isn't active changed the wrong one, and `Sheet!` prefixes on `rows`/`cols` were refused as "not a range". They now take `sheet` (name or index) like the commands that already use target_sheet, accept a `Sheet!` prefix on `rows`/`cols` (and on Freeze Panes' `cell`, which was refused), and refuse a prefix that contradicts `sheet`. The selection belongs to the active sheet, so another sheet needs explicit lines or a cell. Freeze Top Row, Freeze First Column and Unfreeze Panes take `sheet` too. Without `sheet`, nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`{"sheet": null, "cols": "Data!B:B"}` was refused as naming a sheet other than `sheet`,
while `target_sheet` and the cell parameters read a null `sheet` as absent. The prefix now
decides, as it does when `sheet` is left out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
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.
view.freezePanes,home.rowHeight,home.columnWidthand the other row and column commands always changed the active sheet. Asheetparameter was accepted and silently ignored, so a programmatic caller (MCP, control channel, CLI) laying out a sheet that isn't active got a success while the frozen panes, widths or heights landed on the active sheet, over what it had set there before. Found while building a four-sheet review workbook through MCP: the panes and column widths meant for two other sheets ended up on the first one.Repro on
main(fc45b7f),gridcraft-cli mcp, afterhome.insertSheet {name: "Data"}andsheet.activate {sheet: "Sheet1"}:mainview.freezePanes {sheet: "Data", cell: "A2"}{"freeze":[1,0]}, applied to Sheet1home.columnWidth {sheet: "Data", cols: "A:A", chars: 30}home.rowHeight {sheet: "Data", rows: "1:1", height: 40}home.columnWidth {cols: "Data!B:B", chars: 30}invalid parameters for cols: not a range: Data!B:Bview.freezePanes {cell: "Data!A2"}Data!A2 for cell names a sheet other than the one this command works onSaved file on
main:sheet1.xmlhas the<col>and<row ht>,sheet2.xml(Data) has no pane, no<cols>, no row height. On the branch it's the other way round.What changed
format.rs:line_targetsnow returns the sheet with the lines. The sheet issheet(name or index, throughtarget_sheetlikehome.insertRowsordata.validation), else aSheet!prefix onrows/cols("Data!B:B,D:F", same convention asrangeintarget_ranges), else the active sheet. A prefix that contradictssheetis an error; a nullsheetcounts as absent, as intarget_sheet(second commit).home.rowHeight,home.columnWidth,home.autofitRowHeight,home.autofitColumnWidth,home.hideRows/hideColumns/unhideRows/unhideColumnsuse it;home.defaultWidthusestarget_sheet.view.rs:view.freezePanesresolves its sheet the same way, sosheetworks and acellprefixed with another sheet freezes that sheet instead of being refused.view.freezeTopRow,view.freezeFirstColumnandview.unfreezePanestakesheet.rows/cols(orcellfor Freeze Panes) and say so (missing cols: the selection is on the active sheet) rather than reusing the active sheet's selection.sheetor a prefix nothing changes, so the UI (header drags, dialogs, context menus) behaves as before.paramstexts listsheet?and the prefixed form. The Freeze Panes one also says that withoutcellit unfreezes a frozen sheet, since a misspeltcellkey otherwise removes the panes without a word.Verification (Linux x86_64)
cargo test -p gridcraft-engine --lib tests::line_sizes_and_freeze_panes_take_a_sheet: with Sheet1 active, freezes, sizes, hides and sets the default width on Data throughsheet(by name and by index) and through prefixes, checks Data and that Sheet1 is unchanged, then a nullsheetwith a prefix and the error cases. Onmainit fails athome.columnWidth {cols: "Data!B:B,D:D"}(not a range); with that line removed it fails at the first check,data.freezeleft: None,right: Some((1, 0)). Passes here.gridcraft-mcp:tests::other_sheet_prefix_is_errorno longer expects Freeze Panes to refuseOther!B2, and keeps the "never silently fall back to the active sheet" check withformulas.tracePrecedents;tests::cross_sheet_cell_refs_resolvenow checks thatOther!C4freezes that sheet and leaves the active one alone (read back withinspect_workbook).cargo fmt --all -- --check,cargo clippy -p gridcraft-engine -p gridcraft-mcp --all-targets -- -D warnings,cargo test -p gridcraft-engine -p gridcraft-mcpLimits
sheet: the View › Show flags, grouping and outline, page breaks and Page Layout settings (margins, orientation, print area, print titles). Same fix if you'd like it here, or a follow-up. A dispatcher-level answer (reject unknown parameter keys by comparing with theparamstext, so{"cel": "A2"}fails instead of unfreezing) is a bigger design question I left out.data.validationwith an unknowntype("lst") succeeded and savedtype="none"; fixed separately in Data validation: a list typed without quotes is saved as a quoted list, and an unknown type is refused #1084.home.rowHeight/home.columnWidth) edits the same twoparamstexts, so the second one to land needs a small rebase.git merge-treeagainst the open PRs touching these files (MCP: confine file access with --automation-read-root and --automation-write-root (#445) #480, MCP: reject invalid format_range borders as invalid params (#560) #603, cell.set / set_cell: accept a number forinput(#697) #720, Security: the --control server requires an auth token and closes bad connections (#777) #783, fix(security): restrict cell hyperlink schemes and require a control-channel token #834, XLSX: write this-row structured references as [[#This Row],[Col]] #869, Conditional formatting: reuse Format Cells controls for custom rule styles #870, Hyperlinks: confirm before opening external links, refuse unsafe schemes #880) is clean.