#8929·actual

Fix selected-file reparse behavior in import modal

Author: coderabbitai[bot]Created Sep 12, 2026Updated Sep 12, 2026

Summary

After a user selects another import file, changing a CSV parse option can re-parse the original file instead of the selected file.

Required changes

Update the import modal parse flow to use the current selected filename for option-driven re-parses.

  • In packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx, make the parsing effect use the current filename state rather than originalFileName.
  • Include filename in the parsing effect dependency list.
  • Change onNewFile to update the selected filename and let the effect perform the parse.
  • Preserve the expected lastParseRef and preserveImportSettings behavior.
  • Ensure selecting a new file does not cause duplicate parsing.

Rationale

The encoding selector follows the existing option-driven parsing pattern. The same selected-file issue also affects delimiter, header-row, and skip-line changes. This follow-up keeps the CSV encoding PR scoped to encoding support.

Affected area

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx

Acceptance criteria

  • After selecting another file, changing csvEncoding, delimiter, header-row, or skip-line options parses the selected file.
  • Selecting another file performs one parse.
  • Existing import-settings preservation behavior remains correct.

References