Repository navigation
Slicer: find a named table on any sheet - #1329
Merged
Merged
Conversation
insert.slicer and table.insertSlicer looked for the table named by `table` only on the active sheet. With another sheet active, the call failed with "Select a cell inside a table first, or pass `table`" although `table` was passed. Other table commands find a table by name in the whole workbook (Workbook::table). The named table is now found on any sheet, and the slicer goes on that table's sheet. `at` is read on that sheet, so "Sheet1!G2" names the table's own sheet. A name that matches no table gives "no table named `X`". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
insert.slicerandtable.insertSliceronly looked for the named table on the active sheet. When another sheet was open, adding a slicer to a table by name failed with "Select a cell inside a table first, or passtable", even thoughtablewas passed.Fix
tableis now found on any sheet, the same way other table commands find tables.atis checked against that sheet, so"Sheet1!G2"works.X".table, nothing changes.Tests
A new test,
slicer_finds_a_named_table_on_another_sheet, makes a table on Sheet1, opens another sheet, and adds a slicer by the table's name. It checks the slicer lands on Sheet1 and filters the table. It fails on main and passes here.cargo fmt --check,cargo clippy -p gridcraft-engine --all-targets -- -D warningsandcargo test -p gridcraft-engineall pass.Other open PRs
insert_slicer, in a different part of the function. The two PRs merge cleanly, and all the slicer tests pass with both.🤖 Generated with Claude Code