docs: add kapa askai inline to homepage#2665
Conversation
📝 WalkthroughWalkthroughThis PR reworks KapaWidget to support a queue-safe initialization flow with an ChangesKapaWidget inline integration
Announcement banner spacing
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant KapaWidget
participant WindowKapa as window.Kapa
participant KapaBundle
User->>KapaWidget: interact (click or submit query)
KapaWidget->>KapaWidget: injectKapaScript() (first time only)
KapaWidget->>WindowKapa: preinitKapa() queues calls
KapaBundle-->>WindowKapa: bundle loads and initializes
KapaWidget->>WindowKapa: openKapa({query, submit})
WindowKapa->>KapaBundle: open widget with query
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/theme/KapaWidget.tsx`:
- Around line 95-137: The inline ask bar in KapaWidget currently submits only
via Enter and lacks a visible action control. Update the returned form in
KapaWidget to include a clearly visible submit button alongside the existing
input, wired to the same handleSubmit flow, so users can discover and tap/click
submission directly. Keep the existing onSubmit, query, and injectKapaScript
behavior intact while adding the new control with appropriate accessible
labeling.
- Around line 121-135: The text input in KapaWidget disables the default focus
outline without providing an alternative, so restore a visible keyboard focus
indicator for the inline ask bar. Update the inline input’s focus styling in the
KapaWidget component (the input with onFocus={injectKapaScript}) to show a clear
focus state, such as a visible outline or equivalent focus ring, while keeping
the current appearance otherwise.
- Line 125: The Kapa widget is being injected too early because the input’s
onFocus handler calls injectKapaScript, which loads the third-party script
before explicit user consent. Remove the focus-based preload from KapaWidget or
gate it behind an explicit consent action, and keep script injection only in
openKapa (or equivalent submit/click flow) so the remote widget loads only after
the user intentionally opens it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: afa2a625-3366-4eef-937b-57c69a915f53
⛔ Files ignored due to path filters (1)
src/content/announcement-banner.mdxis excluded by!**/*.mdx
📒 Files selected for processing (4)
src/components/AnnouncementBanner/AnnouncementBanner.module.csssrc/components/AnnouncementBanner/AnnouncementBanner.tsxsrc/components/welcomePage/HowToUseSection.tsxsrc/theme/KapaWidget.tsx
Adds Kapa's AskAI widget inline on homepage to promote the discoverability.
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Summary by CodeRabbit
New Features
Bug Fixes