From de81c9f999f29634fb61dccee5e67d450c38ddca Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Mon, 29 Dec 2025 22:02:35 -0500 Subject: [PATCH] Add clear completed button to all module top bars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added clearCompletedJobs() method to appState in main.go - Clears only completed and failed jobs, keeps pending/running/paused - Added small ⌫ (backspace) icon button next to View Queue in all modules - Button has LowImportance styling to keep it subtle - Implements Jake's suggestion for quick queue cleanup Modules updated: - Convert (main.go) - Author (author_module.go) - Subtitles (subtitles_module.go) - Rip (rip_module.go) - Filters (filters_module.go) - Thumbnails (thumb_module.go) - Inspect (inspect_module.go) Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- author_module.go | 7 ++++++- filters_module.go | 7 ++++++- inspect_module.go | 8 +++++++- main.go | 13 +++++++++++++ rip_module.go | 7 ++++++- subtitles_module.go | 7 ++++++- thumb_module.go | 8 +++++++- 7 files changed, 51 insertions(+), 6 deletions(-) diff --git a/author_module.go b/author_module.go index 7ee7a1e..3110bce 100644 --- a/author_module.go +++ b/author_module.go @@ -156,7 +156,12 @@ func buildAuthorView(state *appState) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() - topBar := ui.TintedBar(authorColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + + topBar := ui.TintedBar(authorColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) bottomBar := moduleFooter(authorColor, layout.NewSpacer(), state.statsBar) tabs := container.NewAppTabs( diff --git a/filters_module.go b/filters_module.go index 6cc6ce0..63af8b9 100644 --- a/filters_module.go +++ b/filters_module.go @@ -36,8 +36,13 @@ func buildFiltersView(state *appState) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + // Top bar with module color - topBar := ui.TintedBar(filtersColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + topBar := ui.TintedBar(filtersColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) bottomBar := moduleFooter(filtersColor, layout.NewSpacer(), state.statsBar) // Instructions diff --git a/inspect_module.go b/inspect_module.go index 5b976f3..6e60d09 100644 --- a/inspect_module.go +++ b/inspect_module.go @@ -42,7 +42,13 @@ func buildInspectView(state *appState) fyne.CanvasObject { }) state.queueBtn = queueBtn state.updateQueueButtonLabel() - topBar := ui.TintedBar(inspectColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + + topBar := ui.TintedBar(inspectColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) bottomBar := moduleFooter(inspectColor, layout.NewSpacer(), state.statsBar) // Instructions diff --git a/main.go b/main.go index 365a07b..19fb73e 100644 --- a/main.go +++ b/main.go @@ -1745,6 +1745,13 @@ func (s *appState) showQueue() { s.startQueueAutoRefresh() } +// clearCompletedJobs removes all completed and failed jobs from the queue +func (s *appState) clearCompletedJobs() { + if s.jobQueue != nil { + s.jobQueue.Clear() + } +} + // refreshQueueView rebuilds the queue UI while preserving scroll position and inline active conversion. func (s *appState) refreshQueueView() { if s.active == "queue" { @@ -6344,6 +6351,11 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + // Command Preview toggle button cmdPreviewBtn := widget.NewButton("Command Preview", func() { state.convertCommandPreviewShow = !state.convertCommandPreviewShow @@ -6367,6 +6379,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { navButtons, layout.NewSpacer(), cmdPreviewBtn, + clearCompletedBtn, queueBtn, } diff --git a/rip_module.go b/rip_module.go index 0034a25..aec352b 100644 --- a/rip_module.go +++ b/rip_module.go @@ -115,7 +115,12 @@ func buildRipView(state *appState) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() - topBar := ui.TintedBar(ripColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + + topBar := ui.TintedBar(ripColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) bottomBar := moduleFooter(ripColor, layout.NewSpacer(), state.statsBar) sourceEntry := widget.NewEntry() diff --git a/subtitles_module.go b/subtitles_module.go index 041fec8..95cd980 100644 --- a/subtitles_module.go +++ b/subtitles_module.go @@ -134,7 +134,12 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject { state.queueBtn = queueBtn state.updateQueueButtonLabel() - topBar := ui.TintedBar(subtitlesColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + + topBar := ui.TintedBar(subtitlesColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) bottomBar := moduleFooter(subtitlesColor, layout.NewSpacer(), state.statsBar) videoEntry := widget.NewEntry() diff --git a/thumb_module.go b/thumb_module.go index afce2b4..ec321fe 100644 --- a/thumb_module.go +++ b/thumb_module.go @@ -42,7 +42,13 @@ func buildThumbView(state *appState) fyne.CanvasObject { }) state.queueBtn = queueBtn state.updateQueueButtonLabel() - topBar := ui.TintedBar(thumbColor, container.NewHBox(backBtn, layout.NewSpacer(), queueBtn)) + + clearCompletedBtn := widget.NewButton("⌫", func() { + state.clearCompletedJobs() + }) + clearCompletedBtn.Importance = widget.LowImportance + + topBar := ui.TintedBar(thumbColor, container.NewHBox(backBtn, layout.NewSpacer(), clearCompletedBtn, queueBtn)) // Instructions instructions := widget.NewLabel("Generate thumbnails from a video file. Load a video and configure settings.")