Skip to content

A table's Refresh keeps your choices when you go Back and Next - #664

Merged
MerciHanrim merged 1 commit into
mainfrom
refresh-wizard-keep-choices
Nov 24, 2026
Merged

MerciHanrim merged 1 commit into
mainfrom
refresh-wizard-keep-choices

Conversation

@MerciHanrim

Copy link
Copy Markdown
Owner

Part of #615 (follow-up: the refresh wizard's Back → Next reset).

What was wrong

In Manage bindings ▸ Refresh…, Back and Next cleared what had been chosen even when nothing had changed (measured on main 4e5ec440):

  • Column changes: every Next from Paste cleared a missing column's rename, a new column's role and the Map more columns disclosure (goToEventsOrReview).
  • Review: every Next that built the plan cleared Add this row and a missing row's Keep as-is or Delete (runValidateAndDiff): Review → Back → Next, and on a refresh with no column change Back → Paste → Next.
  • Review → Back kept the Column changes choices. The header row field was not the cause.
  • A commit after an unnoticed reset follows the defaults, not what was chosen (code read).

The change (Lumi's rule)

DataImportRefreshWizard remembers the input each set of choices was made for:

  • Column changes are kept, with Map more open, while the stored table's columns and the incoming header row are cell for cell the same. The choices point at incoming columns by position, so another header row resets them, as before.
  • Review choices are kept while the plan's whole input is the same as when they were made: the parsed rows, the header row number, Ignore last N rows and the column pairings. A change to any of them resets them, as before.

The first import wizard and any new message are out of this scope. docs/data-import.md gains a short section with the rule.

Tests

New describe in e2e/data-import-refresh.spec.ts, a paste where weight is renamed to mass, cost is new, itm_b is missing and itm_c is added:

  1. Column changes: Back → Next with nothing edited keeps weight → mass, cost → Number and Map more open.
  2. Review: Back → Next, and Back, Back, Next, Next, keep Add itm_c and Keep as-is (unlink) for itm_b; Commit refresh then adds itm_c, keeps itm_b unlinked, applies the rename (99 on Ember Blade) and the new cost column.
  3. Review with no column change: Back → Paste → Next keeps the choices.
  4. Control: another column order resets the Column changes choices.
  5. Control: a changed data row, then Ignore last N rows, then a column pairing (cost as a label) each reset the Review choices, while the Column changes choices stay (same header row).

On main's wizard, tests 1–3 fail at their first kept-choice check and test 4 passes. Test 5 also fails on main, at its first check that the Column changes choices stay after a data-row edit, which is new behaviour; its reset checks are reached only on this branch.

On this branch, chromium, --workers=1 --retries=0:

  • e2e/data-import-refresh.spec.ts: 18 passed.
  • e2e/data-import-refresh-errors.spec.ts, e2e/error-paths-423.spec.ts, e2e/import-row-fields.spec.ts, e2e/rtl-bidi-isolation.spec.ts: 36 passed.

Every check:* script, tsc -b, lint (88 warnings, the baseline, none in the wizard) and vitest run (5758 passed) pass.

The refresh wizard cleared its Column changes choices on every Next from Paste, and its Review choices on every Next that built the plan, even when nothing had changed. Column changes are now kept while the stored columns and the incoming header row are cell for cell the same (they point at incoming columns by position), Map more columns staying open with them. Review choices are kept while the plan's whole input is the same: the parsed rows, the header row number, Ignore last N rows and the column pairings. A change to any of these still resets them.

Part of #615
@MerciHanrim MerciHanrim added the bug Something isn't working label Nov 24, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying cozy-loop-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: a511342
Status: ✅  Deploy successful!
Preview URL: https://68de71aa.cozy-loop-studio.pages.dev
Branch Preview URL: https://refresh-wizard-keep-choices.cozy-loop-studio.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant