githubnext/chopinPublic

Let's compose rich plans together

Seed dev sample decisions once per document #379

MergedMaggieAppletonmerged 3 commits intomainfromrefs/pull/379/head
  1. MA

    ## Why With `DEV_QUESTIONS=1` / `DEV_COMMENTS=1`, the sample decisions and comment were re-seeded every time a room reopened (idle close, rename, another browser). Counts grew 2 → 4 → 8 → 24, which misled local and preview testing.

    ## What changed - `questions/inject.ts` and `comments/inject.ts`: `enabled(plan)` now also requires the document to hold no durable question records (or comment threads). Records persist, so the seed runs once per document. - Never seeds when `NODE_ENV=production`. - `main.ts` passes the opened plan. - New `questions/inject.test.ts` covers first open, reopen/rename/second client (records already present), missing flag and production.

    Before: every open with nothing pending added another sample set. After: one set per document.

    ## Seed flow

    ![Dev sample decision seeding before and after the durable-record guard](https://github.com/user-attachments/assets/6197030e-2cf1-4aaf-aa78-51da9e238c93)

    ## Testing - `bun test apps/server/src/questions/inject.test.ts`: 2 pass - `bun run ci`, `bun run types`: pass - Focused local Chromium `responsive-decisions.e2e.ts`: both 320 × 568 and 390 × 844 cases pass against the matching build (2/2). The assertion counts persisted sample records after seed-once.

    🤖 Generated with [Claude Code](https://claude.com/claude-code)

  2. MaggieAppletonhead-ref-force-pushed d3397de42dc4last month on GitHub

  3. MaggieAppletonmerged e8d9e3a27b2dlast month on GitHub

  4. MaggieAppletonclosedlast month on GitHub

  5. MaggieAppletonhead-ref-deletedlast month on GitHub

  6. MaggieAppletonreferenced this in Wait out connection blips and recover as soon as the network returns #385last month on GitHub