social-reporting-tool/v2/operator-app
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
..
public Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
src Brief edit: prefill once, never clobber typing, fall back when full is missing 2026-04-29 20:35:41 -04:00
.env.example Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
.gitignore Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
index.html Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
package.json Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
postcss.config.js Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
tailwind.config.ts 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
tsconfig.node.json Add V2: multi-team social-reporting platform with manifest-gated linking 2026-04-29 17:39:07 -04:00
vite.config.ts Wire SPA + SSO redirect URI to /social-reports/ prefix; in-place cutover script 2026-04-29 18:40:38 -04:00