Refactor anonymiser UI to handle latest BSA version#86
Merged
boscorat merged 1 commit intoJul 7, 2026
Merged
Conversation
Replace raw TOML text editors with intuitive form-based table inputs: **UI Changes:** - 'Never Anonymise' tab: Single-column table for excluded phrases - 'Always Anonymise' tab: Two-column table (Original Text | Replacement) - Add Row / Remove Selected buttons for both tabs - Auto-save on exit or 'Run Anonymisation' (3-retry logic with 1s delays) **Code Changes:** - New data models: NeverAnonymiseConfig, AlwaysAnonymiseConfig - TOML round-trip serialization for both configs - Simplified presenter logic (removed legacy migration code) - Removed dirty-state tracking and manual save button - Improved docstrings for clarity **Documentation:** - Rewrote 'Configuring Anonymisation' section - Removed obsolete 'Saving the config' section - Updated 'Config File Locations' to clarify two separate TOML files - Improved feature overview and workflow explanation **Testing:** - All 129 tests pass - Type check: 0 errors - Lint and format: all checks pass - TOML round-trip: verified with BSA system config files Resolves #79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the anonymisation functionality to replace raw TOML text editors with intuitive form-based table inputs, addressing the breaking changes in the latest bank_statement_anonymiser package.
Changes
UI Improvements
Code Refactoring
NeverAnonymiseConfigdata model for excluded phrasesAlwaysAnonymiseConfigdata model for forced replacements_run_anonymisation()and_on_dialog_finished()Documentation Updates
Testing
✅ All 129 tests pass
✅ Type check: 0 errors (pyrefly)
✅ Lint: All checks pass (ruff)
✅ Format: All files correctly formatted
✅ TOML round-trip: Verified with BSA system config files (155 phrases load correctly)
Files Changed
docs/screens/anonymise.md— Documentation rewritesrc/openstan/presenters/anonymise_presenter.py— Data models + presenter logicsrc/openstan/views/anonymise_dialog.py— Table-based UIArchitecture
Resolves #79