Commit graph

16 commits

Author SHA1 Message Date
phg
9b2288dfa6 Restrict DNS resolution actions to edit mode: prevent DNS resolution in read-only mode and provide user feedback. 2025-08-18 14:20:20 +02:00
phg
90935e67a6 Implement radio set for entry type selection in edit mode: add IP and DNS options, manage field visibility, and enhance form population logic. 2025-08-18 13:43:16 +02:00
phg
e6f3e9f3d4 Refactor tests for HostsManagerApp: update status verification to use footer instead of subtitle for improved accuracy and clarity. 2025-08-17 21:37:06 +02:00
phg
de5acd4dad Refactor entry details display: replace DataTable with disabled input widgets for improved clarity and user experience. 2025-08-17 18:45:54 +02:00
phg
8d3d1e7c11 Refactor hosts TUI application: replace Footer with CustomFooter, implement footer setup and status updates, and enhance styling for improved user experience 2025-08-16 20:58:41 +02:00
phg
50628d78b7 Refactor hosts TUI application: remove HelpModal, update help action, and clean up related code 2025-08-16 17:57:35 +02:00
phg
07e7e4f70f Add entry and delete entry functionality with modals in TUI application
- Implemented add_entry method in HostsManager for adding new entries.
- Created AddEntryModal for user input when adding entries.
- Implemented delete_entry method in HostsManager for removing entries.
- Created DeleteConfirmationModal for user confirmation before deletion.
- Integrated modals into HostsManagerApp for adding and deleting entries.
- Added search functionality with SearchModal for finding entries by hostname or IP address.
- Updated keybindings to include shortcuts for adding and deleting entries.
- Added HelpModal to provide keyboard shortcuts and usage information.
2025-08-14 19:47:09 +02:00
phg
1fddff91c8 Refactor tests for PermissionManager, HostsManager, HostEntry, HostsFile, and HostsParser
- Updated test cases in test_manager.py to improve readability and consistency.
- Simplified assertions and mock setups in tests for PermissionManager.
- Enhanced test coverage for HostsManager, including edit mode and entry manipulation tests.
- Improved test structure in test_models.py for HostEntry and HostsFile, ensuring clarity in test cases.
- Refined test cases in test_parser.py for better organization and readability.
- Adjusted test_save_confirmation_modal.py to maintain consistency in mocking and assertions.
2025-08-14 17:32:02 +02:00
phg
25001042e5 Enhance status display and entry details in HostsManagerApp
- Updated header title to "/etc/hosts Manager" and modified subtitle format.
- Implemented a dedicated overlay status bar for error messages, ensuring no layout shifts.
- Refactored entry details display to use DataTable with labeled rows for improved consistency.
- Added CSS styles for the new status bar and DataTable.
- Created tests for status bar visibility and DataTable functionality, ensuring all tests pass.
2025-07-31 09:47:09 +02:00
phg
cd6820179f Refactor test error handling and status updates in HostsManagerApp tests 2025-07-31 08:48:02 +02:00
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
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
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