From 0783c7dda30c626416cebad6c40bcd42df9738fc Mon Sep 17 00:00:00 2001
From: Levi Neely <141506390+lneely@users.noreply.github.com>
Date: Thu, 16 Jul 2026 06:36:00 +0200
Subject: [PATCH] fix scroll height and prose line breaks in rich output
- Loader delegate: set explicit height from item.implicitHeight so
ListView can calculate correct contentHeight for scrolling
- Prose sub-blocks: escape HTML, convert newlines to
before
linkifying paths (RichText ignores bare newlines)
---
gui/main.qml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gui/main.qml b/gui/main.qml
index 397b4a9..baedc49 100644
--- a/gui/main.qml
+++ b/gui/main.qml
@@ -393,6 +393,7 @@ ApplicationWindow {
delegate: Loader {
width: chatList.width
+ height: item ? item.implicitHeight : 0
property var block: model
sourceComponent: {
switch (blockType) {
@@ -499,8 +500,13 @@ ApplicationWindow {
// --- Chat block delegates ---
function linkifyPaths(text) {
+ // Escape HTML entities first
+ let escaped = text.replace(/&/g, '&').replace(//g, '>')
+ // Convert newlines to
+ escaped = escaped.replace(/\n/g, '
')
// Match /absolute/path or /absolute/path:line
- return text.replace(/(\/[\w\-.\/]+(?::\d+)?)/g, '$1')
+ escaped = escaped.replace(/(\/[\w\-.\/]+(?::\d+)?)/g, '$1')
+ return escaped
}
Component {