Skip to content

Add dismiss button to float teaser bubble#72

Merged
LEVI-RIVKIN merged 1 commit into
mainfrom
claude/float-teaser-dismiss-ihimeh
Jul 13, 2026
Merged

Add dismiss button to float teaser bubble#72
LEVI-RIVKIN merged 1 commit into
mainfrom
claude/float-teaser-dismiss-ihimeh

Conversation

@LEVI-RIVKIN

@LEVI-RIVKIN LEVI-RIVKIN commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Customers reported that the float teaser bubble could only be closed by engaging with the agent (clicking the launcher to open the chat). This adds an × dismiss button so users can close the teaser without opening the chat.

  • Adds an × button to the teaser bubble (top-right corner, aria-label="Dismiss message", with a :focus-visible outline matching the other close controls). Clicking it stops propagation so it never opens the chat.
  • Dismissing removes the teaser and the notification dot, and cancels any pending welcome-sequence timers.
  • A dismissal persists in sessionStorage (keyed by host + researchId), so page navigations within the session don't bring the teaser — or its chime — back. A new browser session shows it again.
  • Guards the welcome-sequence state machine so a later update() (e.g. async API config arriving) cannot re-arm a teaser the user already dismissed.

Configuration

Dismissible by default. Opt out via any of the existing config paths:

  • teaser: { dismissible: false } (programmatic / React prop)
  • data-perspective-teaser-dismissible="false" (declarative)
  • API embedSettings.teaser.dismissible (dashboard, takes precedence)

Changes

  • float.ts — dismiss button, dismissTeaser(), and the dismissed-state gate in the welcome sequence
  • state.tsget/setPersistedTeaserDismissed session-storage helpers (mirrors the existing open-state persistence)
  • styles.ts — themed button styles (hover + focus-visible) reusing the existing --perspective-teaser-* / --perspective-close-* variables (light + dark)
  • types.ts, constants.ts, browser.tsdismissible on TeaserConfig and the new data attribute
  • READMEs (both packages) + a minor-version changeset

Testing

  • 455 unit tests pass (6 new): dismiss removes the teaser + dot without opening the chat (incl. aria-label), re-arm prevention after a config update, cross-mount session persistence (incl. chime suppression), per-researchId scoping, the dismissible: false opt-out, and data-perspective-teaser-dismissible parsing.
  • Verified end-to-end in Chromium (Playwright): 11/11 checks across light/dark themes and the opt-out, confirming the teaser dismisses without opening the chat and stays dismissed across a reload.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📦 Snapshot Release

Published snapshot packages for this PR:

pnpm add @perspective-ai/sdk@1.15.0-pr-72-20260713153600
pnpm add @perspective-ai/sdk-react@1.15.0-pr-72-20260713153600

Or use the npm tag (always points to the latest snapshot from this PR):

pnpm add @perspective-ai/sdk@pr-72
pnpm add @perspective-ai/sdk-react@pr-72

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a user-facing dismiss (“×”) control to the float welcome teaser so users can close the teaser (and notification dot) without opening the chat, with the dismissal persisted for the current browser session to prevent re-arming on navigation or later config updates.

Changes:

  • Adds teaser dismiss UX + session-persisted dismissed gating in the float welcome-sequence.
  • Introduces teaser.dismissible configuration across programmatic config, data attributes, and API-merged settings.
  • Updates styling, tests, and documentation (SDK + React SDK) and ships a minor-version changeset.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/sdk/src/types.ts Extends TeaserConfig with dismissible option.
packages/sdk/src/styles.ts Adds CSS for the teaser dismiss button.
packages/sdk/src/state.ts Adds sessionStorage helpers for persisted teaser dismissal state.
packages/sdk/src/float.ts Implements dismiss button behavior, persistence, and welcome-sequence gating.
packages/sdk/src/float.test.ts Adds unit tests covering dismiss behavior, persistence, scoping, and opt-out.
packages/sdk/src/constants.ts Adds data attribute + storage key constants for teaser dismissibility/dismissal.
packages/sdk/src/browser.ts Parses data-perspective-teaser-dismissible="false" into config.
packages/sdk/src/browser.test.ts Adds test for the new data attribute parsing.
packages/sdk/README.md Documents dismiss behavior and new config/data attribute.
packages/sdk-react/README.md Documents React usage of teaser.dismissible.
.changeset/float-teaser-dismiss.md Declares minor releases and summarizes the feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/sdk/src/styles.ts
Customers reported the float teaser could only be closed by opening the
chat. This adds an × dismiss button so users can close the teaser (and
its notification dot) without engaging the agent.

- The × sits at the teaser's top-right corner with aria-label
  "Dismiss message" and a focus-visible outline matching the other
  close controls. Its click stops propagation so it never opens the chat.
- Dismissing removes the teaser and notification dot and cancels any
  pending welcome-sequence timers.
- The dismissal persists in sessionStorage (keyed by host + researchId),
  so navigations within the session don't re-show the teaser or replay
  its chime; a new browser session shows it again.
- The welcome-sequence state machine is gated on the dismissed flag so a
  later update() (e.g. async API config) cannot re-arm a dismissed teaser.

Configurable via teaser.dismissible (default true),
data-perspective-teaser-dismissible="false", and the API
embedSettings.teaser merge. Includes unit tests, browser QA, README
updates for both packages, and a minor-version changeset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5HfdvRNFRnuTtdSFt49c7
@LEVI-RIVKIN LEVI-RIVKIN force-pushed the claude/float-teaser-dismiss-ihimeh branch from 9429481 to 30483ae Compare July 13, 2026 15:35
@LEVI-RIVKIN LEVI-RIVKIN requested a review from vinaypuppal July 13, 2026 15:39
@LEVI-RIVKIN LEVI-RIVKIN merged commit 8ab6fc8 into main Jul 13, 2026
5 checks passed
@LEVI-RIVKIN LEVI-RIVKIN deleted the claude/float-teaser-dismiss-ihimeh branch July 13, 2026 17:02
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.

3 participants