Skip to content

fix(): popover组件新增configProps属性 Closes MONITOR-10409#528

Merged
panzekun merged 1 commit intomasterfrom
zhendong/fix
Feb 3, 2026
Merged

fix(): popover组件新增configProps属性 Closes MONITOR-10409#528
panzekun merged 1 commit intomasterfrom
zhendong/fix

Conversation

@gdutzhendong
Copy link
Contributor

@gdutzhendong gdutzhendong commented Feb 3, 2026

依赖检查

组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。

请勾选以下两组选项其中之一:

  • 本次 MR 没有使用上游组件(例如框架、后台组件等)的较新版本提供的特性。

或者:

  • 本次 MR 使用了上游组件(例如框架、后台组件等)的较新版本提供的特性。
  • 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。

提交信息检查

Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。

破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:

  • 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
  • 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。

例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。

破坏性变更:

  • ⚠️ 本次 MR 包含破坏性变更的提交,请继续确认以下所有选项:
  • 没有更好的兼容方案,必须做破坏性变更。
  • 使用了 feat 作为提交类型。
  • 标注了 BREAKING CHANGE: 你的变更说明
  • 同时更新了本仓库中所有下游使用者的调用。
  • 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
  • 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
  • 手动验证过破坏性变更在 Migrate 后可以正常工作。
  • 破坏性变更所在的提交没有意外携带其它子包的改动。

新特性:

  • 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 feat 作为提交类型。
  • 给新特性添加了单元测试。
  • 手动验证过新特性可以正常工作。

问题修复:

  • 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 fix 作为提交类型。
  • 给问题修复添加了单元测试。
  • 手动验证过问题修复得到解决。

杂项工作:

即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:

  • 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 chore, docs, test 等作为提交类型。

Summary by CodeRabbit

发布说明

  • 新功能

    • Popover 容器组件支持传入通用配置(configProps),可向弹出层注入自定义展示或行为设置。
  • 改进

    • 新配置在所有渲染路径中生效,增强一致性与可定制性。
    • 优化了公开属性与类型声明,提升可维护性与兼容性。

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

工作流程

为 PopoverContainer 添加可选 configProps?: Record<string, any> 并将其自上而下传入 Popover;在所有渲染路径中通过展开运算符将 configProps 合并入最终传递给 Popover 的 props(无条件应用)。

变更

Cohort / File(s) Summary
PopoverContainer 核心组件
bricks/basic-bricks/src/popover-container/PopoverContainer.tsx
PopoverContainerProps 中新增可选 configProps?: Record<string, any>;在构建 Popover 元素时无条件展开并合并 ...props.configProps 到 Popover props;移除原先用于 zIndex 的 @ts-ignore 注释。
PopoverContainerElement 容器
bricks/basic-bricks/src/popover-container/index.tsx
PopoverContainerElement 类上新增公开属性 configProps: Record<string, any> = {},并在 render 时将其传递给内部 PopoverContainer;调整若干类型声明的格式细节(无功能变化)。

估计代码审查工作量

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed 标题清晰地总结了主要变更:为popover组件新增configProps属性,并包含关联的issue编号,与代码改动完全相符。
Description check ✅ Passed 描述包含了必需的依赖检查和提交信息检查部分。作者正确标记了依赖检查(未使用上游新特性)和问题修复分类,并确认了手动验证。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zhendong/fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@bricks/basic-bricks/src/popover-container/PopoverContainer.tsx`:
- Around line 188-198: The current spread of props.configProps can overwrite
critical Popover props; change the JSX so props.configProps is spread first and
then explicitly set Popover props (title via BrickAsComponent, visible,
placement, content, trigger, onVisibleChange, etc.) are spread after it so those
controlled values cannot be clobbered; locate the block using
props.popoverTitleBrick?.useBrick, props.configProps and BrickAsComponent in
PopoverContainer.tsx and reorder the spreads so explicit props follow
props.configProps.
🧹 Nitpick comments (1)
bricks/basic-bricks/src/popover-container/index.tsx (1)

308-311: 缺少 JSDoc 文档注释。

其他属性都有完整的 JSDoc 文档(包括 @kind@required@default@description@group 等注解),但 configProps 缺少这些文档。这会影响自动生成的文档和开发者体验。

📝 建议添加文档注释
+  /**
+   * `@kind` Record<string, any>
+   * `@required` false
+   * `@default` {}
+   * `@description` 透传给 Popover 组件的额外配置属性
+   * `@group` basic
+   */
   `@property`({
     attribute: false,
   })
   configProps: Record<string, any> = {};

@panzekun panzekun merged commit d72d65e into master Feb 3, 2026
3 checks passed
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.

2 participants