From 2e3ccc03468677e9129832e5267e45c6d7865612 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Thu, 18 Dec 2025 09:59:34 -0500 Subject: [PATCH] Make command preview collapsible and show actual file paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made the FFmpeg command preview less intrusive by adding a toggle button and showing actual file paths instead of placeholders. Changes: - Added convertCommandPreviewShow state field to track preview visibility - Added "Command Preview" toggle button next to "View Queue" button - Command preview now hidden by default to save screen space - Preview shows actual input/output file paths instead of INPUT/OUTPUT - Cover art paths also shown with real file path when present This makes the interface cleaner while providing more useful information when the preview is needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- main.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 735eba9..ab098fd 100644 --- a/main.go +++ b/main.go @@ -688,8 +688,9 @@ type appState struct { compareFile2 *videoSource inspectFile *videoSource inspectInterlaceResult *interlace.DetectionResult - inspectInterlaceAnalyzing bool - autoCompare bool // Auto-load Compare module after conversion + inspectInterlaceAnalyzing bool + autoCompare bool // Auto-load Compare module after conversion + convertCommandPreviewShow bool // Show FFmpeg command preview in Convert module // Merge state mergeClips []mergeClip @@ -5064,7 +5065,14 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() - backBar := ui.TintedBar(convertColor, container.NewHBox(back, layout.NewSpacer(), navButtons, layout.NewSpacer(), queueBtn)) + // Command Preview toggle button + cmdPreviewBtn := widget.NewButton("Command Preview", func() { + state.convertCommandPreviewShow = !state.convertCommandPreviewShow + state.showModule("convert") + }) + cmdPreviewBtn.Importance = widget.LowImportance + + backBar := ui.TintedBar(convertColor, container.NewHBox(back, layout.NewSpacer(), navButtons, layout.NewSpacer(), cmdPreviewBtn, queueBtn)) var updateCover func(string) var coverDisplay *widget.Label @@ -6737,7 +6745,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { var commandPreviewRow *fyne.Container buildCommandPreview := func() { - if src == nil { + if src == nil || !state.convertCommandPreviewShow { if commandPreviewRow != nil { commandPreviewRow.Hide() } @@ -6790,6 +6798,13 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { } cmdStr := buildFFmpegCommandFromJob(job) + // Replace INPUT and OUTPUT placeholders with actual file paths for preview + inputPath := src.Path + outputPath := state.convert.OutputFile() + cmdStr = strings.ReplaceAll(cmdStr, "INPUT", inputPath) + cmdStr = strings.ReplaceAll(cmdStr, "OUTPUT", outputPath) + cmdStr = strings.ReplaceAll(cmdStr, "[COVER_ART]", state.convert.CoverArtPath) + if commandPreviewWidget == nil { commandPreviewWidget = ui.NewFFmpegCommandWidget(cmdStr, state.window) commandLabel := widget.NewLabel("FFmpeg Command Preview:") @@ -6897,7 +6912,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { snippetRow, widget.NewSeparator(), } - if commandPreviewRow != nil { + if commandPreviewRow != nil && state.convertCommandPreviewShow { footerSections = append(footerSections, commandPreviewRow) }