feat(installer): overhaul GUI to 6-step flow and resilient UX
Some checks are pending
ci / test (push) Waiting to run

- Streamline installer to direct 6-step flow, eliminating Step 0 duplicate welcome
- Parse friendly layout names from evdev.lst and sort top 30 world layouts first
- Enable dynamic live keymap switching via localectl on layout selection
- Auto-detect timezone and close sibling combos on dropdown expansion
- Remove redundant keyboard test modal from welcome application
- Default-enable single-password disk encryption and accept passwords under 8 chars
- Replace ERASE typing confirmation with direct 'Install now' action
- Enforce Mango desktop, Btrfs filesystem, and Flatpak/Nix invariants against AI mutation
- Add loopback OpenCode/Ollama auto-detection and humanized failure screen with Retry
This commit is contained in:
Phoebus 2026-09-23 05:42:03 -07:00
parent 28536e2c1f
commit 6e5c7d999f
8 changed files with 335 additions and 124 deletions

View file

@ -3,6 +3,40 @@
All notable changes are recorded here. The authoritative history is `git log`; All notable changes are recorded here. The authoritative history is `git log`;
this file is the curated, human-readable summary. this file is the curated, human-readable summary.
## 2026-09-23 — Comprehensive installer UX overhaul: 6-step flow, friendly pickers, and resilient UI
- **Streamlined 6-Step Flow (`phoebus-install`, QML):**
Eliminated the duplicate Step 0 welcome screen from the installer wizard; launch starts
directly at "Step 1 of 6 · Language and keyboard" with an accurate 6-step progress indicator.
The "Back" button is hidden on Step 1 and disabled for step 0 so back-navigation stays bounded.
- **Friendly Keyboard & Locale Pickers (`phoebus-installer::gui_bridge`, `PhoebusCombo`):**
Replaced raw two-letter codes (`al`, `dz`, `brai`) and arbitrary sorting with full layout
names parsed directly from `/usr/share/X11/xkb/rules/evdev.lst`, sorting the top 30 world
keyboard layouts and system locales first (e.g. `English (US) — us`, `German — de`).
Selecting a layout dynamically switches the live Wayland keymap via `localectl set-x11-keymap`.
- **Searchable Timezone Picker (`gui_bridge`, QML):**
Populated the timezone dropdown directly from system zoneinfo, auto-detecting `/etc/localtime`.
- **Welcome App Cleanup (`phoebus-welcome`):**
Removed the redundant "Keyboard test" button and modal from the live welcome app.
- **Single-Password Disk Encryption (`phoebus-install`):**
Default-enabled "Use same password to encrypt disk" toggle with LUKS2, reducing credentials
to username and password only without redundant confirmation prompts. Removed arbitrary
8-character minimum password restriction to accept any valid password.
- **Direct Installation Confirmation:**
Eliminated the requirement to type "ERASE" in all caps or check confirmation boxes; replaced
with a direct, unambiguous "Install now" button on the review screen.
- **Invariants Enforced Against AI Mutation (`phoebus-ai`):**
Enforced Mango + DankMaterialShell desktop, Btrfs filesystem, and Flatpak/Nix core subsystems
inside both the AI system prompt and semantic change validation; non-conforming AI proposals
are automatically rejected.
- **Loopback AI Auto-Detection & Clear Guidance:**
Auto-probes loopback ports 4096 (OpenCode) and 11434 (Ollama) upon reaching the AI step,
defaulting to detected local instances and replacing technical jargon with clear user guidance.
- **Humanized Failure Reporting & Details Viewer:**
Replaced raw curl/JSON dumps with clear humanized error summaries (e.g. package verification
or network connection issues) alongside "[Retry]" and "[View technical details]" toggles.
The live details terminal box properly fetches log lines and auto-scrolls to the latest activity.
## 2026-09-23 — Responsive display layout, resolution modal & hotkeys, and fullscreen installer ## 2026-09-23 — Responsive display layout, resolution modal & hotkeys, and fullscreen installer
- **Display Resolution Switcher & Hotkeys (`phoebus-welcome`, Mango config):** - **Display Resolution Switcher & Hotkeys (`phoebus-welcome`, Mango config):**

View file

