Skip to content

Implement custom Kapa support handoff chat with polished codeblock UX - #502

Open
dannyneira wants to merge 12 commits into
mainfrom
danny/kapa-custom-chat-handoff-clean-v1
Open

Implement custom Kapa support handoff chat with polished codeblock UX#502
dannyneira wants to merge 12 commits into
mainfrom
danny/kapa-custom-chat-handoff-clean-v1

Conversation

@dannyneira

Copy link
Copy Markdown
Member

Summary

This PR restores a custom Kapa side-chat experience for docs and adds a robust support handoff flow to Front, while preserving Kapa answer quality and improving chat UX.

What’s included

  • Re-enabled custom Kapa chat launcher/panel behavior in docs.
  • Added trigger-based Create ticket handoff UX (uncertainty/downvote/conversation depth paths).
  • Added docs API route for support handoff submission.
  • Switched handoff transport to Hookdeck-backed endpoint routing.
  • Upgraded chat code block rendering to match docs styling with:
    • syntax highlighting,
    • stable copy button behavior,
    • horizontal scrolling,
    • no streaming flicker,
    • corrected line spacing.
  • Improved handoff success/error states and inline form behavior.

Verification

  • npm run build passes.
  • End-to-end smoke verified:
    • chat renders/streams correctly,
    • code blocks highlight and copy correctly,
    • support handoff submission succeeds.

Notes

  • This is a clean-history replacement PR for the earlier iterative branch.

Co-Authored-By: Warp Agent agent@warp.dev

Co-Authored-By: Warp Agent <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Aug 11, 2026
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 11, 2026 11:47pm

Request Review

oz-for-oss[bot]

This comment was marked as outdated.

Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR restores the custom Kapa chat panel, adds code-block rendering and copy UX, documents MCP OAuth workarounds, and introduces support handoff/highlight API routes.

Concerns

  • The code highlighting cleanup path can still emit an unhandled rejection when Shiki highlighting fails.

Security

  • The new support handoff endpoint is public and can be scripted to create support tickets without a rate limit or proof that the request came from a real Kapa conversation.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread src/components/KapaChatLauncher.tsx Outdated

let upstreamResponse: Response;
try {
upstreamResponse = await fetch(supportHandoffEndpointUrl, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] [SECURITY] This public route forwards directly into support ticket creation using only client-supplied fields (page_url, email, thread id) as proof, so anyone can script POSTs and spam Front through the shared server secret; require an anti-abuse gate such as rate limiting plus a CAPTCHA/Kapa-issued token or server-side thread verification before forwarding.

Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com>
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Warp Agent <agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant