Split the bar panel into one QML file per stage

Panel.qml keeps the state, the CLI calls and the stage switch (889 lines,
was 2360); each stage is its own file taking the panel as a required
property. The omarchy installer copies every QML/JS file and clears stale
ones. tests/static.sh filters qmllint on [syntax], not the word error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
smoido
2026-09-15 02:12:49 +03:00
co-authored by Claude Opus 5
parent 4091746d4e
commit bb01418ce0
17 changed files with 1717 additions and 1510 deletions
@@ -0,0 +1,92 @@
import QtQuick
import qs.Commons
import qs.Ui
// BlockedStage.qml - Preflight refused. Name the missing thing and offer the one action that fixes it, rather than failing the click silently.
//
// One stage of the claude-mode panel. Panel.qml hands itself in as `panel`
// and owns all the state and actions; this file only draws them.
Column {
id: stage
required property var panel
width: parent.width
visible: stage.panel.stage === "blocked" && stage.panel.blocker !== null
spacing: Style.space(7)
Text {
width: parent.width
text: stage.panel.blocker ? String(stage.panel.blocker.title) : ""
color: stage.panel.urgentColor
wrapMode: Text.WordWrap
font.family: stage.panel.uiFont
font.pixelSize: Style.space(13)
font.bold: true
}
Text {
width: parent.width
text: stage.panel.blocker ? String(stage.panel.blocker.detail) : ""
color: Color.popups.text
wrapMode: Text.WordWrap
lineHeight: 1.2
font.family: stage.panel.uiFont
font.pixelSize: Style.space(11)
}
Text {
width: parent.width
visible: stage.panel.blocker && String(stage.panel.blocker.remedy) !== ""
text: stage.panel.blocker ? "$ " + String(stage.panel.blocker.remedy) : ""
color: Color.muted
wrapMode: Text.WrapAnywhere
font.family: stage.panel.uiFont
font.pixelSize: Style.space(10)
}
// Flow, not Row: these can total more than the card is wide, and a
// Row lays them straight past its right edge instead of wrapping.
Flow {
width: parent.width
spacing: Style.space(7)
PillButton { fontFamily: stage.panel.uiFont;
label: "Set up " + stage.panel.pTitle(stage.panel.pendingMode) + "…"
primary: true
visible: stage.panel.blocker && String(stage.panel.blocker.remedyKind) === "setup"
onTriggered: stage.panel.runSetup()
}
PillButton { fontFamily: stage.panel.uiFont;
label: "Store the key…"
primary: true
visible: stage.panel.blocker && String(stage.panel.blocker.remedyKind) === "set-key"
onTriggered: stage.panel.runRemedy()
}
// A preset with every tier empty: the fix is one click away here,
// not in a terminal.
PillButton { fontFamily: stage.panel.uiFont;
label: "Edit preset…"
primary: true
visible: stage.panel.blocker && String(stage.panel.blocker.remedyKind) === "edit-preset"
onTriggered: {
var p = stage.panel.pendingPreset
stage.panel.resetFlow()
stage.panel.openPresetEditor(p)
}
}
PillButton { fontFamily: stage.panel.uiFont;
label: "Server settings…"
primary: stage.panel.blocker && ["start-server", "set-url", "needs-key"].indexOf(String(stage.panel.blocker.remedyKind)) >= 0
visible: stage.panel.serverEditable(stage.panel.pendingMode)
&& !(stage.panel.blocker && String(stage.panel.blocker.remedyKind) === "setup")
onTriggered: stage.panel.openServerSettings(stage.panel.pendingPreset)
}
PillButton { fontFamily: stage.panel.uiFont;
label: stage.panel.blocker && ["start-server", "setup"].indexOf(String(stage.panel.blocker.remedyKind)) >= 0
? "Check again" : "Try again"
primary: stage.panel.blocker && String(stage.panel.blocker.remedyKind) === "start-server"
onTriggered: stage.panel.retryPending()
}
PillButton { fontFamily: stage.panel.uiFont; label: "Cancel"; onTriggered: stage.panel.resetFlow() }
}
}