Commit graph

50 commits

Author SHA1 Message Date
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
phg
8c1cd2047e Update DataTable cursor position handling when moving entries 2025-07-29 22:55:38 +02:00
phg
82bfed7ce4 Update activeContext and progress documentation for Phase 3 completion; adjust entry reordering keyboard shortcuts in main.py 2025-07-29 22:51:45 +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
fa7e7718c9 Update project documentation to reflect Phase 2 completion and enhanced features, including configuration management, advanced sorting, and improved visual design. 2025-07-29 21:27:35 +02:00
phg
0051932014 Add comprehensive tests for configuration management and main TUI components 2025-07-29 21:14:29 +02:00
phg
79069bc2ea Implement configuration management with modal for application settings 2025-07-29 17:25:55 +02:00
phg
a399b04c99 Add 'Active' column to DataTable with visual indicators for entry status 2025-07-29 17:13:22 +02:00
phg
e83db8ce67 Enhance styling of active and inactive entries in DataTable for better visibility 2025-07-29 17:11:47 +02:00
phg
9cd2b5c3fe Enhance DataTable row styling by using Rich Text for active and inactive entries 2025-07-29 17:06:29 +02:00
phg
bcded3105b Enhance DataTable population by adding sort indicators to column headers and clearing both rows and columns before repopulating 2025-07-29 17:03:18 +02:00
phg
15a3b6230f Refactor left pane to use DataTable for entries display and add sorting functionality by IP and hostname 2025-07-29 16:57:41 +02:00
phg
407e37fffd Refactor layout of left and right panes to use rounded borders and improve structure 2025-07-29 16:37:38 +02:00
phg
d684583cb9 Update dependencies to latest versions: textual 5.0.1 and pytest 8.4.1 2025-07-29 16:07:50 +02:00
phg
a4ffaebb2a Update project documentation to reflect Phase 1 completion and outline Phase 2 priorities 2025-07-29 15:52:30 +02:00
phg
fdf64d8da3 Add .gitignore file to exclude unnecessary files and directories 2025-07-29 15:09:57 +02:00
phg
69ee221a63 Add handler for entry highlighting in the left pane 2025-07-29 15:09:54 +02:00
phg
b8e4b29f04 Remove compiled Python cache files from the repository 2025-07-29 15:09:33 +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
phg
40a1e67949 initial commit 2025-07-29 13:50:55 +02:00