fix:fix the problem that frontend can not corectly render after ml-ba… - #9877
fix:fix the problem that frontend can not corectly render after ml-ba…#9877Dan5N wants to merge 2 commits into
Conversation
…ckend return rles
👷 Deploy request for heartex-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for label-studio-docs-new-theme pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR modifies how suggestion accept/reject controls are rendered in the Konva image view, aiming to simplify the SuggestionControls implementation by removing the useLayer-driven rendering path (and its Layer usage) and adjusting RegionWrapper integration.
Changes:
- Removed
Layerusage and theuseLayerprop fromSuggestionControls, always rendering controls as aGroup. - Simplified
RegionWrapperby removing the suggestion-context handling andSuggestionControlsrendering. - Cleaned up related imports.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web/libs/editor/src/regions/RegionWrapper.jsx | Removes suggestion-context consumption and stops rendering SuggestionControls. |
| web/libs/editor/src/components/ImageView/SuggestionControls.jsx | Removes useLayer prop and Layer wrapper; always renders the controls as a Group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { Fragment } from "react"; | ||
|
|
||
| export const RegionWrapper = observer(({ children }) => { | ||
| return ( | ||
| <Fragment> | ||
| {children} | ||
| {suggestion && <SuggestionControls item={item} useLayer={item.type === "brushregion"} />} | ||
| </Fragment> |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
web/libs/editor/src/regions/RegionWrapper.jsx:8
RegionWrapperno longer rendersSuggestionControls(and no longer readsImageViewContext.suggestion), butSuggestionControlsis now unused across the repo and appears to be the only UI that callsannotation.acceptSuggestion/rejectSuggestion. This effectively removes the ability to accept/reject suggestions and seems inconsistent with the PR description ("simplifies ... integration in the RegionWrapper"). Consider restoring theSuggestionControlsrender inRegionWrapper, passing onlyitem(nouseLayer) so the crash fix remains.
export const RegionWrapper = observer(({ children }) => {
return (
<Fragment>
{children}
</Fragment>
…ckend return rles
Fixes #9876

the returned rles can correctly processed by frontend now
This pull request simplifies the implementation of the
SuggestionControlscomponent and its integration in theRegionWrapper. The main changes involve removing theuseLayerprop and related conditional logic, resulting in a more straightforward and maintainable codebase.Component simplification and prop removal:
useLayerprop fromSuggestionControlsand all related conditional logic, so the component now always renders its content in a consistent way. [1] [2] [3]RegionWrapperto no longer pass theuseLayerprop or conditionally renderSuggestionControls, further simplifying its logic.Code cleanup:
Layer,ImageViewContext, andSuggestionControls) fromRegionWrapper.jsxand the unusedLayerimport fromSuggestionControls.jsx. [1] [2]