New Tab
Scaffold a complete feature tab with all required files and wiring.
Arguments
name(required): Tab name in lowercase (e.g., "firewall", "bluetooth")
Steps
Create utils module:
loofi-fedora-tweaks/utils/{name}.py- Class named
{Name}Managerwith@staticmethodmethods - Return
Tuple[str, List[str], str]command tuples - Use
SystemManager.get_package_manager()for dnf/rpm-ostree branching - Use
PrivilegedCommandfor privileged ops - Module-level docstring, Google-style
- Class named
Create UI tab:
loofi-fedora-tweaks/ui/{name}_tab.py- Class named
{Name}TabinheritingBaseTab - Use
self.run_command()to execute utils methods - No
subprocess, no business logic - Module-level docstring
- Class named
Register in MainWindow: Add lazy loader in
loofi-fedora-tweaks/ui/main_window.py"{name}": lambda: __import__("ui.{name}_tab", fromlist=["{Name}Tab"]).{Name}Tab(),Create test file:
tests/test_{name}.py- Test class
Test{Name}Manager @patchdecorators only (never context managers)- Test both success and failure paths
- Test both dnf and rpm-ostree paths if applicable
- Mock at
utils.{name}.subprocess.run
- Test class
Run verification:
just lint && just typecheck && just test-file test_{name}
Rules
- Follow all critical rules from CLAUDE.md (no sudo, no shell=True, always timeout)
- Use
from utils.log import get_loggerfor logging with%sformatting - Type hints on all public methods
Converted and distributed by TomeVault — claim your Tome and manage your conversions.