Skip to content

Feat/artix support#34

Merged
Firstp1ck merged 21 commits intomainfrom
feat/artix-support
Nov 15, 2025
Merged

Feat/artix support#34
Firstp1ck merged 21 commits intomainfrom
feat/artix-support

Conversation

@Firstp1ck
Copy link
Owner

@Firstp1ck Firstp1ck commented Nov 15, 2025

Summary

This PR adds comprehensive Artix Linux support to Pacsea, including repository detection, filtering, UI integration, and mirror update functionality. Artix Linux is an Arch-based distribution that uses runit, OpenRC, or s6 instead of systemd. The implementation follows the same patterns used for EndeavourOS and CachyOS support, adding detection and filtering for all six Artix repositories: omniverse, universe, lib32, galaxy, world, and system.

Key Features:

  • Repository detection functions for all Artix repos with specific checks for each repo type
  • UI filter toggles for each Artix repository (similar to EOS/CachyOS filters)
  • Human-friendly labels for Artix packages (OMNI, UNI, LIB32, GALAXY, WORLD, SYSTEM)
  • Localization support in German and English
  • Integration with existing filter and display logic
  • Artix mirror update support using rate-mirrors from AUR with automatic installation prompts
  • TUI Optional Deps integration - Artix systems show "rate mirrors" instead of "reflector" in the Optional Deps modal
  • AUR installation support - rate-mirrors can be installed directly from Optional Deps modal using AUR helpers
  • Preflight prevention - System updates and Optional Deps installations bypass preflight checks for smoother UX
  • Smart UI layout that hides Artix-specific filter chips when space is tight, keeping dropdown buttons visible
  • Artix filter dropdown menu that appears when specific repo filters are hidden, allowing access to all filters
  • Comprehensive test coverage

Type of change

  • feat (new feature)
  • fix (bug fix)
  • docs (documentation only)
  • refactor (no functional change)
  • perf (performance)
  • test (add/update tests)
  • chore (build/infra/CI)
  • ui (visual/interaction changes)
  • breaking change (incompatible behavior)

Related issues

Closes #32

How to test

List exact steps and commands to verify the change. Include flags like --dry-run when appropriate.

# Run all tests to ensure Artix support works correctly
cargo test --lib

# Specifically test Artix repository detection
cargo test --lib index::distro::tests::artix_repo_rules

# Test label generation for Artix repos
cargo test --lib logic::distro::tests::label_for_official_prefers_special_cases

# Test filter toggles
cargo test --lib logic::distro::tests::repo_toggle_respects_individual_flags

# Standard checks
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo check

# Manual testing with Artix repos
# 1. Run pacsea on an Artix system or with Artix repos configured
# 2. Verify Artix filter chips appear in the UI when Artix packages are present
# 3. Test toggling individual Artix repository filters
# 4. Verify package labels show correct abbreviations (OMNI, UNI, etc.)
# 5. Test Artix filter dropdown (resize terminal to trigger space constraints)
# 6. Test mirror update functionality:
#    - Open system update modal
#    - Select mirror update option
#    - Test with "Worldwide" and specific country selection
#    - Verify rate-mirrors installation prompt works (if not installed)
#    - Verify backup creation and mirrorlist update
# 7. Test TUI Optional Deps integration:
#    - Open Options → Optional Deps modal
#    - Verify Artix systems show "Mirrors: rate mirrors" instead of "reflector"
#    - Verify installation status check works for rate-mirrors
#    - Test installing rate-mirrors from Optional Deps (should use AUR helper)
#    - Verify preflight is NOT triggered when installing from Optional Deps
# 8. Test System Update preflight prevention:
#    - Open Options → Update System modal
#    - Select update options and press Enter
#    - Verify preflight modal does NOT open (only terminal should open)

Checklist

  • Code compiles locally
  • cargo fmt --all ran without changes
  • cargo clippy --all-targets --all-features -- -D warnings is clean
  • cargo test -- --test-threads=1 passes (for Artix-related tests)
  • Added or updated tests where it makes sense
  • Updated docs if behavior, options, or keybinds changed (README, config examples)
  • For UI changes: included screenshots and updated Images/ if applicable
  • Changes respect --dry-run and degrade gracefully if pacman/paru/yay are unavailable
  • If config keys changed: updated README sections for settings.conf, theme.conf, and keybinds.conf
  • Not a packaging change for AUR (otherwise propose in pacsea-bin or pacsea-git repos)

Notes for reviewers

Architecture

  • Repository Detection (src/index/distro.rs): Added functions is_artix_repo(), is_artix_omniverse(), is_artix_universe(), is_artix_lib32(), is_artix_galaxy(), is_artix_world(), is_artix_system(), and artix_repo_names() following the same pattern as EOS/CachyOS detection
  • State Management (src/state/app_state.rs): Added boolean flags for each Artix repository filter toggle, plus artix_filter_menu_open and artix_filter_menu_rect for dropdown functionality
  • Filter Logic (src/logic/distro.rs): Extended repo_toggle_for() and label_for_official() to handle Artix repos with specific labels
  • UI Components: Updated multiple UI files to display and handle Artix filter interactions
  • Mirror Updates (src/events/distro.rs): Added Artix-specific mirror update logic using rate-mirrors with AUR helper detection, installation prompts, and country filtering
  • TUI Optional Deps (src/events/global.rs, src/events/mouse.rs): Added Artix detection and rate-mirrors display in Optional Deps modal, replacing reflector for Artix systems
  • AUR Installation (src/events/modals.rs, src/install/command.rs): Enhanced Optional Deps modal to support AUR package installation via aur_install_body function (made public)
  • Preflight Prevention (src/events/install.rs, src/events/modals.rs): Added safeguards to prevent preflight from being triggered during SystemUpdate and OptionalDeps modal operations
  • Smart Layout (src/ui/results/title.rs): Implemented space-aware rendering that hides Artix-specific filter chips when space is tight, ensuring dropdown buttons remain visible
  • Dropdown Menu (src/ui/results/dropdowns.rs): Added Artix filter dropdown that appears when specific filters are hidden, providing access to all Artix repository filters
  • Package Build Files (PKGBUILD-bin, PKGBUILD-git): Added rate-mirrors to optional dependencies for both binary and git package builds

Label System

The label_for_official() function prioritizes specific Artix repo checks before the generic fallback:

  • omniverse"OMNI"
  • universe"UNI"
  • lib32"LIB32"
  • galaxy"GALAXY"
  • world"WORLD"
  • system"SYSTEM"
  • Other Artix repos → "Artix" (fallback)

Commit History

  1. bead9b3: Initial Artix Linux support - core repository detection and UI integration
  2. 2e1386f: Added Artix support to localization files (German and English)
  3. 65896cb: Added Artix repository filters and UI enhancements
  4. 2cee545: Updated Artix filter labels to lowercase (later reverted)
  5. bb7de48: Updated Artix filter labels to uppercase (OMNI, UNI, LIB32, GALAX, WORLD, SYSTEM)
  6. e8ba3bc: Corrected "GALAX" to "GALAXY" in localization files and UI components
  7. f6d108f: Fixed test expectations to match correct label behavior
  8. Mirror Update Support: Added Artix mirror update functionality using rate-mirrors from AUR
  9. UI Layout Fix: Implemented smart layout that hides Artix-specific filters when space is tight
  10. Dropdown Menu: Added Artix filter dropdown menu for accessing filters when they're hidden
  11. Command Syntax Fix: Corrected rate-mirrors command syntax (global options must come before the artix command)
  12. 7361afc: Added rate-mirrors to PKGBUILD optional dependencies and TUI Optional Deps integration for Artix systems
  13. 626907e: Enhanced AUR installation support for rate-mirrors in Optional Deps modal (made aur_install_body public)
  14. d8211f1: Enhanced preflight handling to skip checks when SystemUpdate or OptionalDeps modals are active
  15. 3f4be19: Refactored modal key event handling to prevent preflight from being triggered during SystemUpdate and OptionalDeps operations

Testing

  • Repository detection tests validate case-insensitive matching
  • Filter toggle tests ensure individual Artix repos can be enabled/disabled
  • Label generation tests verify correct abbreviations are returned
  • Integration tests cover UI interactions
  • Mirror update command tests verify correct shell command generation for Artix
  • Unit tests validate country filtering and validation logic

Breaking changes

None - this is a purely additive feature that doesn't change existing behavior.

Additional context

Artix Linux Repositories

Artix Linux uses six main repositories:

  • omniverse: Community packages
  • universe: Additional packages
  • lib32: 32-bit libraries
  • galaxy: Extra packages
  • world: User-contributed packages
  • system: Core system packages

Implementation Details

  • All Artix detection functions use case-insensitive matching (eq_ignore_ascii_case)
  • Filter toggles are independent - users can enable/disable each Artix repo separately
  • Unknown official repos require all official filters (including Artix) to be enabled
  • The implementation mirrors the existing EOS/CachyOS support for consistency

