Skip to content

Charts: insert.chart builds series from every area of a multi-area range (#1638) - #3

Draft
isaac-levine wants to merge 422 commits into
mainfrom
charts-multi-area
Draft

isaac-levine wants to merge 422 commits into
mainfrom
charts-multi-area

Conversation

@isaac-levine

Copy link
Copy Markdown
Owner

insert.chart with a range like A1:A5,E1:E5 only used the first area. build_chart goes through block(), which calls target_range(), and that keeps just the first parsed area. The command returned success but the pie came out empty.

Now build_chart reads every area. Areas must have the same height, otherwise the command returns an error instead of quietly plotting the first one. If the first area is a single text column, it becomes the categories and each later area supplies series, which is the Excel rule from the issue. Otherwise each area adds its own series. A Ctrl-selected multi-area selection with no range param takes the same path. Single-area behaviour is unchanged. New test: chart_from_multi_area_range_uses_every_area (the exact repro from the issue, plus the unequal-height error).

Commands run:

  • cargo fmt --all -- --check: ok
  • cargo clippy -p gridcraft-engine --all-targets -- -D warnings: clean
  • cargo test -p gridcraft-engine: all pass (287 unit tests plus integration tests)
  • cargo xtask layers: ok. cargo xtask wasm: ok

Not run: the full cargo xtask ci, and I did not look at the chart in the UI. insert.recommendedCharts shares build_chart, but the other commands the issue says may drop areas via target_range are not touched here.

Upstream issue: storytold#1638


Generated by Claude Code

nihilist-narwhal and others added 30 commits October 12, 2026 19:52
A growth series with a step below 1 stopped at once when given a stop
value, since the stop was only checked for rising series. It now bounds
the series in the direction it runs.
A formula such as =A1+A2+…+A500 nests one level per operator, and the
evaluator recursed once per level, so past its depth limit (about 400
operators) the result was #CALC!. Excel allows such formulas up to its
8,192-character limit. Chains of arithmetic, comparison and & operators
are now folded in a loop.
home.manageRules took the number of rules once, before deleting, so
{"delete":0,"moveUp":1} with two rules swapped past the end of the
shortened list and panicked (index out of bounds; the session's guard
kept the workbook). The count is now taken after each step.
Merge & Center and Merge Cells kept only the upper-left value, but
Merge Across left the other values of each row in place, hidden under
the merge and still counted: with 1 2 / 3 4 in A1:B2, SUM(A1:B2) stayed
10 after Merge Across, where Excel gives 4. Each row's merged area now
keeps only its first value, as the other merges do.
 storytold#864)

[@col] is only Excel's display shorthand. Written verbatim into cell formulas and calculatedColumnFormula, it made Excel repair the file and drop the tables.
…part

Business Central's "Open in Excel" exports write booleans as
<c><f>TRUE()</f><v>1</v></c> with no t="b", so the cached value reads back
as the number 1 and the calc oracle reported every such cell as a
`number → bool` mismatch. A cached 1 or 0 now matches GridCraft's TRUE or
FALSE, and the cells are counted apart (`boolAsNumber` in --json, a note in
the text report) so a real number/logical disagreement stays visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
echelon and others added 30 commits October 13, 2026 01:16
# Conflicts:
#	crates/ui-egui/src/dialogs.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/ui-parity.md
# Conflicts:
#	crates/ui-egui/tests/interaction.rs
# Conflicts:
#	crates/xlsx/src/tests/passthrough_tests.rs
Brings the branch up to upstream's main (59 more commits). One conflict:

- docs/ui-parity.md: every line of both sides is kept, as upstream's own
  merges keep them, in the order of their dates, newest first (upstream
  has a change of the 13th now, which goes above this one of the 12th).

Gate: all eight steps, 1580 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	ROADMAP.md
#	docs/gaps.md
#	docs/target-app-parity.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: skylartaylor <26588250+skylartaylor@users.noreply.github.com>
…ver crash) (storytold#1330)

A hostile file could abort any process that opens it: a cell formula of a
million `%` (`1%%%…`) or a 200,000-term sum parsed into trees deep enough to
overflow the stack when printed, saved, evaluated or dropped, even in release
builds. Postfix operators (`%`, invoking a result) built their nesting in a
loop that the 256-level limit did not see.

- `parse` refuses formula text longer than Excel's 8,192 characters
  (`MAX_FORMULA_LEN`, counted in characters, the leading `=` excluded). This
  also bounds the depth of the left-deep trees long operator chains build.
- Each postfix `%` and each call of a result counts towards the nesting limit.
- A file's formula that is refused keeps its text and cached value, as other
  unparsable formulas do.

Regression tests: formula (small-stack thread: long `%`, invoke and operator
chains are errors; the limit counts characters, not bytes) and xlsx
(`hostile_formula_text_does_not_overflow_the_stack`: open, save and drop a
workbook with such formulas and a defined name on a 1 MiB stack). Both abort
with a stack overflow without the fix.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nter-applies

AutoFilter: Enter in the filter menu applies the filter and closes it
…-workflow

ci: delegate FreeBSD workflow, add nix check, and remove flatpak-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants