import QtQuick import qs.Commons import qs.Ui // RenameStage.qml - Rename: the file moves, and state.json follows if it is in use. // // 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 === "presetRename" spacing: Style.space(7) Text { width: parent.width text: "Rename '" + stage.panel.editPreset + "'" color: Color.popups.text elide: Text.ElideRight font.family: stage.panel.uiFont font.pixelSize: Style.space(13) font.bold: true } TextField { id: renameField width: parent.width text: stage.panel.renameTo placeholderText: "new name" foreground: Color.popups.text font.family: stage.panel.uiFont font.pixelSize: Style.space(11) onTextChanged: stage.panel.renameTo = text onAccepted: stage.panel.renamePreset() } Text { width: parent.width readonly property string problem: stage.panel.stage === "presetRename" ? stage.panel.nameProblem(stage.panel.renameTo, stage.panel.editPreset) : "" visible: problem !== "" text: problem color: stage.panel.urgentColor wrapMode: Text.WordWrap font.family: stage.panel.uiFont font.pixelSize: Style.space(10) } Text { width: parent.width visible: stage.panel.editIsActive text: "It is the preset in use. The switch follows the new name, and running sessions keep working." color: Color.muted wrapMode: Text.WordWrap font.family: stage.panel.uiFont font.pixelSize: Style.space(10) } Flow { width: parent.width spacing: Style.space(7) PillButton { fontFamily: stage.panel.uiFont; label: "Rename"; primary: true; onTriggered: stage.panel.renamePreset() } PillButton { fontFamily: stage.panel.uiFont; label: "Back"; onTriggered: { stage.panel.lastError = ""; stage.panel.stage = "preset" } } } Connections { target: stage.panel function onRenameOpened() { renameField.text = stage.panel.renameTo Qt.callLater(function () { renameField.forceActiveFocus(); renameField.selectAll() }) } } }