fix(launcher): truncate download status labels to stop progress dialog blowout#10357
Merged
Conversation
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: <error>", 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 <mudler@localai.io> Assisted-by: Claude:claude-opus-4-8 [Claude Code]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10355
Problem
In the desktop launcher, the download progress dialog grows too wide and the progress bar stretches "to infinity" when a download fails. The width grows in proportion to the length of the
Download failed: …message.Root cause
The launcher is a Fyne app. Each download progress window places a
widget.ProgressBarand a statuswidget.Labelin the sameVBox. On failure the status label is set to"Download failed: <error>", and the error commonly contains a long, unbreakable URL/path. A Fyne label with default settings reports itsMinSizeas the full single-line text width, so a long message forces the window — and the progress bar sharing the VBox — arbitrarily wide.Fix
Set
Truncation = fyne.TextTruncateEllipsison the four affected status labels:NewLauncherUI), whichUpdateStatussets to"Failed to download update: <error>", andshowDownloadProgressimplementations (ui.go,launcher.go,systray_manager.go).With ellipsis truncation, the label's
MinSizecollapses to roughly one character plus the ellipsis regardless of content, so the window keeps its intended 400×250 size.TextWrapWordis not sufficient because it cannot break a spaceless URL. The full error text remains visible via thedialog.ShowErrorcall already present in each code path.Testing
gofmtclean;fyne.TextTruncateEllipsismatches thewidget.Label.Truncationfield type (mirrors the existingwelcomeLabel.Wrapping = fyne.TextWrapWordusage in the same file).make build-launcherin CI.Assisted-by: Claude:claude-opus-4-8 [Claude Code]