Skip to content

fix: proactive teaser scroll trigger, jump-back-down chip, and on-topic replies - #240

Open
HardeepAsrani wants to merge 1 commit into
developmentfrom
fix/proactive-scroll-and-prompt
Open

fix: proactive teaser scroll trigger, jump-back-down chip, and on-topic replies#240
HardeepAsrani wants to merge 1 commit into
developmentfrom
fix/proactive-scroll-and-prompt

Conversation

@HardeepAsrani

@HardeepAsrani HardeepAsrani commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

Code-side items from Codeinwp/hyve#299 (the knowledge base edits from that issue are content tasks on the site itself).

Proactive message now fires for already-scrolled visitors. The scroll trigger only checked the depth when a scroll event fired, so a visitor who was already past the configured depth when the widget loaded (arrived via an anchor link, the browser restored their scroll position, or the page is shorter than the viewport) never saw the teaser. The depth is now also checked once when the trigger arms.

New: jump back to the latest message. When a visitor scrolls up through a long conversation, a small arrow chip appears above the input; clicking it returns them to the bottom. It hides on its own near the bottom or when a new reply arrives, stays out of keyboard focus while hidden, and its label is translatable.

The bot stays on topic. Asking it to perform a general-purpose task the site content does not cover (the issue's example: "fix this CSS") now gets the not-answered fallback instead of a generated answer. This matches the product positioning that answers come from the knowledge base and avoids unneeded API usage. The same rule ships to Hyve Connect so hosted sites behave identically.

Note: the issue's "looks vs appears" search-matching item is addressed by the retrieval changes in #239.

QA instructions

  1. In Pro settings, set the proactive message trigger to scroll at 50% depth.
  2. Open a long page fresh and scroll halfway down: the teaser should appear next to the launcher.
  3. Open the same page via an anchor link deep into the page (or reload while scrolled down): the teaser should appear right away, without scrolling further. Before this fix it never showed.
  4. Open a page shorter than the browser window: the teaser should appear on load.
  5. Have a longer chat conversation, then scroll up through the history: a round arrow button should appear above the input. Click it: the chat returns to the newest message and the button disappears.
  6. While scrolled up, send a message: the chat jumps to the reply and the button disappears.
  7. Ask the bot to do something unrelated to the site content, e.g. "fix this CSS: .style{color:blue}": it should reply with the standard cannot-help fallback instead of fixing the code.
  8. Ask a normal question the knowledge base covers: answered as usual.

…n chip, on-topic prompt

The proactive teaser's scroll trigger only evaluated on scroll events,
so a visitor already past the configured depth when it armed (anchor
link, restored scroll position, page shorter than the viewport) never
saw it; it now also evaluates once at arm time. The chat window gains
a jump-back-down chip that appears when the visitor scrolls up through
the conversation and returns them to the latest message. The system
prompt gains an explicit rule declining general-purpose tasks (fixing
code, translating, generating unrelated content) that the site content
does not cover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pirate-bot

Copy link
Copy Markdown
Contributor

🌍 i18n String Review Report

📊 Summary

Category Count
➕ Added 1
➖ Removed 0
🔄 Changed 0
Total 1
➕ Added Strings (1) - Click to expand
String Location Words Suggested Match
Scroll to the latest messages inc/Main.php:809 5 No close match
Total 5

@github-actions

Copy link
Copy Markdown

Plugin build for f24ac36 is ready 🛎️!

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