Commit graph

13 commits

Author SHA1 Message Date
phg
4dbf200c5f Add TUI components for hosts management
- Implement DetailsHandler for managing entry details display and edit forms.
- Create EditHandler to handle edit mode operations, including validation and saving of entry changes.
- Introduce NavigationHandler for entry movement and action operations.
- Define key bindings for various application actions in keybindings.py.
- Add TableHandler for managing the data table, including sorting and filtering of entries.
- Establish CSS styles for consistent theming across the application.
- Update tests to reflect changes in module structure and ensure proper functionality.
2025-07-30 16:08:25 +02:00
phg
8b1c01c894 Refactor test imports: remove unused imports across configuration and modal test files 2025-07-30 15:26:39 +02:00
phg
1dd54b0cb5 Refine modal focus handling: update tab navigation logic and simplify focus setting in SaveConfirmationModal tests 2025-07-30 14:58:43 +02:00
phg
77d8e647f2 Enhance save confirmation modal: adjust button focus behavior and update tests for new functionality 2025-07-30 14:38:39 +02:00
phg
f7671db43e Add save confirmation modal and integrate with entry editing
- Implemented SaveConfirmationModal to prompt users for saving changes when exiting edit mode.
- Integrated modal into HostsManagerApp to handle unsaved changes.
- Added methods to validate and save entry changes, restoring original values if discarded.
- Created unit tests for SaveConfirmationModal and its integration with the main application.
- Refactored entry editing logic to track changes and confirm before exiting edit mode.
2025-07-30 13:36:25 +02:00
phg
d477328bea Enhance status messages and layout in HostsManagerApp; improve error handling and testing for status updates 2025-07-30 00:18:48 +02:00
phg
0ee720c5ef Add management header to hosts files and enhance serialization formatting; update tests to reflect changes. 2025-07-30 00:00:53 +02:00
phg
5a2e0d2623 Enhance hosts file serialization and entry formatting for proper tab alignment; update tests to reflect changes. 2025-07-29 23:31:30 +02:00
phg
3084650c27 Enhance HostsManager to prevent modification and movement of default system entries; add is_default_entry method to HostEntry and update sorting methods to prioritize default entries. 2025-07-29 23:04:29 +02:00
phg
1b57be2cbf Implement HostsManager for managing hosts file edits with permission handling
- Added PermissionManager class for managing sudo permissions.
- Introduced HostsManager class for high-level operations on hosts file.
- Implemented methods for entering/exiting edit mode, toggling entries, moving entries, updating entries, saving the hosts file, and restoring backups.
- Integrated permission validation and backup creation during edit operations.
- Enhanced main application to support edit mode and associated actions.
- Added tests for PermissionManager and HostsManager to ensure functionality and error handling.
2025-07-29 22:43:01 +02:00
phg
0051932014 Add comprehensive tests for configuration management and main TUI components 2025-07-29 21:14:29 +02:00
phg
c57267213f Remove compiled Python cache files from the repository 2025-07-29 15:07:01 +02:00
phg
2decad8047 Add unit tests for HostEntry and HostsFile models, and implement HostsParser tests
- Created comprehensive unit tests for HostEntry class, covering creation, validation, and conversion to/from hosts file lines.
- Developed unit tests for HostsFile class, including entry management, sorting, and retrieval of active/inactive entries.
- Implemented tests for HostsParser class, validating parsing and serialization of hosts files, handling comments, and file operations.
- Ensured coverage for edge cases such as empty files, invalid entries, and file permission checks.
2025-07-29 14:52:31 +02:00