Repository navigation
docs: add native Kapa conversation history - #951
dannyneira wants to merge 21 commits into
Conversation
Co-Authored-By: Warp <agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR upgrades the Kapa React SDK, enables the SDK's native browser-local conversation history, adds an in-panel history view, and adds helper tests around the history view model.
Concerns
- No blocking correctness, security, testing, or spec-alignment concerns were found in the changed diff lines. The provided spec context states that no approved or repository spec context exists for this PR.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Reorder history next to new conversation, use a plus icon, make MCP icon-only with tooltip, and fix light-mode active-row contrast. Co-Authored-By: Warp <agent@warp.dev>
Chat SDK 0.17 only exposes clear-all, so own the browser history store for true per-thread delete and overlay titles for rename while keeping native restore. Lighten the active row and add accessible row actions with confirmation. Co-Authored-By: Warp <agent@warp.dev>
Treat owned localStorage as authoritative before restore, sync history and title overlays via storage events, prune orphans, and harden delete confirmation focus/Escape behavior. Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Resolve package.json and KapaChatLauncher conflicts by keeping conversation-history SDK/scripts and applying main's support-escalation and tracking test changes. Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Paint the open-title span directly in light mode so button form-control text fill cannot keep the active conversation title white on the pale accent row. Strengthen the static style contract against that selector. Co-Authored-By: Warp <agent@warp.dev>
Use the light surface and dark foreground tokens for rename inputs, including explicit browser text fill, and lock the declarations into the focused style contract. Co-Authored-By: Warp <agent@warp.dev>
Replace the ambiguous ellipsis action with a dedicated edit icon while preserving the accessible rename label and tooltip. Co-Authored-By: Warp <agent@warp.dev>
Remove bulk clear from the history UI. After deleting the active conversation, remount with history open when other threads remain, or a fresh chat when none do. Enable + for current conversations and non-empty history views, and leave history when starting fresh. Co-Authored-By: Warp <agent@warp.dev>
Remove conditional gating from the + action so users can always start a fresh conversation, including after deleting all saved history. Co-Authored-By: Warp <agent@warp.dev>
|
|
dannyneira
left a comment
There was a problem hiding this comment.
Review summary
Native Kapa history is well-structured (owned local store, rename overlays, post-delete remount, solid unit tests), but the active-thread continuity path is unfinished on head 5949e19. Found: 1 critical, 1 important, 2 suggestions, 0 nits. Request changes.
Findings
src/components/KapaChatLauncher.tsx:617— 🚨 [CRITICAL] This mount effect readswarp_docs_kapa_thread_idand then does nothing with it. The Kapa SDK 0.17useConversationHistory().restoreThreadAPI does not auto-restore the last thread on load — callers must invoke it — so after a full page reload the panel always opens on an empty transcript even though history rows remain on disk.src/components/KapaChatLauncher.tsx:835—⚠️ [IMPORTANT]startFreshConversationremounts the provider but never clearswarp_docs_kapa_thread_id. Delete/active-missing paths calllocalStorage.removeItem('warp_docs_kapa_thread_id'), but New conversation does not.src/components/KapaChatLauncher.tsx:1215— 💡 [SUGGESTION] The delete control usesLuX, the same icon as cancel-rename. With identical iconography, the destructive action is easy to mis-hit next to rename, and screen-reader users only get the difference fromaria-label.src/lib/kapa-conversation-history.mjs:341— 💡 [SUGGESTION]shouldPersistThreadIdis exported and unit-tested as the guard against re-persisting deleted IDs, butKapaChatLauncher.tsxnever imports or calls it. SDKupsertConversationThreadre-reads disk first so resurrection risk is lower than it looks, yet leaving an unused “authoritative” helper invites drift between the documented contract and the UI.
Verdict
Request changes
Restore the saved active thread on mount via resolveMountRestore + restoreThread, clear the active-thread key on fresh conversation, use a trash icon for delete, and wire shouldPersistThreadId through writeActiveThreadId so deleted IDs cannot be re-persisted. Co-Authored-By: Warp <agent@warp.dev>
Stretch the open control across the whole conversation row while keeping rename/delete stacked above with stopPropagation so actions stay separate. Co-Authored-By: Warp <agent@warp.dev>
Remove overflow clipping on history rows so ::after tooltips can paint outside the card, lift the hovered row for stacking, and anchor tooltips above the controls. Add a static CSS regression for the overflow contract. Co-Authored-By: Warp <agent@warp.dev>
Pin the third-turn support CTA to response #3 only, keep thumbs-down CTAs on the specifically downvoted cards, and auto-scroll when a new CTA appears on the last assistant response so it clears the fixed input. Co-Authored-By: Warp <agent@warp.dev>
Replace CTA-only scrollIntoView(nearest) with a completion-keyed container bottom scroll so the full latest card, feedback controls, and optional support CTA clear the composer after streaming ends. Co-Authored-By: Warp <agent@warp.dev>
dannyneira
left a comment
There was a problem hiding this comment.
Review summary
Final pass on head 4e4b17b: native Kapa history, mount restore, full-row open, unclipped tooltips, scoped support CTA, and latest-response bottom scroll look solid. Local history/support tests and typecheck are green; required CI and Vercel are green. Found: 0 critical, 0 important, 0 suggestions, 0 nits. Approve.
Findings
- No inline findings.
Verdict
Approve
Human-review readiness
- Head:
4e4b17b824fd8e8746de0306768689a2c9b2fd18 - Required CI + Vercel: green
- Local: test:kapa-history 23/23, test:kapa-support-escalation 11/11, typecheck 0 errors
- Preview: https://docs-m3agaefsg-warpdotdev.vercel.app
- Safe to request human review now.
Inset rename mode with row padding and keep the input/focus ring within the card radius so the black field no longer spills past the left edge. Co-Authored-By: Warp <agent@warp.dev>
Summary
@kapaai/react-sdkto0.17.0, whose native history APIs can restore both transcript messages and the original Kapa backend thread ID.This is a test implementation based on Kapa's conversation history documentation and the React SDK's native
useConversationHistory/restoreConversationAPIs. It avoids a transcript-only reimplementation that would lose backend thread continuity.Related issues
None; source context: Kapa Website Widget conversation history.
Validation
npm run test:kapa-history- passednpm run test:kapa-webmcp- passednpm run test:heading-vars- passednpm run typecheck- passed with 0 errorsnpm run lint- passednpm run build- passed after the repository's normalpatch-packagepostinstallnpm run test:heading-tocs- passed, 3,391 entries across 401 HTML filesnpm run test:homepage-json-ld- passedgit diff --check- passedScreenshots
Vercel preview will provide the responsive history view for desktop and mobile testing.
Follow-ups
Co-Authored-By: Warp agent@warp.dev
Warp artifacts