7. Add playground input controls and validation#3111
Conversation
|
I'm Bonk, and I've done a quick review of your PR. This PR adds schema-driven input controls, validation utilities, and tests for the Cog playground. The code is well-structured and the test coverage is comprehensive. I found a few actionable issues:
FileInputControl.tsx Replace the experimental import { useEffect, useRef, useState } from "react";
// ... inside FileInputControl component ...
const onBusyChangeRef = useRef(props.onBusyChange);
useEffect(() => {
onBusyChangeRef.current = props.onBusyChange;
});
useEffect(() => {
if (!disabled) return;
readToken.current += 1;
onBusyChangeRef.current(false);
}, [disabled]);
useEffect(
() => () => {
readToken.current += 1;
onBusyChangeRef.current(false);
},
[],
);usePlaygroundInput.ts Move the render-phase ref mutation into a const connectionState = useRef({ target, document, capabilities });
useEffect(() => {
connectionState.current = { target, document, capabilities };
}, [target, document, capabilities]); |
|
I'm Bonk, and I've done a quick review of your PR. This PR adds schema-driven input controls, validation utilities, and tests for the Cog playground. The code is well-structured and the test coverage is comprehensive. I found a few actionable issues:
I've posted the review with concrete code suggestions to PR #3111. |
|
Review disposition:
These are top-level comments, so GitHub provides no review thread to resolve. |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds schema-driven input controls, validation utilities, and tests for the Cog playground. The code is well-structured and the test coverage is comprehensive.
I found a few actionable issues:
useEffectEventis an experimental React API — This hook is not available in stable React releases and was excluded from React 19. Using it will break builds or runtime.- Busy state leak on unmount —
FileInputControldoesn't clear busy state when unmounting while a file read is in-flight. - Render-phase ref mutation —
usePlaygroundInputassigns to a ref during render, which violates React's purity rules and can cause issues with concurrent features.
|
I've posted a review to PR #3111 with three actionable issues:
All three have concrete code suggestions attached to the review. |
|
Follow-up disposition: |
|
LGTM |
Uh oh!
There was an error while loading. Please reload this page.