social-reporting-tool/v2
DJP 32dbd8aa7d Brief edit: prefill once, never clobber typing, fall back when full is missing
After importing a brief via JSON paste, edit appeared not to work — the
textarea would either be empty or silently revert as React Query refetched
on window focus (every refetch fired the prefill useEffect, blowing away
whatever the user had typed). On top of that, if the server's `full` field
wasn't returned for any reason the textarea stayed permanently empty.

Fixes:
- Initialise the textarea exactly once via a useRef seed flag. Subsequent
  data refetches don't overwrite user-typed content.
- When `full` is missing, fall back to reconstructing the BRIEF_INPUT shape
  from public columns (client_name, brand positioning, kpis, quality floor,
  etc.) so the user has something to edit. Surfaces an amber banner noting
  competitors/audience/geo are blank and need re-entering.
- New "Reset to saved" link in the header to deliberately discard local
  changes and reload from the server.
- Disable Save when the textarea is empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 20:35:41 -04:00
..
db Lower default engagement floor 10×; richer Stage 3 diagnostic 2026-04-29 20:28:23 -04:00
deploy deploy: chown briefs/ to uid 1000 so container can write per-report dirs 2026-04-29 20:06:56 -04:00
examples Lower default engagement floor 10×; richer Stage 3 diagnostic 2026-04-29 20:28:23 -04:00
operator-app Brief edit: prefill once, never clobber typing, fall back when full is missing 2026-04-29 20:35:41 -04:00
pipeline Stage 2: fail fast when Apify is dry-run or seeds are empty 2026-04-29 20:33:27 -04:00
server Lower default engagement floor 10×; richer Stage 3 diagnostic 2026-04-29 20:28:23 -04:00
templates Per-report dashboard SPA (V3 §10a) — 9 interactive views 2026-04-29 20:06:12 -04:00
.env.example Finish V2: serve dashboards, downscale covers, post-run Apify cost re-poll, 2026-04-29 19:31:38 -04:00
.gitignore Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
docker-compose.v2.dev.yml Drop db-v2 host port binding in prod; add port pre-flight to cutover script 2026-04-29 18:49:44 -04:00
docker-compose.v2.prod.yml Drop db-v2 host port binding in prod; add port pre-flight to cutover script 2026-04-29 18:49:44 -04:00
docker-compose.v2.yml Bake VITE_AZURE_* into the SPA at docker build time; sweep V1 leftovers in cutover 2026-04-29 19:00:15 -04:00
Dockerfile.v2 Per-report dashboard SPA (V3 §10a) — 9 interactive views 2026-04-29 20:06:12 -04:00
package-lock.json Per-report dashboard SPA (V3 §10a) — 9 interactive views 2026-04-29 20:06:12 -04:00
package.json Per-report dashboard SPA (V3 §10a) — 9 interactive views 2026-04-29 20:06:12 -04:00
tsconfig.base.json Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
tsconfig.json Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
vitest.config.ts Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00