From d008f5682d4ba80dd4500944b22531c4a7bf3a6e Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 16 Jun 2026 07:36:18 +0000 Subject: [PATCH] fix(launcher): truncate download status labels to stop dialog blowout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Ettore Di Giacinto Assisted-by: Claude:claude-opus-4-8 [Claude Code] --- 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 0b5592fcc74c..291c57b451e0 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 4881fce88921..8188c923fce0 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 7efd781d9b8a..422238eb7425 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() {