From efda7106a2650da94f47e1c800b3889c759b8f83 Mon Sep 17 00:00:00 2001 From: Lef Date: Wed, 18 Nov 2026 17:06:37 +0200 Subject: [PATCH 1/3] update: the sheet's progress line wraps, Details follows the newest lines and shows pacman's live line On the phone the progress line was one elided line, so pacman's download bar was cut after the package name, and Details opened on the oldest of up to 400 lines and never showed the download (the \r bar line is a progress event, not a log line), so during a long download it looked stuck. Now: - the progress line wraps to at most 3 lines, with pacman's padding squeezed - Details shows the live bar line after the log lines - Details opens on the newest lines and follows new ones, unless the user scrolled up (until they scroll back to the end) - Details is open on the progress page and collapsed on the result page test/update-render gets a portrait progress shot with Details open. --- .../plugins/omamobile.update/Update.qml | 26 ++++++++++++++++--- packages/omamobile-shell/test/update-render | 5 ++-- .../omamobile-shell/test/update-render.qml | 13 ++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/packages/omamobile-shell/plugins/omamobile.update/Update.qml b/packages/omamobile-shell/plugins/omamobile.update/Update.qml index ee213d129..f7a146787 100644 --- a/packages/omamobile-shell/plugins/omamobile.update/Update.qml +++ b/packages/omamobile-shell/plugins/omamobile.update/Update.qml @@ -42,6 +42,7 @@ Item { property var lastResult: null property string stepText: "" property string progressText: "" + property string liveLine: "" // the transient progress line (pacman \r bar), shown at the end of Details property var detailLines: [] property bool detailsOpen: false property string authError: "" @@ -139,6 +140,8 @@ Item { detailLines = [] stepText = "Starting" progressText = "" + liveLine = "" + detailsOpen = true page = "progress" tailProc.running = false Qt.callLater(function() { tailProc.running = true }) @@ -150,14 +153,20 @@ Item { if (ev.kind === "step") { stepText = ev.text progressText = "" + liveLine = "" detailLines = UpdateModel.appendDetail(detailLines, "== " + ev.text) } else if (ev.kind === "line") { progressText = ev.text + liveLine = "" detailLines = UpdateModel.appendDetail(detailLines, ev.text) } else if (ev.kind === "progress") { - progressText = ev.text + // pacman pads its bar line with runs of spaces; squeeze them so the line fits a phone + progressText = ev.text.replace(/\s{2,}/g, " ") + liveLine = progressText } else if (ev.kind === "result") { lastResult = ev.result + liveLine = "" + detailsOpen = false // the result page keeps Details collapsed, as before page = "result" tailProc.running = false updateAvailable = false @@ -199,6 +208,8 @@ Item { recent = Date.now() - Date.parse(st.last.finished) < 30 * 60 * 1000 if (recent || statusProc.openAfter) { root.lastResult = st.last + root.liveLine = "" + root.detailsOpen = false root.page = "result" if (!root.opened && root.shell && typeof root.shell.summon === "function") root.shell.summon((root.manifest && root.manifest.id) || "omamobile.update", "{}") @@ -639,6 +650,8 @@ Item { opacity: 0.75 font.family: Style.font.family font.pixelSize: Readable.px(Style.font.caption) + wrapMode: Text.WrapAnywhere + maximumLineCount: 3 elide: Text.ElideRight } @@ -814,7 +827,14 @@ Item { contentHeight: detailsText.implicitHeight clip: true boundsBehavior: Flickable.StopAtBounds - onContentHeightChanged: if (contentHeight > height) contentY = contentHeight - height + // Follow the newest line unless the user scrolled up; opening shows the newest lines + property bool stick: true + function toEnd() { contentY = Math.max(0, contentHeight - height) } + onMovementStarted: stick = false + onMovementEnded: stick = atYEnd + onVisibleChanged: if (visible) { stick = true; toEnd() } + onHeightChanged: if (stick && !moving) toEnd() + onContentHeightChanged: if (stick && !moving) toEnd() Rectangle { width: detailsFlick.width @@ -828,7 +848,7 @@ Item { width: detailsFlick.width padding: Style.spacing.lg textFormat: Text.PlainText - text: root.detailLines.join("\n") + text: root.detailLines.concat(root.liveLine ? [root.liveLine] : []).join("\n") color: root.foreground font.family: "monospace" font.pixelSize: Readable.px(Style.font.caption - 1) diff --git a/packages/omamobile-shell/test/update-render b/packages/omamobile-shell/test/update-render index af08ab1f2..efdb9f2d2 100755 --- a/packages/omamobile-shell/test/update-render +++ b/packages/omamobile-shell/test/update-render @@ -59,6 +59,7 @@ print(json.dumps({"info": info, "result": result, "shots": [ shot("portrait", 480, 1040, "overview"), shot("landscape", 1040, 480, "overview"), shot("landscape-auth", 1040, 480, "auth"), + shot("portrait-progress", 480, 1040, "progress"), shot("landscape-progress", 1040, 480, "progress"), shot("landscape-result", 1040, 480, "result"), ]})) @@ -74,8 +75,8 @@ geo = {} for n, w, h, g in re.findall(r"geometry (\S+) (\d+)x(\d+) (\{.*\})", text): geo[n] = dict(json.loads(g), screen={"x": 0, "y": 0, "w": int(w), "h": int(h)}) def inside(a, b, tol=0): return a["x"] >= b["x"] - tol and a["y"] >= b["y"] - tol and a["x"] + a["w"] <= b["x"] + b["w"] + tol and a["y"] + a["h"] <= b["y"] + b["h"] + tol -ok = not bad and len(geo) == 5 -if len(geo) != 5: print("not ok - %s: %d of 5 shots taken" % (theme, len(geo))) +ok = not bad and len(geo) == 6 +if len(geo) != 6: print("not ok - %s: %d of 6 shots taken" % (theme, len(geo))) for l in bad: print(" " + l[:200]) def check(name, good, why=""): global ok diff --git a/packages/omamobile-shell/test/update-render.qml b/packages/omamobile-shell/test/update-render.qml index a752afffe..6b963e502 100644 --- a/packages/omamobile-shell/test/update-render.qml +++ b/packages/omamobile-shell/test/update-render.qml @@ -72,6 +72,19 @@ ShellRoot { update.stepText = "Installing 23 packages" update.progressText = "(14/23) upgrading mesa" update.page = s.page + if (s.page === "progress") { + // A long download: Details opens on the newest lines with pacman's live bar line at the end + var lines = [] + for (var i = 1; i <= 120; i++) lines.push("(" + i + "/120) upgrading package-" + i) + update.detailLines = lines + update.liveLine = "chromium-157.0.8... 74.3 MiB 124 KiB/s 06:46 [#####-------------] 41%" + update.progressText = update.liveLine + update.detailsOpen = true + } else { + update.detailLines = s.page === "result" ? ["== Update system packages", "(1/1) upgrading mesa"] : [] + update.liveLine = "" + update.detailsOpen = false + } settle.restart() } From f6fc262dc6783adf7f0828bbafd8f15e40c92b6d Mon Sep 17 00:00:00 2001 From: Lef Date: Wed, 18 Nov 2026 18:05:39 +0200 Subject: [PATCH 2/3] omamobile-shell 0.2.136 --- packages/omamobile-shell/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/omamobile-shell/version b/packages/omamobile-shell/version index 9221c8c4f..b99740362 100644 --- a/packages/omamobile-shell/version +++ b/packages/omamobile-shell/version @@ -1 +1 @@ -0.2.135 +0.2.136 From 15ba4aeae0e04b85578c5ee513fec50ceb514457 Mon Sep 17 00:00:00 2001 From: Lef Date: Wed, 18 Nov 2026 20:44:20 +0200 Subject: [PATCH 3/3] update: the progress line keeps three lines' height, and Details stays closed when you close it during a run --- .../omamobile-shell/plugins/omamobile.update/Update.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-shell/plugins/omamobile.update/Update.qml b/packages/omamobile-shell/plugins/omamobile.update/Update.qml index f7a146787..fecb9c8c8 100644 --- a/packages/omamobile-shell/plugins/omamobile.update/Update.qml +++ b/packages/omamobile-shell/plugins/omamobile.update/Update.qml @@ -141,7 +141,9 @@ Item { stepText = "Starting" progressText = "" liveLine = "" - detailsOpen = true + // Details opens for a new run; following the same run again (a status + // refresh, reopening the sheet) keeps what the user chose. + if (page !== "progress") detailsOpen = true page = "progress" tailProc.running = false Qt.callLater(function() { tailProc.running = true }) @@ -645,11 +647,16 @@ Item { Text { width: parent.width textFormat: Text.PlainText + // three lines are kept for it, so Details under it doesn't move + // when the line wraps to two or three + height: Math.ceil(progressMetrics.lineSpacing * 3) text: root.progressText color: root.foreground opacity: 0.75 font.family: Style.font.family font.pixelSize: Readable.px(Style.font.caption) + FontMetrics { id: progressMetrics; font.family: Style.font.family; font.pixelSize: Readable.px(Style.font.caption) } + verticalAlignment: Text.AlignTop wrapMode: Text.WrapAnywhere maximumLineCount: 3 elide: Text.ElideRight