fix: Tooltip live preview bar immediately shows session ended#135
Merged
fix: Tooltip live preview bar immediately shows session ended#135
Conversation
…n ended state - Guard showTooltipComponent failure in routeLoaded so live preview sessions break instead of calling resetTooltipState, keeping the preview bar active for the user to adjust settings - Prevent updatePreviewBarMessage/updatePreviewBarStep from mutating state after the session has already ended - Add tests for clearPreviewBarMessage session-ended guards
djanhjo
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a tooltip message is loaded in live preview mode, the preview bar immediately shows "Preview session ended" with a reload countdown instead of displaying the interactive controls.
Root Cause
Two issues:
routeLoadedhandler — WhenshowTooltipComponent()returnedfalse(e.g. positioning failed, target off-screen),resetTooltipState()was called unconditionally, which invokesclearPreviewBarMessage()and ends the session. The "target not found" branch already had a live-preview guard that skips the reset; the "positioning failed" branch was missing it.updatePreviewBarMessage/updatePreviewBarStep— These could overwrite theisSessionEndedflag afterclearPreviewBarMessage()had already been called, causing inconsistent state. Now they early-return if the session has ended.Changes
message-manager.ts— Added live-preview guard to the!tooltipVisiblebranch inrouteLoaded, matching the existing pattern for the!targetFoundcase.preview-bar-manager.ts—updatePreviewBarMessageandupdatePreviewBarStepnow bail early whenisSessionEndedis true.preview-bar-manager.test.ts— Added tests forclearPreviewBarMessagesession-ended guards.Note
Low Risk
Low risk: small conditional/guard changes limited to live-preview tooltip handling and preview-bar state updates, with added tests to prevent regressions.
Overview
Prevents live-preview tooltip failures from immediately ending the preview session: when
showTooltipComponent()can’t position a tooltip,message-managernow skipsresetTooltipState()in live preview so the preview bar remains usable.Hardens preview-bar state by making
updatePreviewBarMessageandupdatePreviewBarStepno-ops afterclearPreviewBarMessage()has marked the session ended, and adds tests covering the session-ended UI/countdown and these guards.Written by Cursor Bugbot for commit 1f11b7b. This will update automatically on new commits. Configure here.