Skip to content

fix:fix the problem that frontend can not corectly render after ml-ba… - #9877

Open
Dan5N wants to merge 2 commits into
HumanSignal:developfrom
Dan5N:develop
Open

fix:fix the problem that frontend can not corectly render after ml-ba…#9877
Dan5N wants to merge 2 commits into
HumanSignal:developfrom
Dan5N:develop

Conversation

@Dan5N

@Dan5N Dan5N commented Aug 5, 2026

Copy link
Copy Markdown

…ckend return rles

Fixes #9876
the returned rles can correctly processed by frontend now
image

This pull request simplifies the implementation of the SuggestionControls component and its integration in the RegionWrapper. The main changes involve removing the useLayer prop and related conditional logic, resulting in a more straightforward and maintainable codebase.

Component simplification and prop removal:

  • Removed the useLayer prop from SuggestionControls and all related conditional logic, so the component now always renders its content in a consistent way. [1] [2] [3]
  • Updated RegionWrapper to no longer pass the useLayer prop or conditionally render SuggestionControls, further simplifying its logic.

Code cleanup:

  • Removed unused imports (Layer, ImageViewContext, and SuggestionControls) from RegionWrapper.jsx and the unused Layer import from SuggestionControls.jsx. [1] [2]

@Dan5N
Dan5N requested a review from hlomzik as a code owner August 5, 2026 02:12
Copilot AI review requested due to automatic review settings August 5, 2026 02:12
@Dan5N
Dan5N requested a review from nick-skriabin as a code owner August 5, 2026 02:12
@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 8ed6158

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 8ed6158

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 8ed6158
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/6a7305208578be0008e43a6b
😎 Deploy Preview https://deploy-preview-9877--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 8ed6158
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/6a7305208a39f9000884358a
😎 Deploy Preview https://deploy-preview-9877--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 Layer usage and the useLayer prop from SuggestionControls, always rendering controls as a Group.
  • Simplified RegionWrapper by removing the suggestion-context handling and SuggestionControls rendering.
  • 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.

Comment on lines +2 to 8
import { Fragment } from "react";

export const RegionWrapper = observer(({ children }) => {
return (
<Fragment>
{children}
{suggestion && <SuggestionControls item={item} useLayer={item.type === "brushregion"} />}
</Fragment>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  • RegionWrapper no longer renders SuggestionControls (and no longer reads ImageViewContext.suggestion), but SuggestionControls is now unused across the repo and appears to be the only UI that calls annotation.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 the SuggestionControls render in RegionWrapper, passing only item (no useLayer) so the crash fix remains.
export const RegionWrapper = observer(({ children }) => {
  return (
    <Fragment>
      {children}
    </Fragment>

@Dan5N
Dan5N requested a review from a team as a code owner August 5, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a blank screen may appear after submission

2 participants