Skip to content

About

A small button that lets users screenshot the page, mark it up and send a note. You store the report where you want.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

visual-feedback

A small button lets your users screenshot the page, mark it up and write a note. You receive one report and store it where you want. It has no service, no tracking and no global CSS, and it fits any design.

Try it here. A report you send stays in the page, as the site's own list.

The feedback dialog over a video site, with a box and an arrow drawn around the topic buttons, seven of which read Undefined

Ask your coding agent:

Install the visual-feedback npm package (https://www.npmjs.com/package/visual-feedback) and add it to this app by following its AGENTS.md. Place its button where it covers nothing, and match its position, colours and corners to our design.

Or the old-school way, by hand:

npm install visual-feedback

In the browser, through a bundler (without one, see docs/API.md):

import { createFeedback } from "visual-feedback";

createFeedback({ endpoint: "/api/feedback" });

On the server, where the report arrives (a Next.js route here). This route checks the report and stores nothing yet: a recipe in docs/recipes/ stores it, and says how to keep it private.

// app/api/feedback/route.ts
import { FeedbackRequestError, parseFeedbackRequest } from "visual-feedback/server";

export async function POST(request: Request): Promise<Response> {
  try {
    const { report } = await parseFeedbackRequest(request);
    // Store `report`, images included: docs/recipes/ has tested code for six places.
    return new Response(null, { status: 204 });
  } catch (error) {
    if (error instanceof FeedbackRequestError) {
      return new Response(error.message, { status: error.status });
    }
    throw error;
  }
}

In React or Next.js, render the component once, in the root layout:

// app/layout.tsx
import { Feedback } from "visual-feedback/react";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Feedback endpoint="/api/feedback" />
      </body>
    </html>
  );
}

MIT

About

A small button that lets users screenshot the page, mark it up and send a note. You store the report where you want.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages