Commit graph

70 commits

Author SHA1 Message Date
phg
1c8396f020 Add comprehensive tests for filtering and import/export functionality
- Created `test_filters.py` to test the EntryFilter and FilterOptions classes, covering default values, custom values, filtering by status, DNS type, resolution status, and search functionality.
- Implemented tests for combined filters and edge cases in filtering.
- Added `test_import_export.py` to test the ImportExportService class, including exporting to hosts, JSON, and CSV formats, as well as importing from these formats.
- Included tests for handling invalid formats, missing required columns, and warnings during import.
- Updated `uv.lock` to include `pytest-asyncio` as a dependency for asynchronous testing.
2025-08-18 10:32:52 +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
bc0f8b99e8 Implement command pattern for undo/redo functionality in HostsManager
- Added command classes: ToggleEntryCommand, MoveEntryCommand, AddEntryCommand, DeleteEntryCommand, UpdateEntryCommand.
- Integrated UndoRedoHistory to manage command execution and history.
- Updated HostsManager to use command-based methods for editing entries with undo/redo support.
- Enhanced HostsManagerApp to display undo/redo status and handle undo/redo actions via keyboard shortcuts.
- Refactored navigation handler to utilize command-based methods for toggling and moving entries.
- Created comprehensive tests for command classes and integration with HostsManager.
2025-08-17 21:30:01 +02:00
phg
77d4a2e955 Enhance entry addition process: implement immediate file save after adding an entry and handle save failure by removing the entry for improved reliability. 2025-08-17 19:26:30 +02:00
phg
6171e0ca0b Refactor entry details and edit forms: enhance layout with section titles and consistent styling for improved clarity and usability. 2025-08-17 19:13:31 +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
9a9161f28c Refactor keybinding for adding entries: change key from 'a' to 'n' for improved consistency with application shortcuts. 2025-08-17 18:40:18 +02:00
phg
adc40fc16a Update project documentation: reflect completion of Phase 4 advanced edit features and adjust test coverage status for improved clarity. 2025-08-16 23:04:39 +02:00
phg
89df22f4e3 Enhance entry deletion process: ensure immediate file save after deletion and restore entry on save failure for improved reliability. 2025-08-16 22:44:47 +02:00
phg
6107b43ac5 Refactor keybindings and footer management: streamline keybinding processing and enhance footer item display with key-description pairs for improved clarity and usability. 2025-08-16 22:37:29 +02:00
phg
3f0892fb7b Refactor footer setup: enhance footer item management based on keybindings for improved usability and clarity. 2025-08-16 22:23:39 +02:00
phg
49dd015d53 Refactor keybindings: update visibility of key bindings for improved usability and consistency in the hosts manager application. 2025-08-16 21:56:46 +02:00
phg
c941a4ba24 Refactor HostsManagerApp and keybindings: update footer item arrangement for better usability and modify key bindings to hide unused keys for a cleaner interface. 2025-08-16 21:23:30 +02:00
phg
e8faa48e22 Refactor CustomFooter styles: enhance alignment and height properties for improved layout consistency across the TUI application. 2025-08-16 21:15:25 +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
502bbd87f3 Refactor hosts TUI application: remove main entry point, enhance modal styles, and unify button classes
- Deleted the main entry point file for the hosts application.
- Updated the Add Entry Modal to improve section titles and input styles.
- Refactored HostsManagerApp layout to use common pane styles for left and right sections.
- Enhanced Config, Delete Confirmation, and Help modals with consistent button labels and styles.
- Improved Password Modal layout and removed unnecessary parameters.
- Consolidated common CSS styles for buttons, inputs, and sections to ensure consistent styling across the application.
2025-08-16 16:52:53 +02:00
phg
54a2e00e29 Refactor modal CSS definitions to use centralized style constants for improved maintainability and consistency across the TUI application. 2025-08-14 20:59:15 +02:00
phg
c84c1aac2a Remove search functionality and related modal from the TUI application to streamline the user interface. 2025-08-14 20:41:12 +02:00
phg
8d884aeb65 Remove unnecessary spacer and adjust margins in the hosts manager UI for improved layout consistency. 2025-08-14 20:33:02 +02:00
phg
5b768c004b Implement search functionality with input field and filtering in the hosts manager 2025-08-14 20:27:48 +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
8b8c02c6da Improve error handling in entry edit mode and update sudo request tests for clarity and accuracy 2025-08-14 18:01:20 +02:00
phg
0041ded402 Enhance user experience with status appearance improvements and entry details consistency. Update project documentation to reflect completed features and ensure all linting checks pass. 2025-08-14 17:56:45 +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
43fa8c871a Update pane titles in HostsManagerApp for clarity and edit mode indication 2025-08-14 17:08:55 +02:00
phg
14d7553674 Add CLAUDE.md for project guidance and development instructions 2025-08-14 16:59:27 +02:00
phg
220818c8d1 Fix header height in entry details table styling 2025-08-14 16:49:11 +02:00
phg
4d025f2f76 Disable cursor and interaction for entry details table in HostsManagerApp 2025-08-14 16:49:04 +02:00
phg
48e8e1c67c Remove obsolete test scripts for DataTable details, status overlay, status positioning, status display, and status visibility 2025-07-31 10:23:40 +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
999b949f32 Update documentation to reflect successful test stabilization and upcoming user experience improvements 2025-07-31 08:48:18 +02:00
phg
cd6820179f Refactor test error handling and status updates in HostsManagerApp tests 2025-07-31 08:48:02 +02:00
phg
8346e0e362 Update project documentation to reflect test stabilization efforts and current issues 2025-07-31 08:39:14 +02:00
phg
1167521355 Refactor status handling: remove status bar widget and update to use footer subtitle for status messages 2025-07-30 16:17:01 +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
b0abec730c Refactor documentation: update active context, progress, project brief, system patterns, tech context to reflect code quality maintenance and testing improvements 2025-07-30 15:23:31 +02:00
phg
0ce58cbe68 Remove obsolete main function and associated script 2025-07-30 15:01:54 +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
5a117fb624 Add entry editing functionality with auto-save; enhance input validation and navigation 2025-07-30 10:05:05 +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
02423fe4f2 Add auto-save functionality for entry edits and movements; update status messages accordingly 2025-07-30 00:06:42 +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
cead0c1066 Add method to get first visible entry index and adjust selection logic for hidden default entries 2025-07-29 23:17:56 +02:00
phg
3e892daf98 Refactor sorting methods in HostsFile to maintain fixed order for default entries while sorting non-default entries by IP and hostname. 2025-07-29 23:12:19 +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