Add clear completed button to all module top bars

- 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 <noreply@anthropic.com>
This commit is contained in:
Stu Leak 2025-12-29 22:02:35 -05:00
parent 16767a5ca6
commit de81c9f999
7 changed files with 51 additions and 6 deletions

View File

@ -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(

View File

@ -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

View File

@ -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

13
main.go
View File

@ -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,
}

View File

@ -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()

View File

@ -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()

View File

@ -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.")