Enhances notification display logic to prevent flicker and ensure minimum visibility
- Adds floor of 0 for delay milliseconds to prevent negative values
- Ensures minimum notification duration of 300ms to improve user experience
- Maintains existing logic for longer delay times
Refines notification display timing logic to prevent flickering and ensure smoother user experience
Adjusts notification duration calculation for short delays, using a more nuanced approach that:
- Caps notification time at 900ms or delay-100ms for very short intervals
- Maintains existing behavior for longer delays
Enhances execution flow to prevent race conditions during async prompt generation
Refines inProgress flag management to ensure reliable concurrent execution:
- Sets flag before async work begins
- Guarantees flag reset in finally block
- Prevents potential state inconsistencies during rapid command triggers
Clarifies code comments explaining concurrency protection mechanism
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
Reorders initialization of in-progress flag to prevent potential race conditions during timed prompt generation
Ensures that the in-progress status is set before stopping existing sequences and generates prompts
Prevents multiple simultaneous timed prompt generations by displaying a notice when an operation is already in progress
Improves user experience by providing clear feedback during concurrent prompt generation attempts
Adds a flag to prevent the timed prompt execution from running concurrently, avoiding potential race conditions and unexpected behavior.
Also, addresses edge case in the status check where the displayed current prompt number could be inaccurate.