Closed
Conversation
…fig UI
- Add PublicWidgetController with public endpoints (no auth, API key validation):
- GET /api/widget/{projectId}/config - fetch widget theme/settings
- POST /api/widget/{projectId}/chat - public chat endpoint
- GET /api/widget/embed.js - standalone JS widget loader script
- GET /api/widget/{projectId}/frame - sandboxed iframe HTML page
- Add WidgetConfigRequestValidator with FluentValidation rules:
- Hex color validation, position validation, URL validation, length limits
- Add Angular widget settings page (Tailwind CSS, Signals):
- Live theme preview with color pickers
- Position selector, avatar URL, display text config
- Embed code generator with copy-to-clipboard
- Enable/disable toggle, allowed origins security
- Add widget settings route and dashboard links
- Add 20+ tests: WidgetControllerTests, PublicWidgetControllerTests, WidgetValidationTests
- Fix pre-existing StripeService build error (Stripe API change)
Owner
Author
|
@copilot please review this PR |
There was a problem hiding this comment.
Sorry @CIKR-Repos, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
@CIKR-Repos I've opened a new pull request, #14, to work on those changes. Once the pull request is ready, I'll request review from you. |
Owner
Author
|
Closing: Chat widget already merged in #11. All 10 MVP PRs are complete! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Embeddable Chat Widget
Summary
Adds a fully embeddable chat widget that can be integrated into any website via a simple
<script>tag. The widget communicates through a sandboxed iframe for security isolation.What's Included
Backend (Public Widget API)
GET /api/widget/{projectId}/config— Public endpoint to fetch widget theme/settings (authenticated via API key query param)POST /api/widget/{projectId}/chat— Public chat endpoint for widget messages (API key auth)GET /api/widget/embed.js— Standalone JavaScript widget loader (creates floating button + iframe)GET /api/widget/{projectId}/frame— Sandboxed iframe HTML page with full chat UIWidgetConfigRequestValidator— FluentValidation rules: hex color format, valid positions, URL validation, length limitsFrontend (Angular Dashboard)
/projects/:id/widget) — Full configuration UI built with Tailwind CSS and Angular Signals:Widget Embed Script
The embed script (
embed.js) creates:sandbox="allow-scripts allow-same-origin allow-forms"for security isolationUsage
Tests (20+ new tests)
WidgetControllerTests— CRUD operations, authorization, partial updatesPublicWidgetControllerTests— API key validation, config fetching, chat endpoint, embed script generationWidgetValidationTests— Color validation, position validation, URL validation, length limitsOther
Checklist