Mirror Update Implementation

  • Detection: Checks for rate-mirrors installation using pacman -Qi first, then command -v as fallback
  • AUR Helper Detection: Checks for yay or paru before prompting for installation
  • Installation Prompt: Interactive prompt asks user if they want to install rate-mirrors from AUR
  • Backup Creation: Automatically creates timestamped backup of /etc/pacman.d/mirrorlist before updating
  • Country Filtering: Supports single country selection using --entry-country option (global option placed before artix command)
  • Worldwide Mode: Uses default entry country (US) when "Worldwide" is selected
  • Error Handling: Validates that only one country is provided, cancels update if installation is denied

UI Layout Improvements

  • Space Calculation: Dynamically calculates available space for dropdown buttons
  • Conditional Rendering: Hides Artix-specific filter chips (OMNI, UNI, LIB32, GALAXY, WORLD, SYSTEM) when space is tight
  • Dropdown Indicator: Shows "[Artix] v" when specific filters are hidden to indicate dropdown availability
  • Dropdown Menu: Provides access to all Artix filters via dropdown when they're hidden
  • General Toggle: First item in dropdown allows toggling all Artix filters at once

TUI Optional Deps Integration

  • Artix Detection: Automatically detects Artix Linux systems by checking /etc/os-release for "Artix"
  • Mirror Tool Selection: Artix systems show "Mirrors: rate mirrors" instead of "reflector" in Optional Deps modal
  • Installation Status: Checks for rate-mirrors installation using both command_on_path() and is_installed() functions
  • AUR Installation: Uses aur_install_body() function to install rate-mirrors via AUR helpers (paru/yay) with proper error handling
  • Package Dependencies: Added rate-mirrors to optional dependencies in both PKGBUILD-bin and PKGBUILD-git files

Preflight Prevention

  • Modal State Check: Installation handler checks if SystemUpdate or OptionalDeps modals are active before triggering preflight
  • Event Propagation Control: SystemUpdate and OptionalDeps modals return true after handling Enter key to stop event propagation
  • User Experience: Prevents unnecessary preflight modals from opening when performing system updates or installing optional dependencies
  • Implementation: Both modals spawn shell commands directly and close, ensuring preflight is bypassed for these operations

Firstp1ck and others added 16 commits November 15, 2025 12:13
- Introduced functionality to handle Artix Linux repositories, including checks for repository names and UI filters.
- Updated the application state to manage visibility of Artix packages.
- Enhanced UI components to display Artix filter options and results.
- Added tests to validate Artix repository heuristics and integration with existing features.
- Updated German and English locale files to include Artix in the package filter options.
- Adjusted filter descriptions to reflect the addition of Artix alongside other distributions.
- Introduced new filters for Artix repositories: omniverse, universe, lib32, galaxy, world, and system.
- Updated localization files for German and English to include new Artix filter labels.
- Enhanced application state management to support visibility toggles for new Artix filters.
- Modified UI components to display and handle interactions for the new Artix filters.
- Updated tests to validate the integration of Artix filters in the application.
- Changed Artix filter labels in German and English locale files from uppercase to lowercase for consistency.
- Updated UI components and tests to reflect the new lowercase labels for Artix filters: omniverse, universe, lib32, galaxy, world, and system.
…ents

- Changed Artix filter labels in German and English locale files to uppercase: OMNI, UNI, LIB32, GALAX, WORLD, and SYSTEM.
- Updated UI components and tests to reflect the new uppercase labels for Artix filters.
…iles and UI components

- Updated the German and English locale files to reflect the correct label for Artix Galaxy.
- Adjusted UI components and tests to ensure consistency with the updated label.
- Updated the mirror update command to include Artix-specific handling for mirror updates.
- Added checks for the installation of `rate-mirrors` and AUR helpers (yay/paru), with prompts for installation if not found.
- Implemented country validation for Artix, ensuring only one country is allowed for mirror updates.
- Created a backup of the existing mirrorlist before executing updates.
- Added tests to verify Artix detection, installation checks, and command execution for both Worldwide and regional updates.
…available space

- Removed hardcoded checks for Artix filters and implemented dynamic visibility based on available space in the UI.
- Updated logic to calculate consumed space and determine whether to display Artix-specific filters.
- Enhanced the rendering of Artix filters to ensure they only appear when there is sufficient space, improving UI responsiveness.
- Adjusted related UI components to reflect these changes and maintain consistency in filter display.
- Added functionality to manage the visibility of the Artix filter dropdown based on the state of specific repo filters.
- Updated mouse and keyboard event handlers to toggle the Artix filter menu and handle interactions within the dropdown.
- Enhanced the rendering logic to display the Artix filter dropdown only when necessary, improving user experience.
- Adjusted application state to track the visibility and dimensions of the Artix filter menu.
…wn rendering

