Commit e8284bc
authored
fix(docs): deploy bug report API as CF Worker + improve widget & layout (#154)
* feat(docs): add "Report a Bug" feedback widget to documentation site
- Add BugReportWidget.vue: persistent side-tab with expandable form,
success/error states, responsive design (side panel on desktop,
bottom sheet on mobile), dark mode support, and prefers-reduced-motion
- Add Cloudflare Pages Function (docs/functions/api/report-bug.ts):
creates GitHub issues via GitHub App installation token with
honeypot anti-spam, IP-based rate limiting via KV, input validation,
and CORS restricted to docs domain
- Add VitePress custom theme extending default with layout-bottom slot
- Add .github/ISSUE_TEMPLATE/bug.yml as fallback for direct GitHub reports
- Add @cloudflare/workers-types and docs/functions/tsconfig.json
- Exclude docs/ from main tsconfig to avoid type conflicts
Closes #145
* fix(docs): correct PEM detection, add focus trap and unit tests
- Fix PKCS#1 vs PKCS#8 PEM detection: use "BEGIN RSA" presence to
correctly identify PKCS#1 format (GitHub App PEMs) vs PKCS#8
- Add aria-modal="true" and focus trap to dialog panel for
screen reader and keyboard-only accessibility
- Return focus to trigger button when dialog closes
- Extract pure utility functions to utils.ts for testability
- Add 27 unit tests covering validation, CORS, base64url encoding,
ASN.1 length encoding, and buffer concatenation
* fix(docs): deduplicate constants and improve type narrowing
Import CATEGORIES and MIN_DESCRIPTION_LENGTH from shared utils into the
Vue widget instead of duplicating values. Add explicit local variable
narrowing in validateReport for stricter TypeScript compatibility.
* fix(docs): defer focus return to nextTick after widget collapse
The trigger button uses v-if and is recreated on state change. Focus
must wait for DOM patch before the new element ref is available.
* fix(docs): reset honeypot field on form close to prevent stuck rejections
* test(docs): add unit tests for report-bug CF handler with mocked crypto and fetch
* fix(docs): allow close button to work in all non-collapsed widget states
* fix(docs): deploy bug report API as standalone Cloudflare Worker
GitHub Pages returns 405 for POST requests because it's static-only hosting.
The CF Pages Function in docs/functions/ was never deployed.
Solution: standalone Cloudflare Worker at docs/worker/ with route rule
docs.gitlab-mcp.sw.foundation/api/* intercepting requests before GitHub Pages.
- Add docs/worker/ with wrangler.toml and Worker-format handler
- Add deploy-worker job to docs.yml CI workflow
- Add https://docs.gitlab-mcp.sw.foundation to ALLOWED_ORIGINS
- Update test expectation for new primary origin
Closes #153
* feat(docs): improve widget visibility, add logo, widen layout
- Widget: move from vertical side tab to floating bottom-right button
with pulse animation and "Report Bug" label (more discoverable)
- Logo: add project logo to navbar and hero section on landing page
- Layout: add custom CSS with @media queries for wider content on
screens >1440px and >1600px (reduces wasted horizontal space)
* fix(docs): add KV namespace ID to wrangler.toml for rate limiting1 parent b0b5308 commit e8284bc
File tree
14 files changed
+505
-36
lines changed- .github/workflows
- docs
- .vitepress
- theme
- components
- functions/api
- public
- worker
- src
- tests/unit/docs
14 files changed
+505
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
| 302 | + | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
| 311 | + | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
322 | 321 | | |
323 | 322 | | |
324 | | - | |
325 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
329 | | - | |
| 330 | + | |
330 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
331 | 345 | | |
332 | 346 | | |
333 | 347 | | |
334 | | - | |
| 348 | + | |
335 | 349 | | |
336 | 350 | | |
337 | 351 | | |
338 | | - | |
| 352 | + | |
339 | 353 | | |
340 | 354 | | |
341 | 355 | | |
342 | 356 | | |
343 | 357 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
353 | | - | |
| 366 | + | |
354 | 367 | | |
355 | 368 | | |
356 | 369 | | |
357 | 370 | | |
358 | 371 | | |
359 | 372 | | |
360 | 373 | | |
361 | | - | |
| 374 | + | |
362 | 375 | | |
363 | 376 | | |
364 | 377 | | |
365 | | - | |
| 378 | + | |
366 | 379 | | |
367 | 380 | | |
368 | 381 | | |
| |||
581 | 594 | | |
582 | 595 | | |
583 | 596 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | 597 | | |
| 598 | + | |
589 | 599 | | |
590 | 600 | | |
591 | 601 | | |
592 | | - | |
593 | 602 | | |
594 | 603 | | |
595 | 604 | | |
596 | 605 | | |
597 | 606 | | |
598 | | - | |
599 | 607 | | |
600 | 608 | | |
601 | 609 | | |
602 | | - | |
603 | 610 | | |
604 | 611 | | |
605 | 612 | | |
| |||
609 | 616 | | |
610 | 617 | | |
611 | 618 | | |
612 | | - | |
613 | 619 | | |
614 | 620 | | |
615 | 621 | | |
616 | | - | |
617 | 622 | | |
618 | | - | |
619 | | - | |
620 | 623 | | |
621 | 624 | | |
622 | 625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments