feat: in-app Feedback button in Studio, stored in D1 via /api/feedback - #780
Merged
Merged
Conversation
Public feedback endpoint for the Studio. Validates message (10-4000), optional email, category general|bug|idea|modeling, path, app version and client-reported Supabase user. Honeypot returns a silent 204. Rate limit 5/hour per IP hash and per user id, counted from the D1 table itself. CORS allows app.kernelcad.com, kernelcad.com, Pages previews, localhost. Signed-off-by: Andrii Shylenko <14119286+w1ne@users.noreply.github.com>
Always-visible Feedback button in the pinned account slot opens a modal (category, message, optional reply email, hidden honeypot). Signed-in users send their Supabase id and email instead of the email field. Every submission carries the route path and app version and posts to https://kernelcad.com/api/feedback (VITE_FEEDBACK_URL overrides). Signed-off-by: Andrii Shylenko <14119286+w1ne@users.noreply.github.com>
… the quality ratchet Signed-off-by: Andrii Shylenko <14119286+w1ne@users.noreply.github.com>
w1ne
enabled auto-merge
September 27, 2026 21:07
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.
What
In-app feedback for the Studio. It works like LabWired's feedback feature.
__APP_VERSION__+__COMMIT_HASH__).general,bug,idea,modeling("Modeling / CAD result").modelingreplaces LabWired'spart.site/functions/api/feedback.tsis a Cloudflare Pages Function besidesubscribe.ts, served atPOST https://kernelcad.com/api/feedback.feedback(bindingDB, databasekernelcad-subscribers).https://app.kernelcad.com,https://kernelcad.com,https://www.kernelcad.com,*.kernelcad-app.pages.dev,*.kernelcad-marketing.pages.devandlocalhost/127.0.0.1.site/migrations/0002_feedback.sql, idempotent (CREATE TABLE IF NOT EXISTS).VITE_FEEDBACK_URL(optional). The default ishttps://kernelcad.com/api/feedback.The server does not verify the user id and email. The Studio client reports them, so treat them as a hint and not as an identity. The per-IP limit is the real spam guard.
Manual steps / follow-ups
npx wrangler d1 execute kernelcad-subscribers --remote --file=site/migrations/0002_feedback.sqlPOST https://kernelcad.com/api/subscribereturns a bare static405and not the function's303.deploy-kernelcad-com.ymlin kernelCAD-server runswrangler pages deploy kernelcad-web/site-deployfrom the workspace root. Wrangler looks for./functionsandwrangler.tomlin the current directory, so it finds neither.workingDirectory: kernelcad-web/site-deploywithpages deploy ..DBbinding on thekernelcad-marketingproject also needs to exist.site/, in.github/workflowsor in kernelCAD-server. Supabase SMTP is only commented-out config. D1 is the source of truth. To read feedback:npx wrangler d1 execute kernelcad-subscribers --remote --command "SELECT * FROM feedback ORDER BY id DESC LIMIT 50"Follow-up: a best-effort notification to andrii@kernelcad.com, e.g. Cloudflare Email Routing
send_emailbinding, from the same function.gh workflow run deploy-kernelcad-com.yml -R w1ne/kernelCAD-server -f web_ref=develop, after step 2.Tests
site/functions/api/feedback.test.ts(29 tests) covers:src/studio/components/Layout/FeedbackModal.test.tsx(9 tests) covers:postFeedbackfetch and 429 mappingHeader.test.tsx: the Feedback button renders in the pinned account slot with auth off.npx vitest run src/studio/components/Layout/ site/functions/api/plus the quality and cycle ratchets: 11 files, 94 tests passed.src/studio/__tests__andsrc/studio/components: 87 files, 620 tests passed.tsc -b --noEmitis clean.npm run linthas 0 errors. All 27 warnings were already there.🤖 Generated with Claude Code