From 953bfb44a81084149fc47d984afcbee059e5d27b Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sun, 28 Dec 2025 06:30:48 -0500 Subject: [PATCH] fix(author): Clear DVD title when loading new file or clearing clips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reset authorTitle when loading new file via file browser - Reset authorTitle when clearing all clips - Rebuild author view to refresh title entry UI - Ensures title field visually resets for fresh content 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- author_module.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/author_module.go b/author_module.go index 88bf2f8..7ee7a1e 100644 --- a/author_module.go +++ b/author_module.go @@ -381,6 +381,19 @@ func buildChaptersTab(state *appState) fyne.CanvasObject { } state.authorFile = src fileLabel.SetText(fmt.Sprintf("File: %s", filepath.Base(src.Path))) + // Clear the custom title so it can be re-derived from the new content. + // This addresses the user's request for the title to "reset". + state.authorTitle = "" + state.updateAuthorSummary() + // Update the UI for the title entry if the settings tab is currently visible. + if state.active == "author" && state.window.Canvas() != nil { + app := fyne.CurrentApp() + if app != nil && app.Driver() != nil { + app.Driver().DoFromGoroutine(func() { + state.showAuthorView() // Rebuild the module to refresh titleEntry + }, false) + } + } state.loadEmbeddedChapters(path) refreshChapters() }, state.window) @@ -886,7 +899,20 @@ func (s *appState) addAuthorFiles(paths []string) { s.authorChapters = nil s.authorChapterSource = "" } + s.authorTitle = "" s.updateAuthorSummary() + // Update the UI for the title entry if the settings tab is currently visible. + // This ensures the title entry visually resets as well. + if s.active == "author" && s.window.Canvas() != nil { + app := fyne.CurrentApp() + if app != nil && app.Driver() != nil { + app.Driver().DoFromGoroutine(func() { + // Rebuild the settings tab to refresh its controls. + // This is a bit heavy, but ensures the titleEntry reflects the change. + s.showAuthorView() + }, false) + } + } } func (s *appState) updateAuthorSummary() {