Skip to content

fix(docs): deploy bug report API as Cloudflare Worker + improve widget visibility and layout #153

@polaz

Description

@polaz

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.toml with route docs.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.foundation to ALLOWED_ORIGINS in 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-width via @media queries
  • Widen doc content area for screens > 1440px

Acceptance Criteria

  • POST to /api/report-bug returns 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.foundation origin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions