Skip to content

Fill Series: the autofill type continues the seed pattern (#3951) - #4116

Open
jayzed80 wants to merge 1 commit into
storytold:mainfrom
jayzed80:fix/fill-series-autofill-3951
Open

jayzed80 wants to merge 1 commit into
storytold:mainfrom
jayzed80:fix/fill-series-autofill-3951

Conversation

@jayzed80

Copy link
Copy Markdown

Fixes #3951

Root cause

fill::series (crates/engine/src/fill.rs, pub fn series) only branched on growth and date. type: "autofill" fell into the default v + step arm, so it behaved as a linear series with step 1 and overwrote the second seed (2, 4 became 2, 3, 4, 5, 6, 7).

Fix

In series, type: "autofill" now takes the filled cells at the start of each lane as the seed and calls the existing fill(..., FillMode::Series) over the lane, so it extends exactly as a fill-handle drag does (2, 4 gives 6, 8, 10, 12). A lane that is empty or entirely filled is left alone. Other types are unchanged.

Tests

New tests::fill_series_autofill_continues_the_seed_pattern (issue repro plus a text seed and undo).

Without the fix:

test tests::fill_series_autofill_continues_the_seed_pattern ... FAILED
  left: [Number(2.0), Number(3.0), Number(4.0), Number(5.0), Number(6.0), Number(7.0)]
 right: [Number(2.0), Number(4.0), Number(6.0), Number(8.0), Number(10.0), Number(12.0)]

With the fix: test tests::fill_series_autofill_continues_the_seed_pattern ... ok.

Checks run

  • cargo fmt -p gridcraft-engine -- --check: clean
  • cargo clippy -p gridcraft-engine --all-targets -j 4 -- -D warnings: clean
  • cargo test -p gridcraft-engine -j 4: 959 + 120 + 7 passed, 0 failed

Not run

cargo xtask ci (layers, wasm, assets), other crates, and a comparison against real Excel. A single-cell seed copies the value (as a drag does); I did not check this against Excel.

…#3951)

edit.fillSeries with type autofill fell through to the step-one addition path and overwrote the seed. It now takes the filled cells at the start of each lane as the seed and extends them as a drag of the fill handle does (2, 4 gives 6, 8, 10, 12).
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c0ee120 and bc69f76.

Files selected for processing: 2

  • crates/engine/src/fill.rs
  • crates/engine/src/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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.

Fill Series autofill mode ignores the seed pattern and overwrites it with step-one values

1 participant