Skip to content

Conversation

@trean
Copy link
Contributor

@trean trean commented Dec 8, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a configurable side panel feature to the collection creation form, allowing consumers to preview form output in real-time. It also includes field name standardization for token length parameters.

Key Changes:

  • Refactored output preparation to support preview functionality by splitting prepareOutput into preprocessOutput (for preview) and prepareOutput (for validation)
  • Standardized field names from min_token_length/max_token_length to min_token_len/max_token_len across the codebase
  • Replaced the fixed sidebar with a configurable sidebar that displays custom preview content via the onPreviewFormOutput prop

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/prepareOutput.js Refactored to split output preparation logic, added filter for defensive programming, and renamed token length fields to use abbreviated names
src/inputs/ButtonGroupWithInputs.jsx Updated field names in documentation comments to match new abbreviated token length naming
src/flow.js Minor formatting improvement for multiline description text
src/collection-schema.jtd.json Updated schema to use abbreviated token length field names and removed trailing whitespace
src/ThemedComponents.jsx Restructured sidebar styling from absolute to sticky positioning, added scrolling support, and simplified component structure
src/Sidebar.jsx New component that renders customizable sidebar content using the preview output function
src/CreateCollectionForm.jsx Replaced hideSidebar prop with onPreviewFormOutput prop, integrated new Sidebar component, and updated layout to use responsive grid system
package-lock.json Updated dependency resolution (removed peer flags), and minor version bumps for js-yaml and vite

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 349 to +352
export const CCFormSidebarInner = styled(Box, {
name: "MuiCreateCollectionForm",
slot: "sidebarStickyInner",
})(({ theme }) => ({
position: "sticky",
top: "2rem",
[theme.breakpoints.down("md")]: {
position: "static",
},
}));
})();
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CCFormSidebarInner styled component now has an empty implementation () with no styles. However, it's still being used in the CCFormSidebar component (line 357) as a wrapper. Consider removing this component entirely if it serves no styling purpose, or document why it's kept as a structural component.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +15
setOutputData(handleOutput(previewOutput(formData, path)));
}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useEffect hook is missing handleOutput cleanup logic. If handleOutput becomes null or undefined after initially being set, the outputData will retain its previous value instead of being cleared. Consider adding an else clause to set outputData to null when handleOutput is not a function.

Suggested change
setOutputData(handleOutput(previewOutput(formData, path)));
}
setOutputData(handleOutput(previewOutput(formData, path)));
} else {
setOutputData(null);
}
} else {
setOutputData(null);

Copilot uses AI. Check for mistakes.
</CCFormButton>
</Grid>
) : (
<></>
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The empty fragment <></> is unnecessary. Consider using null instead for cleaner code when nothing needs to be rendered.

Suggested change
<></>
null

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants