diff --git a/ChatView/qml/RootItem.qml b/ChatView/qml/RootItem.qml index 6763f95..a478e28 100644 --- a/ChatView/qml/RootItem.qml +++ b/ChatView/qml/RootItem.qml @@ -272,6 +272,7 @@ ChatRootView { id: chatItemInstance width: parent.width + chatViewport: chatListView msgModel: root.chatModel.processMessageContent(model.content) messageAttachments: model.attachments messageImages: model.images diff --git a/ChatView/qml/chatparts/ChatItem.qml b/ChatView/qml/chatparts/ChatItem.qml index 9aa0ada..ef7774f 100644 --- a/ChatView/qml/chatparts/ChatItem.qml +++ b/ChatView/qml/chatparts/ChatItem.qml @@ -30,6 +30,7 @@ Rectangle { property int textFontSize: Qt.application.font.pointSize property int codeFontSize: Qt.application.font.pointSize property int textFormat: 0 + property Flickable chatViewport: null property bool isUserMessage: false property int messageIndex: -1 @@ -259,6 +260,7 @@ Rectangle { language: itemData.language codeFontFamily: root.codeFontFamily codeFontSize: root.codeFontSize + viewport: root.chatViewport } component AttachmentComponent : Rectangle { diff --git a/ChatView/qml/chatparts/CodeBlock.qml b/ChatView/qml/chatparts/CodeBlock.qml index f704c6f..cfb5ec2 100644 --- a/ChatView/qml/chatparts/CodeBlock.qml +++ b/ChatView/qml/chatparts/CodeBlock.qml @@ -13,6 +13,7 @@ Rectangle { property string code: "" property string language: "" property bool expanded: false + property Flickable viewport: null property alias codeFontFamily: codeText.font.family property alias codeFontSize: codeText.font.pointSize @@ -122,7 +123,16 @@ Rectangle { anchors.right: parent.right anchors.rightMargin: 5 - y: 5 + y: { + if (!root.expanded || !root.viewport) + return 5 + const flick = root.viewport + const topInContent = root.mapToItem(flick.contentItem, 0, 0).y + const topInView = topInContent - flick.contentY + const desired = topInView < 0 ? (-topInView + 5) : 5 + const maxY = Math.max(5, root.height - copyButton.height - 5) + return Math.max(5, Math.min(desired, maxY)) + } text: qsTr("Copy") onClicked: { diff --git a/settings/ConfigurationManager.cpp b/settings/ConfigurationManager.cpp index 82ace28..b090c63 100644 --- a/settings/ConfigurationManager.cpp +++ b/settings/ConfigurationManager.cpp @@ -35,9 +35,9 @@ QVector ConfigurationManager::getPredefinedConfigurations( AIConfiguration claudeOpus; claudeOpus.id = "preset_claude_opus"; - claudeOpus.name = "Claude Opus 4.6"; + claudeOpus.name = "Claude Opus 4.7"; claudeOpus.provider = "Claude"; - claudeOpus.model = "claude-opus-4-6"; + claudeOpus.model = "claude-opus-4-7"; claudeOpus.url = "https://api.anthropic.com"; claudeOpus.customEndpoint = ""; claudeOpus.templateName = "Claude"; @@ -101,9 +101,9 @@ QVector ConfigurationManager::getPredefinedConfigurations( AIConfiguration gpt; gpt.id = "preset_gpt"; - gpt.name = "gpt-5.4"; + gpt.name = "gpt-5.5"; gpt.provider = "OpenAI (Responses API)"; - gpt.model = "gpt-5.4"; + gpt.model = "gpt-5.5"; gpt.url = "https://api.openai.com/v1"; gpt.customEndpoint = ""; gpt.templateName = "OpenAI Responses";