forked from zereight/gitlab-mcp
-
Notifications
You must be signed in to change notification settings - Fork 1
fix(docs): deploy bug report API as Cloudflare Worker + improve widget visibility and layout #153
Copy link
Copy link
Closed
Labels
Description
Problem
The bug report widget on docs.gitlab-mcp.sw.foundation returns 405 Method Not Allowed when submitting.
Root Cause
The docs site deploys to GitHub Pages (purely static hosting via actions/deploy-pages@v4), but the API handler (docs/functions/api/report-bug.ts) is written as a Cloudflare Pages Function — which is never deployed because GitHub Pages doesn't support server-side functions.
Solution
1. Deploy API as standalone Cloudflare Worker
Since docs.gitlab-mcp.sw.foundation already routes through Cloudflare DNS, we deploy the handler as a standalone Worker:
- Add
wrangler.tomlwith routedocs.gitlab-mcp.sw.foundation/api/* - Refactor handler from CF Pages Function format (
onRequestPost: PagesFunction<Env>) to CF Worker format (export default { async fetch(request, env) }) - Add CI workflow step for
wrangler deploy - Add
https://docs.gitlab-mcp.sw.foundationtoALLOWED_ORIGINSin utils.ts
2. Improve widget visibility
Current widget is a small vertical "Bug?" tab on the right edge — easy to miss:
- Move to a floating bottom-right button (like Intercom/Zendesk pattern)
- Larger hit target with clear bug icon
- Subtle pulse animation on first page load
- Better contrast
3. Wider content layout on large screens
VitePress default layout constrains content to ~688px, leaving large empty margins on wide screens:
- Add custom CSS (
docs/.vitepress/theme/style.css) - Override
--vp-layout-max-widthvia@mediaqueries - Widen doc content area for screens > 1440px
Acceptance Criteria
- POST to
/api/report-bugreturns 201 (not 405) - Widget is visible without scrolling on desktop
- Content uses more horizontal space on wide (>1440px) screens
- All existing unit tests pass
- CORS allows
docs.gitlab-mcp.sw.foundationorigin
Reactions are currently unavailable