From 8bd2df8f686b311d80c2d15984b5d94f9f76c08d Mon Sep 17 00:00:00 2001 From: "LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Tue, 16 Jun 2026 09:42:07 +0200 Subject: [PATCH] fix(launcher): truncate download status labels to stop progress dialog blowout (#10357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(launcher): truncate download status labels to stop dialog blowout The download progress windows place a ProgressBar and a status Label in the same VBox. On failure the status label is set to "Download failed: ", and the error commonly contains a long, unbreakable URL/path. A Fyne label with default settings reports its MinSize as the full single-line text width, so a long message stretches the window — and the progress bar sharing the VBox — arbitrarily wide (fixes #10355). Set Truncation = fyne.TextTruncateEllipsis on the four affected status labels (the main-window status label plus the status label in each of the three showDownloadProgress implementations). Truncation collapses the label's MinSize to roughly one character plus the ellipsis regardless of content, so the window keeps its intended size. TextWrapWord is not enough because it cannot break a spaceless URL. The full error text remains visible via the dialog.ShowError call already present in each path. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- cmd/launcher/internal/launcher.go | 5 ++++- cmd/launcher/internal/systray_manager.go | 5 ++++- cmd/launcher/internal/ui.go | 15 +++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cmd/launcher/internal/launcher.go b/cmd/launcher/internal/launcher.go index 0b5592fcc..291c57b45 100644 --- a/cmd/launcher/internal/launcher.go +++ b/cmd/launcher/internal/launcher.go @@ -635,8 +635,11 @@ func (l *Launcher) showDownloadProgress(version, title string) { progressBar := widget.NewProgressBar() progressBar.SetValue(0) - // Status label + // Status label. Truncate with an ellipsis so a long "Download failed: + // " message can't stretch the window (and progress bar) to fit the + // whole error on one line; the full error is shown in the dialog below. statusLabel := widget.NewLabel("Preparing download...") + statusLabel.Truncation = fyne.TextTruncateEllipsis // Release notes button releaseNotesButton := widget.NewButton("View Release Notes", func() { diff --git a/cmd/launcher/internal/systray_manager.go b/cmd/launcher/internal/systray_manager.go index 4881fce88..8188c923f 100644 --- a/cmd/launcher/internal/systray_manager.go +++ b/cmd/launcher/internal/systray_manager.go @@ -454,8 +454,11 @@ func (sm *SystrayManager) showDownloadProgress(version string) { progressBar := widget.NewProgressBar() progressBar.SetValue(0) - // Status label + // Status label. Truncate with an ellipsis so a long "Download failed: + // " message can't stretch the window (and progress bar) to fit the + // whole error on one line; the full error is shown in the dialog below. statusLabel := widget.NewLabel("Preparing download...") + statusLabel.Truncation = fyne.TextTruncateEllipsis // Release notes button releaseNotesButton := widget.NewButton("View Release Notes", func() { diff --git a/cmd/launcher/internal/ui.go b/cmd/launcher/internal/ui.go index 7efd781d9..422238eb7 100644 --- a/cmd/launcher/internal/ui.go +++ b/cmd/launcher/internal/ui.go @@ -57,8 +57,16 @@ type LauncherUI struct { // NewLauncherUI creates a new UI instance func NewLauncherUI() *LauncherUI { + // Truncate the status text with an ellipsis. Status messages can carry a + // download error containing a long, unbreakable URL/path; without this the + // label demands the full single-line width and stretches the window (and + // the progress bar) arbitrarily wide. The full error is still shown in the + // error dialog. + statusLabel := widget.NewLabel("Initializing...") + statusLabel.Truncation = fyne.TextTruncateEllipsis + return &LauncherUI{ - statusLabel: widget.NewLabel("Initializing..."), + statusLabel: statusLabel, versionLabel: widget.NewLabel("Version: Unknown"), startStopButton: widget.NewButton("Start LocalAI", nil), webUIButton: widget.NewButton("Open WebUI", nil), @@ -602,8 +610,11 @@ func (ui *LauncherUI) showDownloadProgress(version, title string) { progressBar := widget.NewProgressBar() progressBar.SetValue(0) - // Status label + // Status label. Truncate with an ellipsis so a long "Download failed: + // " message can't stretch the window (and progress bar) to fit the + // whole error on one line; the full error is shown in the dialog below. statusLabel := widget.NewLabel("Preparing download...") + statusLabel.Truncation = fyne.TextTruncateEllipsis // Release notes button releaseNotesButton := widget.NewButton("View Release Notes", func() {