- Implemented a toggle for all Artix filters in the mouse event handler, allowing users to enable or disable all filters simultaneously.
- Updated the dropdown rendering logic to reflect the combined state of individual Artix filters, improving user feedback on filter status.
- Ensured that changes to filter states trigger the appropriate sorting and filtering logic, maintaining application responsiveness.
…handling

- Included 'rate-mirrors' as an optional dependency in both PKGBUILD-bin and PKGBUILD-git.
- Updated global and mouse event handling to recognize Artix and utilize 'rate-mirrors' for mirror management, enhancing functionality for Artix users.
- Added handling for the 'rate-mirrors' package in the modal key event, allowing for a custom installation command that includes a user-friendly completion message.
- Made the `aur_install_body` function public to facilitate broader access within the codebase.
- Updated the installation key event to skip preflight checks when SystemUpdate or OptionalDeps modals are active, ensuring smoother user experience during installations.
- Introduced a new condition to determine when to bypass preflight based on the current modal state.
- Added return statements in the modal key event handler to manage event propagation more effectively.
- Ensured that the Alert modal can handle further events when no actions are selected, and prevented preflight checks from being triggered during specific modal states.
- Updated test assertions to separate the Artix argument for improved clarity in command validation.
- Reformatted the installation command for 'rate-mirrors' in the modal key event to enhance readability and maintainability.
Copy link
Contributor

Copilot AI left a 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 comprehensive Artix Linux support to Pacsea, a TUI package manager for Arch-based distributions. Artix is an Arch derivative that uses init systems other than systemd (runit, OpenRC, or s6). The implementation follows existing patterns for EndeavourOS and CachyOS support, providing repository detection, filtering UI, and mirror management for all six Artix repositories.

Key Changes:

  • Repository detection for 6 Artix repos (omniverse, universe, lib32, galaxy, world, system) with case-insensitive matching
  • UI filter chips and dropdown menu system for Artix packages with space-aware layout
  • Mirror update integration using rate-mirrors from AUR with automatic installation prompts and country filtering

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/index/distro.rs Core repository detection functions for all Artix repos with case-insensitive matching
src/index/fetch.rs Integration of Artix repos into package index fetching via pacman -Sl
src/index/mod.rs Exports for new Artix detection functions
src/state/app_state.rs State management for Artix filter flags and dropdown menu
src/logic/distro.rs Filter toggle logic and package labels for Artix repos
src/ui/results/utils.rs Detection of Artix packages in results for showing filter chips
src/ui/results/title.rs Space-aware rendering of Artix filter chips with dropdown indicator
src/ui/results/dropdowns.rs Artix filter dropdown menu when specific repo filters are hidden
src/ui/results/mod.rs Integration of Artix filters into results panel rendering
src/ui/helpers.rs Test translation setup for Artix filter labels
src/ui.rs Test translation setup for Artix filter labels
src/events/mouse.rs Click handling for Artix filter chips and dropdown menu interactions
src/events/global.rs Keyboard handling and Artix detection for Optional Deps modal
src/events/modals.rs Preflight prevention and AUR installation support for rate-mirrors
src/events/install.rs Preflight skip logic for SystemUpdate and OptionalDeps modals
src/events/distro.rs Mirror update commands for Artix using rate-mirrors with country validation
src/install/command.rs Made aur_install_body public for rate-mirrors installation
config/locales/en-US.yml English translations for Artix filter labels
config/locales/de-DE.yml German translations for Artix filter labels
PKGBUILD-bin Added rate-mirrors to optional dependencies
PKGBUILD-git Added rate-mirrors to optional dependencies
tests/ui_integration.rs Test translation setup for Artix filters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Firstp1ck and others added 2 commits November 15, 2025 17:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as resolved.

Copilot AI and others added 2 commits November 15, 2025 16:39
…tter UX

Co-authored-by: Firstp1ck <159012644+Firstp1ck@users.noreply.github.com>
Move Artix country validation before rate-mirrors installation
@Firstp1ck Firstp1ck marked this pull request as ready for review November 15, 2025 17:30
@Firstp1ck Firstp1ck merged commit fc8ed26 into main Nov 15, 2025
5 checks passed
@Firstp1ck Firstp1ck deleted the feat/artix-support branch November 15, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working community-suggestions enhancement New feature or request improve-consistency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artix "system" packages show up as AUR packages

3 participants