Skip to content

Fix filling empty cells#132

Open
akirak wants to merge 1 commit intojsonkenl:masterfrom
akirak:fix-empty-cells
Open

Fix filling empty cells#132
akirak wants to merge 1 commit intojsonkenl:masterfrom
akirak:fix-empty-cells

Conversation

@akirak
Copy link

@akirak akirak commented Nov 29, 2024

There are situations where the first non-empty cell on a row is like AA1, which has not been handled previously. This PR fixes that.

There is currently no test case for this. Can I modify the test data to add a test case for this PR?

@jsonkenl
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4782ceef45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

empty_cells =
cond do
is_nil(previous) && String.first(ref) != "A" ->
is_nil(previous) && Regex.match?(~r/^A\d/, ref) ->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix first-cell predicate for leading empty-cell fill

The new guard in fill_nil/1 now calls fill_empty_cells/4 only when the first reference matches A\d, which is the opposite of what this branch needs. For rows whose first populated cell is B1, C1, or AA1, previous is nil and this condition is false, so no leading nil cells are inserted and row values shift left in get_list/1/get_mda/1. This both fails to fix the AA1 case and regresses previously working non-A columns.

Useful? React with 👍 / 👎.

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.

2 participants