Skip to content

fix: Tooltip live preview bar immediately shows session ended#135

Merged
karngyan merged 1 commit intodevelopfrom
inapp-14314
Mar 26, 2026
Merged

fix: Tooltip live preview bar immediately shows session ended#135
karngyan merged 1 commit intodevelopfrom
inapp-14314

Conversation

@karngyan
Copy link
Copy Markdown
Member

@karngyan karngyan commented Mar 26, 2026

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:

  1. routeLoaded handler — When showTooltipComponent() returned false (e.g. positioning failed, target off-screen), resetTooltipState() was called unconditionally, which invokes clearPreviewBarMessage() 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.

  2. updatePreviewBarMessage / updatePreviewBarStep — These could overwrite the isSessionEnded flag after clearPreviewBarMessage() 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 !tooltipVisible branch in routeLoaded, matching the existing pattern for the !targetFound case.
  • preview-bar-manager.tsupdatePreviewBarMessage and updatePreviewBarStep now bail early when isSessionEnded is true.
  • preview-bar-manager.test.ts — Added tests for clearPreviewBarMessage session-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-manager now skips resetTooltipState() in live preview so the preview bar remains usable.

Hardens preview-bar state by making updatePreviewBarMessage and updatePreviewBarStep no-ops after clearPreviewBarMessage() 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.

…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
@karngyan karngyan requested a review from a team as a code owner March 26, 2026 19:35
@karngyan karngyan merged commit ea42ab0 into develop Mar 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants