From c698a193450ddc75285a8749f65d691eb994384f Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Fri, 24 Oct 2025 13:36:26 +0200 Subject: [PATCH] Improves timed prompt notification duration calculation Refines notification display duration for timed prompts to handle both short and long delay intervals Adjusts duration calculation to: - Cap notifications at 500ms for very short delays - Subtract 500ms from longer delays to prevent prompt overlap - Ensures smoother user experience during prompt sequences --- commands/timedPrompts.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/timedPrompts.ts b/commands/timedPrompts.ts index 1d9607a..39bb338 100644 --- a/commands/timedPrompts.ts +++ b/commands/timedPrompts.ts @@ -169,8 +169,9 @@ export class TimedPromptsCommand { const totalPrompts = this.promptQueue.length; // Calculate notification duration: slightly less than delay to avoid overlap - // Subtract 500ms to allow for fade-out before next prompt appears - const notificationDuration = Math.max(1000, (delaySeconds * 1000) - 500); + // For very short delays (<=1s), cap at 500ms; otherwise end 500ms before next tick + const delayMs = delaySeconds * 1000; + const notificationDuration = delayMs > 1000 ? (delayMs - 500) : 500; const notice = new Notice( `Writing Prompt ${promptNumber}/${totalPrompts}:\n\n${prompt}`,