Skip to content

fix(web): vision_mode visible - #1996

Merged
shuqinzhao merged 1 commit into
release/v0.4.1from
fix/v0.4.1_zy
Aug 11, 2026
Merged

fix(web): vision_mode visible#1996
shuqinzhao merged 1 commit into
release/v0.4.1from
fix/v0.4.1_zy

Conversation

@shuqinzhao

@shuqinzhao shuqinzhao commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

Bug Fixes:

  • 当未启用图像视觉功能时,隐藏图像视觉模式选择,以防止出现无效配置。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Hide the image vision mode selection when image vision is not enabled to prevent invalid configuration.

@shuqinzhao
shuqinzhao merged commit 0203e97 into release/v0.4.1 Aug 11, 2026
3 checks passed
@shuqinzhao
shuqinzhao deleted the fix/v0.4.1_zy branch August 11, 2026 11:47
@sourcery-ai

sourcery-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

根据图像配置使图像视觉模式选择成为条件渲染,并连接被监听的 image 表单字段,使得只有在视觉已启用时才显示 vision_mode 控件。

用于条件渲染 image_vision_mode 控件的流程图

flowchart TD
  A[ParameterStep component] --> B["Form.useWatch([], form)"]
  B --> C[image object]
  C --> D{image.vision_enabled?}
  D -->|true| E[Render Form.Item image_vision_mode]
  D -->|false| F[Do not render image_vision_mode controls]
Loading

File-Level Changes

Change Details Files
仅在表单状态中启用了图像视觉功能时显示视觉模式单选按钮组。
  • Form.useWatch 的解构值中包含 image,以便在组件中获得图像配置
  • 在保持现有选项定义和渲染逻辑不变的前提下,将 vision_modeForm.ItemRadioGroupCard 包裹在对 image?.vision_enabled 的条件检查中
web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset/ParameterStep.tsx

Tips and commands

Interacting with Sourcery

  • 触发新审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 通过回复某条审查评论让 Sourcery 从该评论创建一个 Issue。你也可以在审查评论下回复 @sourcery-ai issue 来从中创建 Issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写上 @sourcery-ai,即可在任何时候生成一个标题。你也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写上 @sourcery-ai summary,即可在你想要的确切位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary 来在任何时候(重新)生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可在任何时候(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会非常有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。特别适用于你想从新的审查开始——别忘了再评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

访问你的 dashboard 来:

  • 启用或禁用诸如 Sourcery 生成的拉取请求摘要、审查者指南等审查功能。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

Makes the image vision mode selection conditional on the image configuration and wires the watched image form field so that vision_mode controls are only shown when vision is enabled.

Flow diagram for conditional rendering of image_vision_mode controls

flowchart TD
  A[ParameterStep component] --> B["Form.useWatch([], form)"]
  B --> C[image object]
  C --> D{image.vision_enabled?}
  D -->|true| E[Render Form.Item image_vision_mode]
  D -->|false| F[Do not render image_vision_mode controls]
Loading

File-Level Changes

Change Details Files
Show the vision mode radio group only when image vision is enabled in the form state.
  • Include image in the destructured values from Form.useWatch so image configuration is available in the component
  • Wrap the vision_mode Form.Item and RadioGroupCard in a conditional check for image?.vision_enabled while preserving existing option definitions and rendering logic
web/src/views/KnowledgeBase/[knowledgeBaseId]/CreateDataset/ParameterStep.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

嗨,我已经审查了你的修改,一切看起来都很棒!


Sourcery 对开源项目是免费的——如果你觉得我们的代码评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant