Skip to content

Store feedback grids as one validated object - #763

Open
jaykbpark wants to merge 1 commit into
devfrom
feat/feedback-rating-grid
Open

jaykbpark wants to merge 1 commit into
devfrom
feat/feedback-rating-grid

Conversation

@jaykbpark

@jaykbpark jaykbpark commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Store each feedback grid as one question with grid.rows and grid.columns, replacing duplicated per-row grouping metadata. Answers remain flat and keyed by stable row IDs.

  • Normalize grid definitions at the persistence boundary with short validation guards and specific errors.
  • Document the stored shape beside its type. Validate row IDs, labels, limits and collisions; preserve column labels containing commas.
  • Remove the standalone backend test file, which has no maintained CI test command.
  • Add AGENTS.md guidance on simple data shapes, boundary validation, readable guards, documentation and existing test conventions.

Contract

{
  questionId: "event-quality",
  type: "MULTIPLE_CHOICE_GRID",
  label: "Rate the event",
  required: true,
  grid: {
    rows: [{ id: "organization", label: "Organization" }],
    columns: ["Poor", "Excellent", "Yes, definitely"]
  }
}
// Answers remain flat: responses.organization = "Excellent"

Verification

  • Focused strict TypeScript check passes for the event types and feedback helpers.
  • Local checks pass for both form types, invalid definitions, flat required/optional answers, stable IDs, comma-containing choices and unchanged ordinary questions.
  • The companion frontend browser checks exercise the real normalization and answer validators with synthetic data. One-off verification files stay outside this PR.
  • Formatting and diff checks pass.

Rollout

Deploy this API PR before frontend PR #504, which uses the new question type. No production form or response was changed.

@jaykbpark jaykbpark changed the title Add multiple-choice grid feedback validation Persist explicit grid layout metadata on feedback choice rows Sep 7, 2026
@jimmysamportfolio

Copy link
Copy Markdown

LGTM - pay attention to merge order. Also, fix the failing pr rule

@jaykbpark
jaykbpark changed the base branch from master to dev September 7, 2026 22:59
@jaykbpark
jaykbpark force-pushed the feat/feedback-rating-grid branch from 6b9fe4a to 41d620f Compare September 7, 2026 23:05
Comment thread services/events/feedbackGrid.test.ts Outdated
Comment thread services/events/feedbackHelpers.ts Outdated
Comment thread services/events/feedbackHelpers.ts Outdated
@jaykbpark
jaykbpark force-pushed the feat/feedback-rating-grid branch from 41d620f to ed962d3 Compare September 8, 2026 00:50
@jaykbpark jaykbpark changed the title Persist explicit grid layout metadata on feedback choice rows Store feedback grids as one validated object Sep 8, 2026
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.

3 participants