phoebus_os/installer/live/desktop/common/PhoebusButton.qml
Phoebus 34c12d3dd8 feat(installer): rebuild the graphical journey and fix interaction defects
Rework the graphical installer into a fixed first-time-user sequence
(Welcome, Language and keyboard, Internet and readiness, AI connection,
Destination disk, Account and encryption, Review and confirmation,
Installation, Completion) with configuration, validation, plans, approval
and execution still authoritative in Rust.

Fix the audited interaction defects: readiness `Re-check` is a read-only
probe that no longer resets the step or clears the disk; model catalogs are
fetched after syncing the edited settings and credentials and stale replies
are ignored; editing a connection field invalidates the validated state;
suggestion lists support arrow/Enter/Escape with a visible highlight and
accessibility; the keyboard step labels the live-session limitation
truthfully; readiness separates the local link from reachable install
services; and busy states always clear, with the bridge failing outstanding
requests when the backend exits.

Add human-readable language/keyboard names, an explicit AI change review
(Accept/Discard), backend-fact review with edit links, real stage progress
with elapsed time and activity, and clearer failure and completion guidance.

Extend the VM harness with a `gui-install` mode that drives the whole
journey through the visible controls, plus regressions for readiness
refresh, disk survival, keyboard suggestion selection and AI invalidation.
Add Rust tests for readiness, the network probe, error kinds and labels.
2026-09-22 08:17:03 -07:00

68 lines
2.2 KiB
Bash

import QtQuick
// A keyboard-focusable, branded button. Primary buttons are amber; secondary
// buttons are a raised surface. Focus is always visible.
Rectangle {
id: btn
property string label: ""
property bool primary: false
property bool danger: false
property bool compact: false
property bool actionEnabled: true
signal clicked
readonly property bool hovered: mouse.containsMouse
readonly property color baseBg: {
if (danger)
return Qt.darker(Theme.danger, 1.25);
if (primary)
return hovered ? Theme.amber : Theme.amberDeep;
return hovered ? Theme.surfaceRaised : Theme.surface;
}
implicitHeight: compact ? Theme.controlHeightCompact : Theme.controlHeightLarge
implicitWidth: Math.max(compact ? 80 : 120, labelText.implicitWidth + (compact ? 28 : 48))
radius: Theme.radiusSmall
color: actionEnabled ? baseBg : Theme.surface
border.width: (primary || danger) ? 0 : 1
border.color: activeFocus ? Theme.focusRing : Theme.border
opacity: actionEnabled ? 1 : 0.55
activeFocusOnTab: true
Accessible.role: Accessible.Button
Accessible.name: label
Accessible.onPressAction: if (actionEnabled) btn.clicked()
Keys.onReturnPressed: if (btn.actionEnabled) btn.clicked()
Keys.onEnterPressed: if (btn.actionEnabled) btn.clicked()
Keys.onSpacePressed: if (btn.actionEnabled) btn.clicked()
Rectangle {
anchors.fill: parent
anchors.margins: -3
radius: btn.radius + 3
color: "transparent"
border.width: 2
border.color: Theme.focusRing
visible: btn.activeFocus
}
Text {
id: labelText
anchors.centerIn: parent
text: btn.label
color: (btn.primary || btn.danger) ? Theme.charcoal : Theme.warmWhite
font.family: Theme.family
font.pixelSize: btn.compact ? Theme.fontSmall : Theme.fontBody
font.weight: btn.primary ? Font.DemiBold : Font.Normal
}
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
enabled: btn.actionEnabled
onClicked: btn.clicked()
}
}