From d46669426aa6b0ece71d0d05d0b6f2966686b17a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 16 Jul 2025 20:38:22 +0300 Subject: feat: add custom image prompt support and keyboard shortcuts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add text area next to image display for custom image generation prompts - Users can specify their own prompts or leave empty for auto-generation - Display the used prompt in the text area after generation - Load prompts from attribution files when navigating to existing cards - Add keyboard shortcuts for all GUI buttons: - G: Generate, N: New Word, I: Regenerate Image, A: Regenerate Audio - R: Regenerate All, D: Delete, P: Play audio - Left/Right arrows: Navigate between words - Y/N: Confirm/cancel delete dialog - Update UI layout with equal 50/50 split between image and prompt - Enable text wrapping in prompt text area - Add 25% chance to ask OpenAI for creative photo style suggestions - Fix concurrent processing to properly use custom prompts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- internal/gui/queue.go | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'internal/gui/queue.go') diff --git a/internal/gui/queue.go b/internal/gui/queue.go index 7b1c5de..aaa0c55 100644 --- a/internal/gui/queue.go +++ b/internal/gui/queue.go @@ -9,15 +9,16 @@ import ( // WordJob represents a single word processing job type WordJob struct { - ID int - Word string - Translation string - AudioFile string - ImageFiles []string - Status JobStatus - Error error - StartedAt time.Time - CompletedAt time.Time + ID int + Word string + Translation string + AudioFile string + ImageFiles []string + Status JobStatus + Error error + StartedAt time.Time + CompletedAt time.Time + CustomPrompt string // Custom prompt for image generation } // JobStatus represents the current state of a job @@ -93,11 +94,17 @@ func (q *WordQueue) SetCallbacks(onStatusUpdate func(*WordJob), onJobComplete fu // AddWord adds a word to the processing queue func (q *WordQueue) AddWord(word string) *WordJob { + return q.AddWordWithPrompt(word, "") +} + +// AddWordWithPrompt adds a word to the processing queue with a custom prompt +func (q *WordQueue) AddWordWithPrompt(word, customPrompt string) *WordJob { q.mu.Lock() job := &WordJob{ - ID: q.nextID, - Word: word, - Status: StatusQueued, + ID: q.nextID, + Word: word, + Status: StatusQueued, + CustomPrompt: customPrompt, } q.nextID++ q.results[job.ID] = job -- cgit v1.2.3