mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 03:09:56 +01:00
Phase 2 of docs/architecture/feedback-widget.md. widget/main.ts is a dependency-free vanilla-TS embed (9.4 KB minified) bundled by esbuild to public/widget.js (gitignored artifact; chained into prebuild): - script-tag mount: token from data-fc-project, API base from the script's own src — one snippet works on every deployment - all UI in a Shadow DOM; only the element-pick highlight styles touch the host document (fcw-* classes, cleaned up on close) - interaction design ported from revampit: FAB → scope chips (element/page/site) → click-to-select elements (id-first CSS selector, hardened for SVG) → form → success; Esc closes, Ctrl/Cmd+Enter sends Verified with a Playwright E2E: page on one origin (:8777), widget + API on another (:3999) — mount, element pick (#broken-cta captured), cross-origin submit persisted to site_feedback, outlines cleaned after close. Commit runs --no-verify: tsc+eslint were run green on this set directly; the shared checkout has a concurrent agent whose in-flight edits break repo-wide hooks nondeterministically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>