@ -3,26 +3,27 @@
Rolling note between work sessions. **Update this file before you finish**, then Rolling note between work sessions. **Update this file before you finish**, then
commit it. It should be short and current; use `git log` for detail. commit it. It should be short and current; use `git log` for detail.
- **Last updated:** this session (2026-09-23), Responsive display layout, 1-click resolution switcher & hotkeys, and fullscreen installer. - **Last updated:** this session (2026-09-23), Comprehensive installer UX overhaul: 6-step flow, friendly pickers, and resilient UI.
- **Current focus:** - **Current focus:**
1. Low-Resolution Responsiveness & Scrollability: wrapped `phoebus-welcome` and 1. Streamlined 6-Step Flow: eliminated Step 0 duplicate welcome screen in installer, starting directly at "Step 1 of 6 · Language and keyboard", hiding "Back" on Step 1, and rendering 6 accurate progress dots.
`phoebus-install` form/progress views in bounded `Flickable` containers with 2. Friendly Keyboard & Locale Pickers: parsed full names from `evdev.lst`, sorted top 30 world layouts first, dynamic keymap switching on select via `localectl set-x11-keymap`, auto-detected timezone, and auto-closing sibling combos on dropdown open.
`ScrollBar.vertical`. Added compact view adaptation (< 760px) in `phoebus-welcome` 3. Cleaned Welcome Screen: removed redundant "Keyboard test" button and modal from live welcome app.
with flow-wrapped readiness chips, resolving text/control clipping on 800×600 4. Simplified Credentials: single password toggle ("Use same password to encrypt disk") default enabled, single username field (no fullname prompt), and removed 8-char minimum limit.
and 640×480 displays. 5. Direct Review & Confirmation: replaced typing "ERASE" in all caps and checkboxes with a direct "Install now" button on the review screen.
2. 1-Click Display Resolution Modal & Hotkeys: added a dedicated Display Resolution 6. Subsystem & Desktop Invariants: enforced Mango + DMS desktop, Btrfs filesystem, and Flatpak/Nix in both AI prompt and validator.
dialog to `phoebus-welcome` (and hotkeys `Super+Shift+F12` for 1080p, `F11` for 900p, 7. Local AI Auto-Detection & Guidance: auto-probes ports 4096 (OpenCode) and 11434 (Ollama), replaces technical jargon with friendly instructions.
`F10` for 768p, `F9` for 1024x768) that applies native modes via `wlr-randr`, 8. Humanized Error Handling: calm, user-friendly failure explanations with [Retry] and [View technical details] buttons; working live details box with auto-scroll.
eliminating blurry bilinear scaling.
3. QEMU Native Resolution & Menubar: configured `-device virtio-gpu-pci,xres=1280,yres=768`
and `-display gtk,zoom-to-fit=on,show-menubar=on` in `start_vm.sh`.
4. Fixed Gentoo GURU sync error: updated `GURU_REPO_URI` in `phoebus-core::system`
to official mirror `https://anongit.gentoo.org/git/repo/proj/guru.git`.
5. OpenCode model names and variants: model picker displays real human-readable
names alongside raw IDs and allows selecting variants (`default`, `low`, `high`, `max`).
6. Live terminal output streaming: `Logger` line streaming plumbed through the
JSON-RPC bridge to display live command execution in the "Show details" box.
- **Last verified (this session):** - **Last verified (this session):**
- All workspace tests pass: `cargo fmt`, `cargo clippy`, and `cargo test --workspace` pass 100% (47 phoebus-installer tests, 36 phoebus-ai tests, etc.).
- Static release binary built and deployed to live VM.
- Interactive live VM tested and verified with screenshots:
- Welcome app shows clean action buttons with "Keyboard test" completely removed.
- Installer launches in full screen without 50/50 window tiling splits.
- Installer starts directly at Step 1 of 6 with human-readable language, keyboard, and timezone pickers.
- Sibling combos auto-close when another is expanded; search filtering is active.
- OpenCode local loopback auto-detected on port 4096.
- Disk selection, account credentials, single-password toggle, and "Install now" button all verified.
- Failure screen displays humanized explanation and expands technical details on request.
- `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets` - `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets`
finished with 0 errors (pre-existing warnings only). finished with 0 errors (pre-existing warnings only).
- All tests pass for `phoebus-core` (142), `phoebus-ai` (35), - All tests pass for `phoebus-core` (142), `phoebus-ai` (35),

View file

@ -210,6 +210,30 @@ impl ProposedChange {
validate::validate_package_atom(atom)?; validate::validate_package_atom(atom)?;
validate::validate_use_flag(flag) validate::validate_use_flag(flag)
} }
ProposedChange::SetFilesystem { value } => {
if *value != Filesystem::Btrfs {
Err("Btrfs is the required filesystem for Phoebus OS".into())
} else {
Ok(())
}
}
ProposedChange::SetDesktopProfile { value } => {
if *value != DesktopProfile::Mango {
Err(
"Mango + DankMaterialShell is the required desktop profile for Phoebus OS"
.into(),
)
} else {
Ok(())
}
}
ProposedChange::SetFlatpak { value } => {
if !*value {
Err("Flatpak is a required subsystem of Phoebus OS".into())
} else {
Ok(())
}
}
_ => Ok(()), _ => Ok(()),
} }
} }
@ -438,7 +462,7 @@ mod tests {
"changes": [ "changes": [
{"action": "set_hostname", "value": "box"}, {"action": "set_hostname", "value": "box"},
{"action": "set_encryption", "value": "luks2"}, {"action": "set_encryption", "value": "luks2"},
{"action": "set_desktop_profile", "value": "dwl"} {"action": "set_desktop_profile", "value": "mango"}
] ]
}"#; }"#;
let proposal = parse_proposal(text).unwrap(); let proposal = parse_proposal(text).unwrap();
@ -447,7 +471,30 @@ mod tests {
assert_eq!(applied.len(), 3); assert_eq!(applied.len(), 3);
assert_eq!(config.system.hostname, "box"); assert_eq!(config.system.hostname, "box");
assert_eq!(config.encryption.mode, Encryption::Luks2); assert_eq!(config.encryption.mode, Encryption::Luks2);
assert_eq!(config.desktop.profile, DesktopProfile::Dwl); assert_eq!(config.desktop.profile, DesktopProfile::Mango);
}
#[test]
fn non_mango_desktop_or_non_btrfs_rejected() {
let text = r#"{
"version": 1,
"changes": [
{"action": "set_desktop_profile", "value": "minimal"}
]
}"#;
let proposal = parse_proposal(text).unwrap();
let mut config = InstallConfig::default();
assert!(apply(&mut config, &proposal).is_err());
let text2 = r#"{
"version": 1,
"changes": [
{"action": "set_filesystem", "value": "ext4"}
]
}"#;
let proposal2 = parse_proposal(text2).unwrap();
let mut config2 = InstallConfig::default();
assert!(apply(&mut config2, &proposal2).is_err());
} }
#[test] #[test]

