-
Notifications
You must be signed in to change notification settings - Fork 33
Dynamically turn off transfer checkboxes. #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds functionality to dynamically turn off mutually exclusive transfer checkboxes in the TUI. When certain checkboxes (like "all" or "all_datatype") are selected, other incompatible checkboxes are automatically deselected to maintain logical consistency.
Key changes:
- Introduced
TransferDatatypeCheckboxessubclass that extends the base checkbox class with mutual exclusion logic - Refactored parameter naming from
create_or_transfertotab_namefor clarity - Added comprehensive test coverage for the new dynamic on/off behavior
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
datashuttle/tui/screens/datatypes.py |
Adds TransferDatatypeCheckboxes subclass with logic to automatically turn off mutually exclusive checkboxes; renames parameter from create_or_transfer to tab_name; adds helper function get_datatype_from_checkbox_name |
datashuttle/tui/tabs/transfer.py |
Switches from DatatypeCheckboxes to TransferDatatypeCheckboxes for transfer tab checkboxes |
datashuttle/tui/tabs/create_folders.py |
Updates DatatypeCheckboxes instantiation to use renamed tab_name parameter |
tests/tests_tui/test_tui_widgets_and_defaults.py |
Removes "all" and "all_datatype" from existing test loop; adds new test test_transfer_checkboxes_dynamic_on_off to verify mutual exclusion behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| This tests that mutually exclusive checkbox options turn | ||
| each other off / on when set. This is necessary for transfer | ||
| tab custom datatypes in which some checkboxes (e.g. "all") | ||
| should not be selected with other (e.g. "behav"). |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra space in "should not be selected with other" - should be a single space.
| should not be selected with other (e.g. "behav"). | |
| should not be selected with other (e.g. "behav"). |
| super().__init__(interface, "transfer", id) | ||
|
|
||
| @on(Checkbox.Changed) | ||
| def on_checkbox_changed(self, event: Checkbox.Changed) -> None: |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method requires 2 positional arguments, whereas overridden DatatypeCheckboxes.on_checkbox_changed requires 1.
No description provided.