archinstall/archinstall/lib
Softer 0f16801448
Color-code install preview: red for errors, yellow for warnings, green for ready (#4512)
* Color-code install preview: red for errors, yellow for warnings, green for ready

Add preview_markup opt-in field to MenuItem with automatic Rich markup
escaping for all existing previews. Show missing configs and bootloader
errors in red, network warning in yellow, "Ready to install" in green.
Move network warning from confirmation dialog to install preview so it
is visible earlier.

* Fix Rich markup parsing error on JSON preview strings

Text.from_markup() replaces Label(markup=True) to avoid MarkupError
on strings containing ["

* Replace raw Rich markup with PreviewResult dataclass for typed preview levels

* Add missing translatable strings to base.pot

* Move get_install_warnings() from ConfigurationOutput to GlobalMenu

The method is only used by GlobalMenu._prev_install_invalid_config(),
so it belongs there rather than on the serialization class.

* Move level-to-style mapping into MsgLevelType.style() method

Replace the module-level _LEVEL_STYLE dict in components.py with a
style() method on the MsgLevelType enum, following the project
convention of encapsulating type-bound logic on the type itself.

* Change PreviewResult to hold a list of message-level pairs

PreviewResult.messages is now list[tuple[str, MsgLevelType]], allowing
a single result to carry multiple sections with different levels.
The preview_action signature drops list[PreviewResult] since the
dataclass itself handles multiple sections. Existing str-returning
previews still work and will be converted in follow-up PRs.

* Make MsgLevelType.style() return a typed MsgLevelStyle enum

Replace the bare style strings returned by style() with a MsgLevelStyle
StrEnum so the values are type-checked. Being a StrEnum, the members stay
plain strings and pass straight into Text.append(style=...), so no call
sites change.
2026-06-08 16:22:34 +10:00
..
applications Pull `ui` module one level up (#4515) 2026-05-03 23:54:42 +02:00
authentication Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
bootloader Pull `ui` module one level up (#4515) 2026-05-03 23:54:42 +02:00
disk fix(luks): surface cryptsetup error output when unlock fails (#4570) 2026-06-06 18:38:36 +10:00
general Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
locale Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
menu Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
mirror Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
models Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
network Fix WiFi network selection in TUI prompt (#4566) 2026-06-08 04:31:07 +10:00
packages Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
pacman Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
profile add niri DankMaterialShell profile (#4554) 2026-05-25 21:13:56 +10:00
user Pull `ui` module one level up (#4515) 2026-05-03 23:54:42 +02:00
utils Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
__init__.py Converted the lib to a pip supported structure to make packaging easier. Also tweaked some minor issues and added the AUR function 2020-07-06 18:44:42 +02:00
args.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
boot.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
command.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
configuration.py Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
crypt.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
exceptions.py Update ruff formatter (#3496) 2025-05-24 07:58:42 +00:00
global_menu.py Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
hardware.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
installer.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
linux_path.py Add LPath execute permissions methods (#4378) 2026-04-06 09:16:21 +02:00
log.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
networking.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
pathnames.py Add constant for mirrorlist (#4403) 2026-04-11 10:17:29 +10:00
plugins.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
translationhandler.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
version.py Move get_version() to version module (#4270) 2026-03-01 11:31:13 +11:00