View file

@ -224,9 +224,8 @@ pub const SYSTEM_PROMPT: &str = "\
You are the Phoebus OS installation advisor. You may ONLY propose changes using \ You are the Phoebus OS installation advisor. You may ONLY propose changes using \
this closed set of actions, each with a non-empty reason and optional evidence: this closed set of actions, each with a non-empty reason and optional evidence:
set_hostname, set_timezone, set_locale, set_keymap, set_username, set_target_disk, set_hostname, set_timezone, set_locale, set_keymap, set_username, set_target_disk,
set_filesystem (btrfs|ext4), set_encryption (none|luks2), set_kernel_profile set_encryption (none|luks2), set_kernel_profile (safe|optimized|aggressive),
(safe|optimized|aggressive), set_package_policy (balanced|source_first|binary_first), set_package_policy (balanced|source_first|binary_first), set_desktop_profile (mango),
set_desktop_profile (mango),
set_binary_packages (bool), set_build_jobs (1-256), set_package_use (atom, flag, set_binary_packages (bool), set_build_jobs (1-256), set_package_use (atom, flag,
enabled). enabled).
@ -236,15 +235,15 @@ Reply with ONLY a JSON object of the form:
Every change object has EXACTLY the two keys `action` and `value`. Put the chosen Every change object has EXACTLY the two keys `action` and `value`. Put the chosen
option in `value`; never use the action name as a key. Correct examples: option in `value`; never use the action name as a key. Correct examples:
{\"action\":\"set_kernel_profile\",\"value\":\"safe\"} {\"action\":\"set_kernel_profile\",\"value\":\"safe\"}
{\"action\":\"set_filesystem\",\"value\":\"btrfs\"} {\"action\":\"set_desktop_profile\",\"value\":\"mango\"}
{\"action\":\"set_binary_packages\",\"value\":true} {\"action\":\"set_binary_packages\",\"value\":true}
{\"action\":\"set_build_jobs\",\"value\":4} {\"action\":\"set_build_jobs\",\"value\":4}
Rules: prefer stability and a proven boot over speculative performance; never Rules: prefer stability and a proven boot over speculative performance; never
propose disabling signature verification, enabling ~amd64 globally, weakening propose disabling signature verification, enabling ~amd64 globally, weakening
LUKS2/Btrfs/systemd/UEFI, or any shell/command action; do not invent package LUKS2/Btrfs/systemd/UEFI, or any shell/command action; do not invent package
atoms; Flatpak, Nix, and the Mango + DMS desktop profile are required, non-removable atoms; Flatpak, Nix, Btrfs filesystem, and the Mango + DMS desktop profile are required,
core subsystems of Phoebus OS (never propose disabling, toggling, or removing them); non-removable core subsystems of Phoebus OS (never propose disabling, changing, or removing them);
the NVIDIA driver branch and kernel-module flavor are selected from the detected the NVIDIA driver branch and kernel-module flavor are selected from the detected
PCI device IDs and are not proposable; keep required boot/encryption/filesystem/desktop PCI device IDs and are not proposable; keep required boot/encryption/filesystem/desktop
settings fixed. You do not have a shell and cannot execute anything."; settings fixed. You do not have a shell and cannot execute anything.";
@ -492,7 +491,7 @@ mod tests {
fn facts() -> SystemFacts { fn facts() -> SystemFacts {
let mut config = InstallConfig::default(); let mut config = InstallConfig::default();
config.desktop.profile = phoebus_core::DesktopProfile::Dwl; config.desktop.profile = phoebus_core::DesktopProfile::Mango;
let hardware = HardwareReport { let hardware = HardwareReport {
cpu: CpuInfo { cpu: CpuInfo {
model: "Test CPU".into(), model: "Test CPU".into(),

View file

@ -370,7 +370,7 @@ impl Bridge {
Ok(json!({ Ok(json!({
"timezones": labeled_options(system_timezones(), humanize_timezone), "timezones": labeled_options(system_timezones(), humanize_timezone),
"locales": labeled_options(system_locales(), humanize_locale), "locales": labeled_options(system_locales(), humanize_locale),
"keymaps": labeled_options(system_keymaps(), humanize_keymap), "keymaps": system_keymap_options(),
// The live session's own layout, so the frontend can be truthful // The live session's own layout, so the frontend can be truthful
// about whether a selection affects the running graphical session. // about whether a selection affects the running graphical session.
"keymap_live": live_keymap(), "keymap_live": live_keymap(),
@ -1345,6 +1345,7 @@ fn region_name(code: &str) -> Option<&'static str> {
/// A friendly keyboard name for a console keymap identifier, with the technical /// A friendly keyboard name for a console keymap identifier, with the technical
/// name kept so an advanced user can still see exactly what will be set. /// name kept so an advanced user can still see exactly what will be set.
#[allow(dead_code)]
fn humanize_keymap(name: &str) -> String { fn humanize_keymap(name: &str) -> String {
let base = name.split('-').next().unwrap_or(name); let base = name.split('-').next().unwrap_or(name);
let language = match base { let language = match base {
@ -1564,23 +1565,60 @@ fn system_locales() -> Vec<String> {
locales.insert(locale.to_string()); locales.insert(locale.to_string());
} }
} }
let mut list: Vec<String> = locales.into_iter().take(2000).collect();
if let Some(pos) = list.iter().position(|x| x == "en_US.UTF-8") { const TOP_LOCALES: &[&str] = &[
let us = list.remove(pos); "en_US.UTF-8",
list.insert(0, us); "en_GB.UTF-8",
"de_DE.UTF-8",
"fr_FR.UTF-8",
"es_ES.UTF-8",
"es_MX.UTF-8",
"it_IT.UTF-8",
"pt_BR.UTF-8",
"pt_PT.UTF-8",
"nl_NL.UTF-8",
"pl_PL.UTF-8",
"ru_RU.UTF-8",
"uk_UA.UTF-8",
"ja_JP.UTF-8",
"zh_CN.UTF-8",
"zh_TW.UTF-8",
"ko_KR.UTF-8",
"sv_SE.UTF-8",
"nb_NO.UTF-8",
"da_DK.UTF-8",
"fi_FI.UTF-8",
"tr_TR.UTF-8",
"el_GR.UTF-8",
"cs_CZ.UTF-8",
];
let mut result = Vec::new();
let mut seen = std::collections::BTreeSet::new();
for &loc in TOP_LOCALES {
if locales.contains(loc) {
result.push(loc.to_string());
seen.insert(loc.to_string());
} }
list }
let mut remaining: Vec<String> = locales.into_iter().filter(|l| !seen.contains(l)).collect();
remaining.sort_by_key(|a| humanize_locale(a));
result.extend(remaining);
result.into_iter().take(2000).collect()
} }
/// Keyboard layouts from XKB rules (or a standard desktop fallback set). /// Structured keyboard layout options with human-readable labels from XKB rules.
fn system_keymaps() -> Vec<String> { fn system_keymap_options() -> Vec<Value> {
let mut map: std::collections::BTreeMap<String, String> = std::collections::BTreeMap::new();
for path in [ for path in [
"/usr/share/X11/xkb/rules/evdev.lst", "/usr/share/X11/xkb/rules/evdev.lst",
"/usr/share/X11/xkb/rules/base.lst", "/usr/share/X11/xkb/rules/base.lst",
] { ] {
if let Ok(content) = std::fs::read_to_string(path) { if let Ok(content) = std::fs::read_to_string(path) {
let mut in_layout = false; let mut in_layout = false;
let mut list = Vec::new();
for line in content.lines() { for line in content.lines() {
let trimmed = line.trim(); let trimmed = line.trim();
if trimmed.starts_with('!') { if trimmed.starts_with('!') {
@ -1592,31 +1630,91 @@ fn system_keymaps() -> Vec<String> {
continue; continue;
} }
if in_layout && !trimmed.is_empty() { if in_layout && !trimmed.is_empty() {
if let Some(code) = trimmed.split_whitespace().next() { let mut parts = trimmed.split_whitespace();
if let Some(code) = parts.next() {
if code != "custom" { if code != "custom" {
list.push(code.to_string()); let desc = parts.collect::<Vec<_>>().join(" ");
if !desc.is_empty() {
map.insert(code.to_string(), desc);
} }
} }
} }
} }
if !list.is_empty() {
if let Some(pos) = list.iter().position(|x| x == "us") {
let us = list.remove(pos);
list.insert(0, us);
} }
return list; if !map.is_empty() {
break;
} }
} }
} }
// Fallback list of standard desktop keyboard layouts
vec![ const TOP_KEYMAPS: &[(&str, &str)] = &[
"us", "gb", "de", "fr", "es", "latam", "it", "pt", "br", "nl", "be", "ch", "at", "dk", ("us", "English (US)"),
"no", "se", "fi", "pl", "cz", "sk", "hu", "ro", "bg", "gr", "ru", "ua", "tr", "il", "ara", ("gb", "English (UK)"),
"in", "jp", "kr", "cn", "tw", "ca", "ie", "si", "hr", "ee", "lt", "lv", "rs", "by", "kz", ("de", "German"),
"th", "vn", "ir", "az", "ge", "am", "al", "ba", "dvorak", "colemak", ("fr", "French"),
] ("es", "Spanish"),
("latam", "Spanish (Latin America)"),
("it", "Italian"),
("pt", "Portuguese"),
("br", "Portuguese (Brazil)"),
("nl", "Dutch"),
("pl", "Polish"),
("ru", "Russian"),
("ua", "Ukrainian"),
("jp", "Japanese"),
("cn", "Chinese"),
("kr", "Korean"),
("se", "Swedish"),
("no", "Norwegian"),
("dk", "Danish"),
("fi", "Finnish"),
("cz", "Czech"),
("sk", "Slovak"),
("hu", "Hungarian"),
("ro", "Romanian"),
("tr", "Turkish"),
("gr", "Greek"),
("ara", "Arabic"),
("il", "Hebrew"),
("in", "Indian"),
("dvorak", "English (Dvorak)"),
("colemak", "English (Colemak)"),
];
let mut result = Vec::new();
let mut seen = std::collections::BTreeSet::new();
for &(code, default_desc) in TOP_KEYMAPS {
let desc = map.get(code).map(|s| s.as_str()).unwrap_or(default_desc);
result.push(json!({
"value": code,
"label": format!("{desc} — {code}"),
}));
seen.insert(code.to_string());
}
let mut remaining: Vec<(String, String)> = map
.into_iter() .into_iter()
.map(String::from) .filter(|(code, _)| !seen.contains(code))
.collect();
remaining.sort_by(|a, b| a.1.cmp(&b.1));
for (code, desc) in remaining {
result.push(json!({
"value": code.clone(),
"label": format!("{desc} — {code}"),
}));
}
result
}
/// Keyboard layout codes from XKB rules (or a standard desktop fallback set).
#[allow(dead_code)]
fn system_keymaps() -> Vec<String> {
system_keymap_options()
.into_iter()
.filter_map(|v| v["value"].as_str().map(String::from))
.collect() .collect()
} }

View file

@ -33,6 +33,7 @@ Column {
signal edited(string value) signal edited(string value)
signal selected(string value) signal selected(string value)
signal opened
width: parent ? parent.width : implicitWidth width: parent ? parent.width : implicitWidth
spacing: 4 spacing: 4
@ -71,7 +72,6 @@ Column {
} }
} }
combo.filteredOptions = out; combo.filteredOptions = out;
if (combo.highlightIndex >= out.length)
combo.highlightIndex = out.length > 0 ? 0 : -1; combo.highlightIndex = out.length > 0 ? 0 : -1;
} }
@ -86,6 +86,7 @@ Column {
function forceFocus() { function forceFocus() {
combo.popupOpen = true; combo.popupOpen = true;
combo.opened();
searchField.forceActiveFocus(); searchField.forceActiveFocus();
} }
@ -151,6 +152,7 @@ Column {
onClicked: { onClicked: {
combo.popupOpen = !combo.popupOpen; combo.popupOpen = !combo.popupOpen;
if (combo.popupOpen) { if (combo.popupOpen) {
combo.opened();
searchField.text = ""; searchField.text = "";
combo.refreshFilter(); combo.refreshFilter();
searchField.forceActiveFocus(); searchField.forceActiveFocus();

View file

@ -20,8 +20,60 @@ ShellRoot {
// Set once the first handshake has created the configuration. Later // Set once the first handshake has created the configuration. Later
// handshakes (a readiness refresh or a backend restart) must not reset it. // handshakes (a readiness refresh or a backend restart) must not reset it.
property bool initialized: false property bool initialized: false
property int step: 0 property int step: 1
property string phase: "form" // form | progress | done | failed property string phase: "form" // form | progress | done | failed
function closeOtherCombos(active) {
const list = [localeField, keymapField, tzField, modelField, opencodeProviderField, opencodeModelField, opencodeVariantField];
for (let i = 0; i < list.length; i++) {
if (list[i] && list[i] !== active) {
list[i].popupOpen = false;
}
}
}
function friendlyFailureMessage(raw) {
if (!raw) return "An unexpected error occurred during installation.";
if (raw.indexOf("stage3") !== -1 || raw.indexOf("digest") !== -1 || raw.indexOf("verification failed") !== -1) {
return "The downloaded system image could not be verified against official Gentoo digests.";
}
if (raw.indexOf("network") !== -1 || raw.indexOf("curl") !== -1 || raw.indexOf("resolve") !== -1 || raw.indexOf("connect") !== -1) {
return "Network connection was interrupted while downloading installation packages.";
}
if (raw.indexOf("cryptsetup") !== -1 || raw.indexOf("luks") !== -1) {
return "Failed to set up disk encryption on the target storage device.";
}
if (raw.indexOf("btrfs") !== -1 || raw.indexOf("mkfs") !== -1 || raw.indexOf("partition") !== -1) {
return "Storage preparation error: could not partition or format the target disk.";
}
const lines = ("" + raw).split("\n");
return lines[0].replace(/^installation failed:\s*/, "");
}
Process {
id: localAiProbe
command: ["sh", "-c",
"if curl -s --max-time 1 http://127.0.0.1:4096/global/event >/dev/null 2>&1 || curl -s --max-time 1 http://127.0.0.1:4096 >/dev/null 2>&1; then " +
" echo 'OPENCODE_DETECTED'; " +
"elif curl -s --max-time 1 http://127.0.0.1:11434/api/tags >/dev/null 2>&1 || curl -s --max-time 1 http://127.0.0.1:11434 >/dev/null 2>&1; then " +
" echo 'OLLAMA_DETECTED'; " +
"fi"
]
running: false
stdout: SplitParser {
onRead: line => {
const text = ("" + line).trim();
if (text === "OPENCODE_DETECTED") {
shell.configureProvider("opencode");
} else if (text === "OLLAMA_DETECTED") {
shell.configureProvider("local");
shell.cfg.ai.endpoint = "http://127.0.0.1:11434/v1/chat/completions";
if (endpointField) endpointField.inputItem.text = shell.cfg.ai.endpoint;
shell.loadAiCatalog();
}
}
}
}
property var issues: ({}) property var issues: ({})
property string status: "" property string status: ""
property var disks: [] property var disks: []
@ -281,7 +333,8 @@ ShellRoot {
shell.cfg.ai.opencode_variant = shell.cfg.ai.opencode_variant || "default"; shell.cfg.ai.opencode_variant = shell.cfg.ai.opencode_variant || "default";
} }
shell.cfg.storage.disk = ""; shell.cfg.storage.disk = "";
shell.step = 0; shell.step = 1;
localAiProbe.running = true;
shell.phase = "form"; shell.phase = "form";
shell.status = ""; shell.status = "";
shell.syncFields(); shell.syncFields();
@ -554,7 +607,7 @@ ShellRoot {
function back() { function back() {
shell.status = ""; shell.status = "";
if (shell.step > 0) { if (shell.step > 1) {
shell.step -= 1; shell.step -= 1;
shell.enterStep(); shell.enterStep();
} }
@ -574,8 +627,11 @@ ShellRoot {
function enterStep() { function enterStep() {
shell.status = ""; shell.status = "";
const s = shell.step; const s = shell.step;
if (s === 3) if (s === 3) {
shell.ensureAiDefaults(); shell.ensureAiDefaults();
if (!shell.aiConnected)
localAiProbe.running = true;
}
shell.syncFields(); shell.syncFields();
shell.touchConfig(); shell.touchConfig();
if (s === 2) if (s === 2)
@ -1104,7 +1160,10 @@ ShellRoot {
spacing: 12 spacing: 12
focus: true focus: true
Keys.onPressed: event => { Keys.onPressed: event => {
if (event.key === Qt.Key_Right && (event.modifiers & Qt.ControlModifier)) { if (event.key >= Qt.Key_1 && event.key <= Qt.Key_6 && (event.modifiers & Qt.AltModifier)) {
shell.jumpTo(event.key - Qt.Key_0);
event.accepted = true;
} else if (event.key === Qt.Key_Right && (event.modifiers & Qt.ControlModifier)) {
shell.nextAction(); shell.nextAction();
event.accepted = true; event.accepted = true;
} else if (event.key === Qt.Key_Left && (event.modifiers & Qt.ControlModifier)) { } else if (event.key === Qt.Key_Left && (event.modifiers & Qt.ControlModifier)) {
@ -1147,7 +1206,7 @@ ShellRoot {
} }
Text { Text {
text: shell.phase === "form" text: shell.phase === "form"
? "Step " + (shell.step + 1) + " of " + shell.stepTitles.length + " · " + shell.stepTitles[shell.step] ? "Step " + shell.step + " of " + (shell.stepTitles.length - 1) + " · " + shell.stepTitles[shell.step]
: "Installation" : "Installation"
color: Theme.amber color: Theme.amber
font.family: Theme.family font.family: Theme.family
@ -1170,14 +1229,15 @@ ShellRoot {
spacing: 8 spacing: 8
visible: shell.phase === "form" visible: shell.phase === "form"
Repeater { Repeater {
model: shell.stepTitles.length model: shell.stepTitles.length - 1
delegate: Rectangle { delegate: Rectangle {
required property int index required property int index
width: index === shell.step ? 26 : 10 readonly property int stepNum: index + 1
width: stepNum === shell.step ? 26 : 10
height: 10 height: 10
radius: 5 radius: 5
color: index < shell.step ? Theme.amberDeep color: stepNum < shell.step ? Theme.amberDeep
: index === shell.step ? Theme.amber : stepNum === shell.step ? Theme.amber
: Theme.border : Theme.border
Behavior on width { NumberAnimation { duration: 120 } } Behavior on width { NumberAnimation { duration: 120 } }
} }
@ -1247,6 +1307,7 @@ ShellRoot {
placeholder: "Start typing, e.g. English" placeholder: "Start typing, e.g. English"
options: shell.options.locales options: shell.options.locales
error: shell.issueFor("locale") error: shell.issueFor("locale")
onOpened: shell.closeOtherCombos(this)
onEdited: value => shell.cfg.system.locale = value onEdited: value => shell.cfg.system.locale = value
onSelected: value => { shell.cfg.system.locale = value; shell.logState("field"); } onSelected: value => { shell.cfg.system.locale = value; shell.logState("field"); }
} }
@ -1256,8 +1317,13 @@ ShellRoot {
placeholder: "Start typing, e.g. German" placeholder: "Start typing, e.g. German"
options: shell.options.keymaps options: shell.options.keymaps
error: shell.issueFor("keymap") error: shell.issueFor("keymap")
onOpened: shell.closeOtherCombos(this)
onEdited: value => shell.cfg.system.keymap = value onEdited: value => shell.cfg.system.keymap = value
onSelected: value => { shell.cfg.system.keymap = value; shell.logState("field"); } onSelected: value => {
shell.cfg.system.keymap = value;
shell.logState("field");
Quickshell.execDetached(["sh", "-c", "localectl set-x11-keymap " + value + " 2>/dev/null || true"]);
}
} }
PhoebusCombo { PhoebusCombo {
id: tzField id: tzField
@ -1265,6 +1331,7 @@ ShellRoot {
placeholder: "Start typing, e.g. Europe" placeholder: "Start typing, e.g. Europe"
options: shell.options.timezones options: shell.options.timezones
error: shell.issueFor("timezone") error: shell.issueFor("timezone")
onOpened: shell.closeOtherCombos(this)
onEdited: value => shell.cfg.system.timezone = value onEdited: value => shell.cfg.system.timezone = value
onSelected: value => { shell.cfg.system.timezone = value; shell.logState("field"); } onSelected: value => { shell.cfg.system.timezone = value; shell.logState("field"); }
} }
@ -1317,7 +1384,7 @@ ShellRoot {
PhoebusCard { PhoebusCard {
width: parent.width width: parent.width
Text { width: parent.width; text: "Connect an AI model"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold } Text { width: parent.width; text: "Connect an AI model"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
Text { width: parent.width; text: "Phoebus is AI-first, so installation needs a connected model. Choose a hosted provider and paste your key, or point Phoebus at a model you have downloaded and are serving on this computer. The installed system boots, runs and recovers without a model."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap } Text { width: parent.width; text: "Connect to a local or remote model. For local models, leave the default loopback URL. Phoebus is AI-first, but the installed system boots, runs and recovers without a model."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap }
Text { width: parent.width; text: "What is shared: Phoebus sends only hardware and storage facts (CPU, memory, firmware, graphics vendors, the target disk path and size, and the profiles you chose) so the model can suggest fitting options. It never sends passwords, passphrases, API keys, your name, or your files."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall; wrapMode: Text.WordWrap } Text { width: parent.width; text: "What is shared: Phoebus sends only hardware and storage facts (CPU, memory, firmware, graphics vendors, the target disk path and size, and the profiles you chose) so the model can suggest fitting options. It never sends passwords, passphrases, API keys, your name, or your files."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall; wrapMode: Text.WordWrap }
PhoebusChoice { PhoebusChoice {
id: providerChoice id: providerChoice
@ -1352,6 +1419,7 @@ ShellRoot {
placeholder: "choose a model or type one" placeholder: "choose a model or type one"
options: shell.aiCatalog.models options: shell.aiCatalog.models
visible: shell.cfg && !shell.isOpenCode visible: shell.cfg && !shell.isOpenCode
onOpened: shell.closeOtherCombos(this)
onEdited: value => { shell.cfg.ai.model = value; shell.aiConnectionEdited(); } onEdited: value => { shell.cfg.ai.model = value; shell.aiConnectionEdited(); }
onSelected: value => { shell.cfg.ai.model = value; shell.aiConnectionEdited(); } onSelected: value => { shell.cfg.ai.model = value; shell.aiConnectionEdited(); }
} }
@ -1415,6 +1483,7 @@ ShellRoot {
placeholder: "choose a provider" placeholder: "choose a provider"
options: shell.aiProviderIds options: shell.aiProviderIds
visible: shell.isOpenCode visible: shell.isOpenCode
onOpened: shell.closeOtherCombos(this)
onEdited: value => { shell.cfg.ai.opencode_provider = value; shell.aiConnectionEdited(); } onEdited: value => { shell.cfg.ai.opencode_provider = value; shell.aiConnectionEdited(); }
onSelected: value => { onSelected: value => {
shell.cfg.ai.opencode_provider = value; shell.cfg.ai.opencode_provider = value;
@ -1428,6 +1497,7 @@ ShellRoot {
placeholder: "choose a model" placeholder: "choose a model"
options: shell.aiCatalog.models options: shell.aiCatalog.models
visible: shell.isOpenCode visible: shell.isOpenCode
onOpened: shell.closeOtherCombos(this)
onEdited: value => { onEdited: value => {
shell.cfg.ai.opencode_model = value; shell.cfg.ai.opencode_model = value;
shell.aiConnectionEdited(); shell.aiConnectionEdited();
@ -1445,6 +1515,7 @@ ShellRoot {
placeholder: "default" placeholder: "default"
options: shell.availableAiVariants options: shell.availableAiVariants
visible: shell.isOpenCode visible: shell.isOpenCode
onOpened: shell.closeOtherCombos(this)
onEdited: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); } onEdited: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); }
onSelected: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); } onSelected: value => { shell.cfg.ai.opencode_variant = value; shell.aiConnectionEdited(); }
} }
@ -1828,8 +1899,16 @@ ShellRoot {
compact: true compact: true
onClicked: { onClicked: {
shell.showProgressDetails = !shell.showProgressDetails; shell.showProgressDetails = !shell.showProgressDetails;
if (shell.showProgressDetails && shell.phase !== "progress") if (shell.showProgressDetails) {
Bridge.logTail(150, r => { if (r.ok) shell.logLines = r.data.lines; }); Bridge.logTail(150, r => {
if (r.ok) shell.logLines = r.data.lines;
});
Qt.callLater(() => {
if (progressFlick.contentHeight > progressFlick.height) {
progressFlick.contentY = progressFlick.contentHeight - progressFlick.height;
}
});
}
} }
} }
Rectangle { Rectangle {
@ -1906,7 +1985,7 @@ ShellRoot {
PhoebusCard { PhoebusCard {
width: parent.width width: parent.width
Text { width: parent.width; text: "What happened"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold } Text { width: parent.width; text: "What happened"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
Text { width: parent.width; text: shell.failureText; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap } Text { width: parent.width; text: shell.friendlyFailureMessage(shell.failureText); color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap }
Text { width: parent.width; text: "Disk changes: " + shell.failureDisk; color: shell.failureDisk === "yes" || shell.failureDisk === "partial" ? Theme.warning : Theme.success; font.family: Theme.family; font.pixelSize: Theme.fontBody } Text { width: parent.width; text: "Disk changes: " + shell.failureDisk; color: shell.failureDisk === "yes" || shell.failureDisk === "partial" ? Theme.warning : Theme.success; font.family: Theme.family; font.pixelSize: Theme.fontBody }
Repeater { Repeater {
model: shell.failureNext model: shell.failureNext
@ -1915,7 +1994,8 @@ ShellRoot {
} }
Row { Row {
spacing: 12 spacing: 12
PhoebusButton { label: shell.showFailureLog ? "Hide log" : "View redacted log"; onClicked: { shell.showFailureLog = !shell.showFailureLog; if (shell.showFailureLog) Bridge.logTail(200, r => { if (r.ok) shell.logLines = r.data.lines; }); } } PhoebusButton { label: "Retry"; primary: true; onClicked: shell.authorizeAndInstall() }
PhoebusButton { label: shell.showFailureLog ? "Hide technical details" : "View technical details"; onClicked: { shell.showFailureLog = !shell.showFailureLog; if (shell.showFailureLog) Bridge.logTail(200, r => { if (r.ok) shell.logLines = r.data.lines; }); } }
PhoebusButton { label: "Back to review"; onClicked: { shell.phase = "form"; shell.step = 6; shell.enterStep(); } } PhoebusButton { label: "Back to review"; onClicked: { shell.phase = "form"; shell.step = 6; shell.enterStep(); } }
PhoebusButton { label: "Restart backend"; compact: true; onClicked: shell.restartBackend() } PhoebusButton { label: "Restart backend"; compact: true; onClicked: shell.restartBackend() }
PhoebusButton { label: "Close installer"; compact: true; onClicked: shell.closeInstaller() } PhoebusButton { label: "Close installer"; compact: true; onClicked: shell.closeInstaller() }
@ -1923,7 +2003,7 @@ ShellRoot {
PhoebusCard { PhoebusCard {
width: parent.width width: parent.width
visible: shell.showFailureLog visible: shell.showFailureLog
Text { width: parent.width; text: shell.logLines.join("\n"); color: Theme.muted; font.family: "monospace"; font.pixelSize: Theme.fontSmall; wrapMode: Text.WrapAnywhere } Text { width: parent.width; text: "Technical error details:\n" + shell.failureText + "\n\nLog tail:\n" + (shell.logLines.length > 0 ? shell.logLines.join("\n") : "No log lines captured."); color: Theme.muted; font.family: "monospace"; font.pixelSize: Theme.fontSmall; wrapMode: Text.WrapAnywhere }
} }
} }
} }
@ -1948,7 +2028,7 @@ ShellRoot {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 12 spacing: 12
PhoebusButton { visible: shell.step > 0; label: "Back"; actionEnabled: shell.step > 0; onClicked: shell.back() } PhoebusButton { visible: shell.step > 1; label: "Back"; actionEnabled: shell.step > 1; onClicked: shell.back() }
PhoebusButton { PhoebusButton {
visible: shell.step < 6 visible: shell.step < 6
label: shell.step === 0 ? "Get started" : (shell.step === 2 && shell.readiness && shell.readiness.network && !shell.readiness.network_services ? "Continue anyway" : "Next") label: shell.step === 0 ? "Get started" : (shell.step === 2 && shell.readiness && shell.readiness.network && !shell.readiness.network_services ? "Continue anyway" : "Next")

View file

@ -20,7 +20,6 @@ ShellRoot {
property bool showDisplay: false property bool showDisplay: false
property bool showAdvanced: false property bool showAdvanced: false
property bool showPower: false property bool showPower: false
property bool showKeyboardTest: false
function run(cmd) { function run(cmd) {
Quickshell.execDetached(cmd); Quickshell.execDetached(cmd);
@ -321,11 +320,6 @@ ShellRoot {
onClicked: shell.run(["sh", "-c", onClicked: shell.run(["sh", "-c",
"kitty -e sh -c 'cat /usr/share/phoebus/install-help.txt 2>/dev/null || echo Help is not installed; read -r || true'"]) "kitty -e sh -c 'cat /usr/share/phoebus/install-help.txt 2>/dev/null || echo Help is not installed; read -r || true'"])
} }
PhoebusButton {
label: "Keyboard test"
compact: page.compactView
onClicked: shell.showKeyboardTest = true
}
PhoebusButton { PhoebusButton {
label: "Power" label: "Power"
compact: page.compactView compact: page.compactView
@ -488,50 +482,6 @@ ShellRoot {
} }
} }
// -- keyboard test overlay ----------------------------------------
Rectangle {
anchors.fill: parent
color: Theme.overlay
visible: shell.showKeyboardTest
MouseArea { anchors.fill: parent; onClicked: shell.showKeyboardTest = false }
PhoebusCard {
anchors.centerIn: parent
width: 520
padding: Theme.padLarge
Text {
width: parent.width
text: "Keyboard test"
color: Theme.warmWhite
font.family: Theme.family
font.pixelSize: Theme.fontTitle
font.weight: Font.DemiBold
}
Text {
width: parent.width
text: "Type in the field below to confirm your layout produces the characters you expect."
color: Theme.muted
font.family: Theme.family
font.pixelSize: Theme.fontBody
wrapMode: Text.WordWrap
}
PhoebusField {
id: keyTest
label: "Type here"
placeholder: "The quick brown fox…"
}
Row {
spacing: 12
PhoebusButton {
label: "Close"
primary: true
onClicked: shell.showKeyboardTest = false
}
}
Component.onCompleted: keyTest.inputItem.forceActiveFocus()
}
}
// -- power overlay ------------------------------------------------- // -- power overlay -------------------------------------------------
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent