Skip to content

feat(surveys): member-facing survey discovery (Issue 1463) - #1474

Open
leahpeker wants to merge 4 commits into
mainfrom
feat-survey-discovery
Open

feat(surveys): member-facing survey discovery (Issue 1463)#1474
leahpeker wants to merge 4 commits into
mainfrom
feat-survey-discovery

Conversation

@leahpeker

Copy link
Copy Markdown
Collaborator

Summary

  • New GET /api/community/surveys/ (optional JWT) lists active surveys: public only for anonymous callers, public + members-only for authenticated members. It lives on the same ninja router as POST /surveys/ — a GET registered on the public router never resolves past the POST.
  • New /surveys screen lists those surveys (title + description, lowercase) and links each to /surveys/:slug; added a surveys entry to the menu sheet and a row to .claude/docs/routes.md.
  • Event detail now carries linked_surveys (id/title/slug, active only) in place of survey_slugs, so the links card names each linked survey instead of showing a generic "give feedback".

Closes #1463

Test plan

  • backend: tests/test_surveys_public.py::TestSurveyListPublic covers anon vs member visibility, inactive exclusion, and linked_event_id
  • frontend: src/screens/surveys/SurveysScreen.test.tsx covers loading, error, empty, link targets, and the anon prompt
  • manual: log out and open /surveys (public only), log in and reload (members-only appear), open an event with a linked survey and check the links card

CI note

Locally make agent-* runs against per-worktree SQLite, so 7 pre-existing tests fail for environmental reasons and are unrelated to this change: tests/test_sse.py (needs pg_notify), tests/test_rsvp_capacity_race.py and tests/test_poll_finalize_race.py (need real select_for_update row locking). Everything else in the ladder passes: lint, check, typecheck, complexity, check-codes, and the full frontend suite (1287 passed).

…on events

Add GET /api/community/surveys/ (optional JWT): active public surveys for
anonymous callers, public + members-only for authenticated members.

Replace the event detail survey_slugs field with linked_surveys so the UI can
render survey titles.
…vey links

New /surveys screen lists active surveys the viewer can see and links each
to /surveys/:slug. Adds a lowercase surveys entry to the menu, and the event
detail links section now names each linked survey instead of a generic label.
…open

The new GET /api/community/surveys/ listed every active survey whose own
visibility allowed it, including ones linked to members-only, invite-only,
draft, or deleted events. A survey's title and description normally name its
event, and linked_event_id exposed the event UUID, so an anonymous caller
could enumerate events that GET /events/{id}/ would 404 or 403 for.

Gate the list on the linked event as well: anon sees only surveys with no
linked event or a public, non-draft one; members additionally see members-only
events. Unlinked surveys are unaffected.
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.

Add member-facing survey discovery

1 participant