From 4d9d500619b15d2382b03f652e2cbb345c97e0dd Mon Sep 17 00:00:00 2001 From: bft-codebot Date: Wed, 25 Feb 2026 01:56:29 +0000 Subject: [PATCH] sync(bfmono): fix(simulator-ui): prevent feedback reason text from being clobbered (+19 more) (bfmono@b4d5cdaef) This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit/packages/gambit-core/` - bfmono rev: b4d5cdaef Changes: - b4d5cdaef fix(simulator-ui): prevent feedback reason text from being clobbered - 84952a652 fix(gambit-verify): align verify turn labels and stabilize initial run filtering - c56b7f52f feat(gambit): improve verify report controls and harden concurrent calibrate persistence - beb9435c0 feat(gambit-simulator-ui): extend listbox trigger and popover options - 25f9fdcfc fix(gambit-simulator-ui): align verify outlier chip semantics and display - a010b0ee1 feat(gambit-simulator-ui): add verify outliers to workbench chat chips - 383f2500a refactor(simulator-ui): replace nested ternaries in main routing - 13c4c8c22 fix(gambit): preserve shared references in safe session serialization - ae392aa24 feat(gambit-simulator-ui): add grader error chips to workbench chat - 1de6b335c fix(gambit): clamp deck-level maxTurns bounds in test run selection - 01d7abbb9 fix(gambit): default verify tab bootstrap flag to enabled - f3d186c7b fix(gambit): include extension schemas in exports and default serve to restored workspace - a83b7cbe7 fix(gambit): move unbounded build timeout to deck opt-in - acb2de627 fix(gambit): avoid strict json_schema 400s in openrouter responses - 8aba573b6 fix(gambit-simulator-ui): treat errored calibrate runs as failed - ca2028cf8 fix(gambit): prevent circular trace crashes in workspace test run API - 7e41517e5 fix(gambit): make build assistant run timeout unbounded - 24341143d feat(gambit): add deterministic verify fixture seeding - ff2c2d33d feat(gambit): add verify tab consistency UI - 91f0c93bb feat(gambit): add feature-flagged verify routing Do not edit this repo directly; make changes in bfmono and re-run the sync. --- simulator-ui/src/shared.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/simulator-ui/src/shared.tsx b/simulator-ui/src/shared.tsx index 5fd3a7de..aa902571 100644 --- a/simulator-ui/src/shared.tsx +++ b/simulator-ui/src/shared.tsx @@ -320,15 +320,23 @@ export function FeedbackControls(props: { const [errorMessage, setErrorMessage] = useState(null); const requestSeqRef = useRef(0); + // Keep local draft in sync with persisted feedback, but never while the user + // is actively typing or a save is in flight, otherwise server echoes can + // clobber in-progress text and make the textarea feel flaky. useEffect(() => { - setReason(feedback?.reason ?? ""); - if (typeof feedback?.score === "number" || feedback?.reason !== undefined) { - setStatus("saved"); - } else { - setStatus("idle"); + const isEditing = status === "unsaved" || status === "saving"; + if (!isEditing) { + setReason(feedback?.reason ?? ""); + if ( + typeof feedback?.score === "number" || feedback?.reason !== undefined + ) { + setStatus("saved"); + } else { + setStatus("idle"); + } + setErrorMessage(null); } - setErrorMessage(null); - }, [feedback?.reason, feedback?.score]); + }, [feedback?.reason, feedback?.score, status]); useEffect(() => { if (typeof feedback?.score === "number") {