# Mageia Linux Control Center — Project Plan ## Goals Build a Mageia-focused control center with: - A GUI using QML and PySide6 - A compact TUI using Textual - Shared core logic, plugin metadata, and system-operation interfaces - Package-managed plugin discovery without scanning directories - Narrowly authorized system changes through D-Bus and PolicyKit - Localization, RTL support, accessibility, and an ASCII-safe TUI mode ## Architecture ### Shared core Provide common interfaces for: - Plugin metadata and registry - Navigation state - Localization - Authorization client - System-operation client - Validation and error reporting Keep frontend views separate: share business logic and APIs, not QML and Textual widgets. ### GUI Use QML for presentation and PySide6 for application logic. The main window should have: - A persistent header with back navigation and page title - A resizable left category panel and right content panel - A landing view organized as Category → Subcategory → Plugin - Plugin content that fills the right panel while the header and category panel remain - Light and dark palettes, keyboard navigation, visible focus, and accessible labels - Layouts that use logical leading/trailing alignment for RTL ### TUI Use Textual in a bounded, panel-style interface rather than assuming it can take over the entire terminal. Include category navigation, plugin content, back navigation, and a clear exit action. Provide two display modes: - **Unicode mode:** normal translated text and supported Unicode decoration. - **ASCII mode:** ASCII-only borders, arrows, bullets, status markers, and fallback icons. Allow users to force ASCII mode. If terminal encoding or glyph support is uncertain, prefer ASCII decoration. Do not make color or special characters the only way to convey information. Test narrow terminals, ASCII locales, no-color environments, and Unicode/RTL text. ## Security and PolicyKit Keep the GUI and TUI unprivileged. Use a small system D-Bus service for privileged operations. - Define distinct PolicyKit actions for specific operations. - Enforce authorization and validate inputs in the service, not only in the UI. - Configure any root or `wheel` access explicitly in policy; do not assume group membership grants permission. - Avoid arbitrary shell commands and user-controlled paths. - Keep the privileged service and its dependencies minimal. - Never load plugin code from user-writable locations into the privileged service. ## Plugin model Use package-managed manifests registered through a well-known system registry. The application queries that registry rather than scanning plugin directories. A manifest should include: - Stable plugin ID and API version - Name and description - Category and subcategory IDs - Supported frontends - Package/version compatibility - Declared capabilities and required operations Mageia packages should install, upgrade, and remove plugins and their dependencies. Begin with trusted Mageia-packaged plugins. Define signing, provenance, and permission rules before considering third-party plugins. ## Packaging and Python - Provide a locked virtual environment for development. - Use Mageia packages for system deployment and dependencies. - Package the core, frontends, D-Bus service, PolicyKit actions, and plugins as clearly scoped components. - Do not run privileged code from a mutable virtual environment or user-writable plugin path. ## Localization and resources - Keep images, icons, and translation catalogs in package-owned resources. - Establish a translation workflow covering QML, Python, and Textual strings. - Keep stable IDs separate from translated labels. - Test RTL layout, navigation, alignment, and back behavior in both frontends. ## Delivery phases 1. **Design:** threat model, privilege boundaries, plugin API, registry choice, and UI flows. 2. **Skeleton:** shared core, registry prototype, package layout, and mock plugins. 3. **Security path:** D-Bus service, PolicyKit actions, input validation, and authorization tests. 4. **GUI shell:** navigation, splitter, themes, and plugin content container. 5. **TUI shell:** bounded layout, ASCII/Unicode modes, and keyboard navigation. 6. **Initial plugins:** start with read-only modules, then add narrowly scoped write operations. 7. **Quality:** localization, RTL, accessibility, failure handling, and integration tests. 8. **Release:** Mageia packages, documentation, and upgrade/removal validation. ## Acceptance checks - Plugin discovery works through the registry without directory scanning. - Authorization is enforced by the privileged service for every protected operation. - GUI resizing, back navigation, keyboard access, themes, localization, and RTL work. - TUI remains understandable in ASCII mode, without color, and at narrow widths. - Plugin installation, upgrade, and removal leave the registry in a consistent state. - Denied, cancelled, malformed, unavailable, and failed operations produce clear messages.