Skip to content

<Feedback> component: authored feedback-prompt block #9

Description

@terraboops

Why

Companion to bitcomplete/pin#27 (feedback module). Authors sharing decision documents want to ask specific questions in the document — "Does the pricing feel right?", "Which of these three options?" — and route readers to pin's feedback page with those prompts attached.

Constraints (verified against main, 2026-08-11)

  • Components render to static HTML via renderToString — no client runtime, no hydration, no <script> emission (src/bundle.ts, src/compile.ts). index.tsx already documents that event handlers never fire in pin (see the ToolCall wrapper notes). So this is a static block + link, not a widget — the interactive form lives on pin's first-party page (pin#27), because share documents are CSP-sandboxed without allow-same-origin/allow-forms.
  • Components have no share context at render time: compileMDX(source) receives only the source. The CTA link needs the share's feedback path.

Proposal

A <Feedback> component in src/components/ui/feedback.tsx, exported from src/components/index.tsx:

<Feedback
  prompt="We'd love your read on this plan."
  questions={["Does the entry price feel right?", "What's missing from the bike stage?"]}
/>
  • Renders a visually distinct block: prompt, the author's questions as a list, and a CTA ("Leave feedback") linking to the share's feedback page.
  • Render-context contract (cross-repo, decide here + pin#27 together): simplest is pin setting a global in the v8 isolate before compile (e.g. globalThis.PIN_SHARE_PATH = "/p/{id}"), read via a small env helper with a graceful fallback — if absent (local preview, other hosts), render the questions without the CTA link so the component degrades to a static prompt block.
  • Questions should also be discoverable by pin so the feedback form can present them as structured fields (pin#27 "prompt plumbing") — either pin parses the MDX source for <Feedback> props at upload, or the component emits a <script type="application/json" data-pin-feedback-prompts> block pin can extract server-side.
  • JSDoc per the manifest extractor's rules; @category emphasis for v1 (an interactive category may be worth introducing if more pin-integrated components follow — flagging, not proposing here).

Acceptance sketch

  • Renders prompt + questions + CTA when PIN_SHARE_PATH present; degrades without it.
  • Manifest entry appears with props documented (scripts/extract-manifest.mjs passes).
  • Example in JSDoc renders in the catalog.

Depends on / coordinates with: bitcomplete/pin#27.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions