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 currentfilenamestate rather thanoriginalFileName. - Include
filenamein the parsing effect dependency list. - Change
onNewFileto update the selected filename and let the effect perform the parse. - Preserve the expected
lastParseRefandpreserveImportSettingsbehavior. - 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
- PR: https://github.com/actualbudget/actual/pull/8924
- Review comment: https://github.com/actualbudget/actual/pull/8924#discussion_r3996322191
- Requested by: @flafleur
Source: actualbudget/actual