From 6e5c7d999f5ed98c09eac0126c45ab912ebb5e96 Mon Sep 17 00:00:00 2001 From: Phoebus Date: Wed, 23 Sep 2026 05:42:03 -0700 Subject: [PATCH] feat(installer): overhaul GUI to 6-step flow and resilient UX - 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 --- docs/CHANGELOG.md | 34 ++++ docs/HANDOFF.md | 37 ++--- installer-rs/crates/phoebus-ai/src/lib.rs | 51 +++++- .../crates/phoebus-ai/src/provider.rs | 13 +- .../phoebus-installer/src/gui_bridge.rs | 152 ++++++++++++++---- .../live/desktop/common/PhoebusCombo.qml | 6 +- .../live/desktop/phoebus-install/shell.qml | 116 ++++++++++--- .../live/desktop/phoebus-welcome/shell.qml | 50 ------ 8 files changed, 335 insertions(+), 124 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 09ac915..a1ec3bf 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,40 @@ All notable changes are recorded here. The authoritative history is `git log`; 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 - **Display Resolution Switcher & Hotkeys (`phoebus-welcome`, Mango config):** diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 15124c7..44cd854 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -3,26 +3,27 @@ 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. -- **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:** - 1. Low-Resolution Responsiveness & Scrollability: wrapped `phoebus-welcome` and - `phoebus-install` form/progress views in bounded `Flickable` containers with - `ScrollBar.vertical`. Added compact view adaptation (< 760px) in `phoebus-welcome` - with flow-wrapped readiness chips, resolving text/control clipping on 800×600 - and 640×480 displays. - 2. 1-Click Display Resolution Modal & Hotkeys: added a dedicated Display Resolution - dialog to `phoebus-welcome` (and hotkeys `Super+Shift+F12` for 1080p, `F11` for 900p, - `F10` for 768p, `F9` for 1024x768) that applies native modes via `wlr-randr`, - 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. + 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. + 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. + 3. Cleaned Welcome Screen: removed redundant "Keyboard test" button and modal from live welcome app. + 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. + 5. Direct Review & Confirmation: replaced typing "ERASE" in all caps and checkboxes with a direct "Install now" button on the review screen. + 6. Subsystem & Desktop Invariants: enforced Mango + DMS desktop, Btrfs filesystem, and Flatpak/Nix in both AI prompt and validator. + 7. Local AI Auto-Detection & Guidance: auto-probes ports 4096 (OpenCode) and 11434 (Ollama), replaces technical jargon with friendly instructions. + 8. Humanized Error Handling: calm, user-friendly failure explanations with [Retry] and [View technical details] buttons; working live details box with auto-scroll. - **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` finished with 0 errors (pre-existing warnings only). - All tests pass for `phoebus-core` (142), `phoebus-ai` (35), diff --git a/installer-rs/crates/phoebus-ai/src/lib.rs b/installer-rs/crates/phoebus-ai/src/lib.rs index b1e1e04..4806a32 100644 --- a/installer-rs/crates/phoebus-ai/src/lib.rs +++ b/installer-rs/crates/phoebus-ai/src/lib.rs @@ -210,6 +210,30 @@ impl ProposedChange { validate::validate_package_atom(atom)?; 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(()), } } @@ -438,7 +462,7 @@ mod tests { "changes": [ {"action": "set_hostname", "value": "box"}, {"action": "set_encryption", "value": "luks2"}, - {"action": "set_desktop_profile", "value": "dwl"} + {"action": "set_desktop_profile", "value": "mango"} ] }"#; let proposal = parse_proposal(text).unwrap(); @@ -447,7 +471,30 @@ mod tests { assert_eq!(applied.len(), 3); assert_eq!(config.system.hostname, "box"); 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] diff --git a/installer-rs/crates/phoebus-ai/src/provider.rs b/installer-rs/crates/phoebus-ai/src/provider.rs index 71a9e86..4be62d0 100644 --- a/installer-rs/crates/phoebus-ai/src/provider.rs +++ b/installer-rs/crates/phoebus-ai/src/provider.rs @@ -224,9 +224,8 @@ pub const SYSTEM_PROMPT: &str = "\ 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: set_hostname, set_timezone, set_locale, set_keymap, set_username, set_target_disk, -set_filesystem (btrfs|ext4), set_encryption (none|luks2), set_kernel_profile -(safe|optimized|aggressive), set_package_policy (balanced|source_first|binary_first), -set_desktop_profile (mango), +set_encryption (none|luks2), set_kernel_profile (safe|optimized|aggressive), +set_package_policy (balanced|source_first|binary_first), set_desktop_profile (mango), set_binary_packages (bool), set_build_jobs (1-256), set_package_use (atom, flag, 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 option in `value`; never use the action name as a key. Correct examples: {\"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_build_jobs\",\"value\":4} Rules: prefer stability and a proven boot over speculative performance; never propose disabling signature verification, enabling ~amd64 globally, weakening 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 -core subsystems of Phoebus OS (never propose disabling, toggling, or removing them); +atoms; Flatpak, Nix, Btrfs filesystem, and the Mango + DMS desktop profile are required, +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 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."; @@ -492,7 +491,7 @@ mod tests { fn facts() -> SystemFacts { let mut config = InstallConfig::default(); - config.desktop.profile = phoebus_core::DesktopProfile::Dwl; + config.desktop.profile = phoebus_core::DesktopProfile::Mango; let hardware = HardwareReport { cpu: CpuInfo { model: "Test CPU".into(), diff --git a/installer-rs/crates/phoebus-installer/src/gui_bridge.rs b/installer-rs/crates/phoebus-installer/src/gui_bridge.rs index 5bb2931..e93a43e 100644 --- a/installer-rs/crates/phoebus-installer/src/gui_bridge.rs +++ b/installer-rs/crates/phoebus-installer/src/gui_bridge.rs @@ -370,7 +370,7 @@ impl Bridge { Ok(json!({ "timezones": labeled_options(system_timezones(), humanize_timezone), "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 // about whether a selection affects the running graphical session. "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 /// name kept so an advanced user can still see exactly what will be set. +#[allow(dead_code)] fn humanize_keymap(name: &str) -> String { let base = name.split('-').next().unwrap_or(name); let language = match base { @@ -1564,23 +1565,60 @@ fn system_locales() -> Vec { locales.insert(locale.to_string()); } } - let mut list: Vec = locales.into_iter().take(2000).collect(); - if let Some(pos) = list.iter().position(|x| x == "en_US.UTF-8") { - let us = list.remove(pos); - list.insert(0, us); + + const TOP_LOCALES: &[&str] = &[ + "en_US.UTF-8", + "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 = 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). -fn system_keymaps() -> Vec { +/// Structured keyboard layout options with human-readable labels from XKB rules. +fn system_keymap_options() -> Vec { + let mut map: std::collections::BTreeMap = std::collections::BTreeMap::new(); for path in [ "/usr/share/X11/xkb/rules/evdev.lst", "/usr/share/X11/xkb/rules/base.lst", ] { if let Ok(content) = std::fs::read_to_string(path) { let mut in_layout = false; - let mut list = Vec::new(); for line in content.lines() { let trimmed = line.trim(); if trimmed.starts_with('!') { @@ -1592,32 +1630,92 @@ fn system_keymaps() -> Vec { continue; } 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" { - list.push(code.to_string()); + let desc = parts.collect::>().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![ - "us", "gb", "de", "fr", "es", "latam", "it", "pt", "br", "nl", "be", "ch", "at", "dk", - "no", "se", "fi", "pl", "cz", "sk", "hu", "ro", "bg", "gr", "ru", "ua", "tr", "il", "ara", - "in", "jp", "kr", "cn", "tw", "ca", "ie", "si", "hr", "ee", "lt", "lv", "rs", "by", "kz", - "th", "vn", "ir", "az", "ge", "am", "al", "ba", "dvorak", "colemak", - ] - .into_iter() - .map(String::from) - .collect() + + const TOP_KEYMAPS: &[(&str, &str)] = &[ + ("us", "English (US)"), + ("gb", "English (UK)"), + ("de", "German"), + ("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() + .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 { + system_keymap_options() + .into_iter() + .filter_map(|v| v["value"].as_str().map(String::from)) + .collect() } /// The OpenAI-compatible model-list URL for a chat-completions endpoint. diff --git a/installer/live/desktop/common/PhoebusCombo.qml b/installer/live/desktop/common/PhoebusCombo.qml index 8548e11..d096fa7 100644 --- a/installer/live/desktop/common/PhoebusCombo.qml +++ b/installer/live/desktop/common/PhoebusCombo.qml @@ -33,6 +33,7 @@ Column { signal edited(string value) signal selected(string value) + signal opened width: parent ? parent.width : implicitWidth spacing: 4 @@ -71,8 +72,7 @@ Column { } } combo.filteredOptions = out; - if (combo.highlightIndex >= out.length) - combo.highlightIndex = out.length > 0 ? 0 : -1; + combo.highlightIndex = out.length > 0 ? 0 : -1; } function choose(val, lbl) { @@ -86,6 +86,7 @@ Column { function forceFocus() { combo.popupOpen = true; + combo.opened(); searchField.forceActiveFocus(); } @@ -151,6 +152,7 @@ Column { onClicked: { combo.popupOpen = !combo.popupOpen; if (combo.popupOpen) { + combo.opened(); searchField.text = ""; combo.refreshFilter(); searchField.forceActiveFocus(); diff --git a/installer/live/desktop/phoebus-install/shell.qml b/installer/live/desktop/phoebus-install/shell.qml index e50d2d8..19bc8d6 100644 --- a/installer/live/desktop/phoebus-install/shell.qml +++ b/installer/live/desktop/phoebus-install/shell.qml @@ -20,8 +20,60 @@ ShellRoot { // Set once the first handshake has created the configuration. Later // handshakes (a readiness refresh or a backend restart) must not reset it. property bool initialized: false - property int step: 0 + property int step: 1 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 string status: "" property var disks: [] @@ -281,7 +333,8 @@ ShellRoot { shell.cfg.ai.opencode_variant = shell.cfg.ai.opencode_variant || "default"; } shell.cfg.storage.disk = ""; - shell.step = 0; + shell.step = 1; + localAiProbe.running = true; shell.phase = "form"; shell.status = ""; shell.syncFields(); @@ -554,7 +607,7 @@ ShellRoot { function back() { shell.status = ""; - if (shell.step > 0) { + if (shell.step > 1) { shell.step -= 1; shell.enterStep(); } @@ -574,8 +627,11 @@ ShellRoot { function enterStep() { shell.status = ""; const s = shell.step; - if (s === 3) + if (s === 3) { shell.ensureAiDefaults(); + if (!shell.aiConnected) + localAiProbe.running = true; + } shell.syncFields(); shell.touchConfig(); if (s === 2) @@ -1104,7 +1160,10 @@ ShellRoot { spacing: 12 focus: true 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(); event.accepted = true; } else if (event.key === Qt.Key_Left && (event.modifiers & Qt.ControlModifier)) { @@ -1147,7 +1206,7 @@ ShellRoot { } Text { 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" color: Theme.amber font.family: Theme.family @@ -1170,14 +1229,15 @@ ShellRoot { spacing: 8 visible: shell.phase === "form" Repeater { - model: shell.stepTitles.length + model: shell.stepTitles.length - 1 delegate: Rectangle { required property int index - width: index === shell.step ? 26 : 10 + readonly property int stepNum: index + 1 + width: stepNum === shell.step ? 26 : 10 height: 10 radius: 5 - color: index < shell.step ? Theme.amberDeep - : index === shell.step ? Theme.amber + color: stepNum < shell.step ? Theme.amberDeep + : stepNum === shell.step ? Theme.amber : Theme.border Behavior on width { NumberAnimation { duration: 120 } } } @@ -1247,6 +1307,7 @@ ShellRoot { placeholder: "Start typing, e.g. English" options: shell.options.locales error: shell.issueFor("locale") + onOpened: shell.closeOtherCombos(this) onEdited: value => shell.cfg.system.locale = value onSelected: value => { shell.cfg.system.locale = value; shell.logState("field"); } } @@ -1256,8 +1317,13 @@ ShellRoot { placeholder: "Start typing, e.g. German" options: shell.options.keymaps error: shell.issueFor("keymap") + onOpened: shell.closeOtherCombos(this) 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 { id: tzField @@ -1265,6 +1331,7 @@ ShellRoot { placeholder: "Start typing, e.g. Europe" options: shell.options.timezones error: shell.issueFor("timezone") + onOpened: shell.closeOtherCombos(this) onEdited: value => shell.cfg.system.timezone = value onSelected: value => { shell.cfg.system.timezone = value; shell.logState("field"); } } @@ -1317,7 +1384,7 @@ ShellRoot { PhoebusCard { 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: "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 } PhoebusChoice { id: providerChoice @@ -1352,6 +1419,7 @@ ShellRoot { placeholder: "choose a model or type one" options: shell.aiCatalog.models visible: shell.cfg && !shell.isOpenCode + onOpened: shell.closeOtherCombos(this) onEdited: 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" options: shell.aiProviderIds visible: shell.isOpenCode + onOpened: shell.closeOtherCombos(this) onEdited: value => { shell.cfg.ai.opencode_provider = value; shell.aiConnectionEdited(); } onSelected: value => { shell.cfg.ai.opencode_provider = value; @@ -1428,6 +1497,7 @@ ShellRoot { placeholder: "choose a model" options: shell.aiCatalog.models visible: shell.isOpenCode + onOpened: shell.closeOtherCombos(this) onEdited: value => { shell.cfg.ai.opencode_model = value; shell.aiConnectionEdited(); @@ -1445,6 +1515,7 @@ ShellRoot { placeholder: "default" options: shell.availableAiVariants visible: shell.isOpenCode + onOpened: shell.closeOtherCombos(this) onEdited: 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 onClicked: { shell.showProgressDetails = !shell.showProgressDetails; - if (shell.showProgressDetails && shell.phase !== "progress") - Bridge.logTail(150, r => { if (r.ok) shell.logLines = r.data.lines; }); + if (shell.showProgressDetails) { + 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 { @@ -1906,7 +1985,7 @@ ShellRoot { PhoebusCard { 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: 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 } Repeater { model: shell.failureNext @@ -1915,7 +1994,8 @@ ShellRoot { } Row { 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: "Restart backend"; compact: true; onClicked: shell.restartBackend() } PhoebusButton { label: "Close installer"; compact: true; onClicked: shell.closeInstaller() } @@ -1923,7 +2003,7 @@ ShellRoot { PhoebusCard { width: parent.width 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.verticalCenter: parent.verticalCenter 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 { 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") diff --git a/installer/live/desktop/phoebus-welcome/shell.qml b/installer/live/desktop/phoebus-welcome/shell.qml index bdaffe6..15ea623 100644 --- a/installer/live/desktop/phoebus-welcome/shell.qml +++ b/installer/live/desktop/phoebus-welcome/shell.qml @@ -20,7 +20,6 @@ ShellRoot { property bool showDisplay: false property bool showAdvanced: false property bool showPower: false - property bool showKeyboardTest: false function run(cmd) { Quickshell.execDetached(cmd); @@ -321,11 +320,6 @@ ShellRoot { 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'"]) } - PhoebusButton { - label: "Keyboard test" - compact: page.compactView - onClicked: shell.showKeyboardTest = true - } PhoebusButton { label: "Power" 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 ------------------------------------------------- Rectangle { anchors.fill: parent