Skip to content

Commit 4d9d500

Browse files
committed
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.
1 parent fc9e3a4 commit 4d9d500

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

simulator-ui/src/shared.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,23 @@ export function FeedbackControls(props: {
320320
const [errorMessage, setErrorMessage] = useState<string | null>(null);
321321
const requestSeqRef = useRef(0);
322322

323+
// Keep local draft in sync with persisted feedback, but never while the user
324+
// is actively typing or a save is in flight, otherwise server echoes can
325+
// clobber in-progress text and make the textarea feel flaky.
323326
useEffect(() => {
324-
setReason(feedback?.reason ?? "");
325-
if (typeof feedback?.score === "number" || feedback?.reason !== undefined) {
326-
setStatus("saved");
327-
} else {
328-
setStatus("idle");
327+
const isEditing = status === "unsaved" || status === "saving";
328+
if (!isEditing) {
329+
setReason(feedback?.reason ?? "");
330+
if (
331+
typeof feedback?.score === "number" || feedback?.reason !== undefined
332+
) {
333+
setStatus("saved");
334+
} else {
335+
setStatus("idle");
336+
}
337+
setErrorMessage(null);
329338
}
330-
setErrorMessage(null);
331-
}, [feedback?.reason, feedback?.score]);
339+
}, [feedback?.reason, feedback?.score, status]);
332340

333341
useEffect(() => {
334342
if (typeof feedback?.score === "number") {

0 commit comments

Comments
 (0)