Skip to content

Commit 833f265

Browse files
alex-spataruclaude
andcommitted
@
fix(ai): make welcome-card suggestion chips respond to hover The chips never highlighted on mouse-over: the chat transcript overlay (opacity 0 when the conversation is empty) hosts a WebEngineView that captures native hover/mouse events even while disabled, sitting on top of the welcome card. Raise the welcome card with z: 1 so it receives events, and drive the chip via a Rectangle + hoverEnabled MouseArea. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> @
1 parent f2aad5e commit 833f265

1 file changed

Lines changed: 34 additions & 29 deletions

File tree

app/qml/AI/AssistantPanel.qml

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Widgets.SmartDialog {
8484
Rectangle {
8585
id: welcomeCard
8686

87+
z: 1
8788
radius: 12
8889
visible: root.conversationEmpty
8990
width: Math.min(parent.width - 32, 680)
@@ -274,41 +275,45 @@ Widgets.SmartDialog {
274275
Repeater {
275276
model: welcomeCard.displayedSuggestions
276277

277-
delegate: AbstractButton {
278+
delegate: Rectangle {
278279
id: chip
279280

280-
padding: 0
281-
contentItem: Item {}
281+
radius: 14
282282
Layout.fillWidth: true
283283
Layout.preferredHeight: chipText.implicitHeight + 12
284-
background: Rectangle {
285-
radius: 14
286-
color: chip.hovered
287-
? Cpp_ThemeManager.colors["alternate_base"]
288-
: Cpp_ThemeManager.colors["base"]
289-
border.width: 1
290-
border.color: Cpp_ThemeManager.colors["groupbox_border"]
291-
292-
Label {
293-
id: chipText
294-
295-
anchors.fill: parent
296-
anchors.leftMargin: 11
297-
anchors.rightMargin: 11
298-
horizontalAlignment: Text.AlignHCenter
299-
verticalAlignment: Text.AlignVCenter
300-
elide: Text.ElideRight
301-
text: modelData
302-
font: Cpp_Misc_CommonFonts.customUiFont(0.9, false)
303-
color: Cpp_ThemeManager.colors["text"]
304-
}
284+
border.width: 1
285+
border.color: Cpp_ThemeManager.colors["groupbox_border"]
286+
color: chipArea.containsMouse
287+
? Cpp_ThemeManager.colors["alternate_base"]
288+
: Cpp_ThemeManager.colors["base"]
289+
290+
Label {
291+
id: chipText
292+
293+
anchors.fill: parent
294+
anchors.leftMargin: 11
295+
anchors.rightMargin: 11
296+
horizontalAlignment: Text.AlignHCenter
297+
verticalAlignment: Text.AlignVCenter
298+
elide: Text.ElideRight
299+
text: modelData
300+
font: Cpp_Misc_CommonFonts.customUiFont(0.9, false)
301+
color: Cpp_ThemeManager.colors["text"]
305302
}
306-
onClicked: {
307-
if (Cpp_AI_Assistant.busy)
308-
return
309303

310-
composer.clear()
311-
Cpp_AI_Assistant.sendMessage(modelData)
304+
MouseArea {
305+
id: chipArea
306+
307+
hoverEnabled: true
308+
anchors.fill: parent
309+
cursorShape: Qt.PointingHandCursor
310+
onClicked: {
311+
if (Cpp_AI_Assistant.busy)
312+
return
313+
314+
composer.clear()
315+
Cpp_AI_Assistant.sendMessage(modelData)
316+
}
312317
}
313318
}
314319
}

0 commit comments

Comments
 (0)