From 387ced77126db28ed205868543119768be2e61b3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 3 Apr 2026 10:48:51 +0300 Subject: fix: show full phonetic IPA in audio player bar Two issues prevented the IPA from being fully displayed: 1. audio_player.go: switched the bottom bar from NewHBox to NewBorder so the phonetic label fills the centre column instead of being squeezed to its minimum width between the stop button and the status label. Also enabled TextWrapWord so very long IPA strings wrap rather than being clipped. 2. phonetic/fetcher.go: raised MaxOutputTokens from 50 to 200 so Gemini 2.5 Flash has enough budget to emit the full IPA bracket pair without truncation. Co-Authored-By: Claude Sonnet 4.6 --- internal/gui/audio_player.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'internal') diff --git a/internal/gui/audio_player.go b/internal/gui/audio_player.go index 1f599d9..ddd67d6 100644 --- a/internal/gui/audio_player.go +++ b/internal/gui/audio_player.go @@ -12,7 +12,6 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" - "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" ttwidget "github.com/dweymouth/fyne-tooltip/widget" @@ -67,12 +66,13 @@ func NewAudioPlayer() *AudioPlayer { p.statusLabel = widget.NewLabel("No audio loaded") - // Create phonetic label + // Create phonetic label — wraps so long IPA strings are never clipped. p.phoneticLabel = widget.NewLabel("") p.phoneticLabel.TextStyle = fyne.TextStyle{ Bold: true, Italic: true, } + p.phoneticLabel.Wrapping = fyne.TextWrapWord // Initially disable controls p.playButton.Disable() @@ -81,17 +81,15 @@ func NewAudioPlayer() *AudioPlayer { p.playBackLabel.Hide() p.stopButton.Disable() - // Create main container with phonetic display - p.container = container.NewHBox( - container.NewVBox( - container.NewHBox(p.playButton, p.playButtonLabel), - container.NewHBox(p.playBackButton, p.playBackLabel), - ), - p.stopButton, - p.phoneticLabel, - layout.NewSpacer(), - p.statusLabel, + // Layout: buttons on the left, status on the right, phonetic fills the middle. + // Using NewBorder so the phonetic label expands horizontally rather than being + // squeezed to its minimum width in an HBox. + buttons := container.NewVBox( + container.NewHBox(p.playButton, p.playButtonLabel), + container.NewHBox(p.playBackButton, p.playBackLabel), ) + leftControls := container.NewHBox(buttons, p.stopButton) + p.container = container.NewBorder(nil, nil, leftControls, p.statusLabel, p.phoneticLabel) p.ExtendBaseWidget(p) return p -- cgit v1.2.3