archinstall/archinstall
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 Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00
default_profiles add niri DankMaterialShell profile (#4554) 2026-05-25 21:13:56 +10:00
lib Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
locales Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
scripts Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
tui Color-code install preview: red for errors, yellow for warnings, green for ready (#4512) 2026-06-08 16:22:34 +10:00
__init__.py Convert imports to absolute imports (#4196) 2026-02-26 20:17:48 +11:00
__main__.py Replace sys.exit calls with return values (#4156) 2026-01-22 13:58:40 +11:00
examples Adding symlink to examples. 2020-07-08 12:34:22 +00:00
main.py Refactor logging and formatting logic (#4542) 2026-05-19 17:48:03 +02:00