Skip to content

Add the community survey page - #6607

Open
brsbl wants to merge 6 commits into
web/community-survey-apifrom
web/community-survey
Open

brsbl wants to merge 6 commits into
web/community-survey-apifrom
web/community-survey

Conversation

@brsbl

@brsbl brsbl commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The survey API (#6624) had no page to fill out. Layer 2 of 4.

What changed

  • An unlisted /community/survey page uses the shared nav and footer, noindex, and no analytics.
  • Questions show and hide using the same rules as the API.
  • Picking "Other" opens a "Please specify" box and focuses it.
  • Checkbox questions say "(pick any)" and have no pick limit.
  • Progress is saved in the browser and cleared once the answers are saved.
  • The thank-you message is announced and takes focus.
  • While the answers are sending, the button reads "Sending…" with a spinner and stays disabled.
  • The form posts to the API, so a submit before the script loads never puts answers in a URL.
  • Survey code loads only on this page, never in the bundle other routes share.

How you verified

  • Page tests in jsdom cover show/hide, Other, restore, submit, the sending state and a failed save.
  • Headless Chromium at 1280 and 390 widths: the full flow passed with no console or hydration errors.
  • A production build showed no survey code in the main bundle's chunks.
  • Remote CI: passed. Run

BB-Thread-ID: thr_yz6t8hi7s8

AGENT GENERATED

@brsbl
brsbl force-pushed the web/community-survey branch 2 times, most recently from 1753fb2 to 2a75d8d Compare October 30, 2026 04:24
@brsbl
brsbl changed the base branch from main to web/community-survey-api October 30, 2026 04:24
@brsbl brsbl changed the title Add a private community survey page Add the community survey page Oct 30, 2026
@brsbl
brsbl marked this pull request as ready for review October 30, 2026 04:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T04:40:32.014006Z 2a75d8d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@brsbl
brsbl added this pull request to stack #6625 October 30, 2026 04:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a75d8d889

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import { SURVEY_TITLE, surveyOrder } from "../community/survey";
import { siteHeadLinks } from "../landing/page-head";

export const Route = createFileRoute("/community/survey")({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ship SDK and CLI access with the survey UI

This launches an end-user survey surface without corresponding SDK and bb CLI access or documentation. Repository-wide searches for the survey route and submission identifiers find only the web implementation, database storage, and web documentation; there is no SDK or CLI submission path. The root repository instructions explicitly require those surfaces to ship with every end-user UI feature, so add and document them alongside this page.

AGENTS.md reference: AGENTS.md:L26-L26

Useful? React with 👍 / 👎.

Comment on lines +216 to +218
submissionId.current ||= crypto.randomUUID();
setSending(true);
const reply = await send(submissionId.current, surveyAnswers(values));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Persist the submission ID alongside saved progress

If the server saves a response but the browser loses the acknowledgement, reloading restores the answers from localStorage but discards the submission ID held in this ref. Submitting the restored form generates another UUID, and handleSurveySubmission deduplicates only by that UUID (ON CONFLICT(id) DO NOTHING), so the same response is inserted again and counted twice. Persist and restore the ID with the pending answers, clearing both after acknowledged success, so retries after a reload remain idempotent.

Useful? React with 👍 / 👎.

@brsbl
brsbl force-pushed the web/community-survey branch 6 times, most recently from a2980b7 to e072ba6 Compare October 30, 2026 07:04
@brsbl
brsbl force-pushed the web/community-survey branch 3 times, most recently from 541c6bd to f97feb7 Compare October 30, 2026 11:38
brsbl and others added 6 commits October 30, 2026 12:03
Unlisted /community/survey: a normal site page with the shared nav and
footer, questions that adapt to earlier answers, a Please specify box for
Other, progress saved in the browser, and a thank-you view that takes
focus. It posts answers as JSON to /api/community/survey.

BB-Thread-ID: thr_yz6t8hi7s8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route's head and loader pulled survey.ts into the main bundle every
getbb.app page loads. The title now lives in the route, page copy lives in
the page, and the loader imports the shuffle on demand. Checkbox questions
read (pick any), and the error summary no longer adds a colon after a
question mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
z.record and z.boolean pulled extra zod classes into the chunk every
getbb.app page loads. The page test also follows the single-choice plugin
question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Submitting now waits on Shopify and Resend, so the button reads Sending…
with a spinner and stays disabled until the reply arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section headings move to the survey model so the results email can reuse
them, the two question notes sit in one table, and the sending-state and
failed-save tests become one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brsbl
brsbl force-pushed the web/community-survey branch from f97feb7 to 316801c Compare October 30, 2026 13:13

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant