Skip to content

feat(popup): add useSafeArea for edge placements and optimize comments#950

Open
RSS1102 wants to merge 7 commits into
developfrom
rss1102/feat/popup-use-safe-area
Open

feat(popup): add useSafeArea for edge placements and optimize comments#950
RSS1102 wants to merge 7 commits into
developfrom
rss1102/feat/popup-use-safe-area

Conversation

@RSS1102
Copy link
Copy Markdown
Collaborator

@RSS1102 RSS1102 commented May 27, 2026

🤔 这个 PR 的性质是?

勾选规则:
1.只要有新增参数,就勾选”新特性提交“
2.只修改内部bug,未新增参数,才勾选”日常 bug 修复“
3.其他选项视具体改动判断

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • feat(popup): 为贴边弹出方向新增 useSafeArea

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • pr目标分支为develop分支,请勿直接往main分支合并
  • 标题格式为:组件类名: 修改描述(示例:TBottomTabBar: 修复iconText模式,底部溢出2.5像素)
  • ”相关issue“处带上修复的issue链接
  • 相关文档已补充或无须补充

@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ RSS1102
❌ autofix-ci[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

完成

📱 APK 下载

tdesign-flutter-0.2.7-587.apk

@RSS1102 RSS1102 changed the title feat(popup): add useSafeArea for edge placements feat(popup): add useSafeArea for edge placements and optimize comments May 28, 2026
@RSS1102 RSS1102 closed this May 28, 2026
@RSS1102 RSS1102 reopened this May 28, 2026
Copy link
Copy Markdown

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

本 PR 主要为 TPopup 贴边弹出(top/bottom/left/right)新增 useSafeArea 配置,用于根据系统安全区(刘海/状态栏/手势区域)对浮层定位进行避让;同时对站点侧组件 API 文档进行了结构化整理(补充“简介”、调整段落/顺序、统一部分行内标记风格)。

Changes:

  • TPopupOptions 增加 useSafeArea(默认 true),并在路由/布局层将安全区 padding 叠加到贴边方向的 Positioned 定位中。
  • 增补/调整 popup 相关单测,覆盖 safePaddingForwrapPositioned 的安全区叠加行为。
  • 批量优化 tdesign-site/src/**/README.md API 文档结构与表述(新增“简介”、调整内容块位置、统一部分引用为反引号等)。

Reviewed changes

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

Show a summary per file
File Description
tdesign-component/lib/src/components/popup/_popup_route.dart 在路由过渡构建时计算并传递 safePadding,将 useSafeArea 串联到实际布局定位。
tdesign-component/lib/src/components/popup/_popup_layout.dart 新增 safePaddingFor 并在 wrapPositioned 中将安全区 padding 与 inset 叠加到贴边方向定位。
tdesign-component/lib/src/components/popup/t_popup_options.dart 新增 useSafeArea 公共参数(含工厂构造、copyWith/normalized 支持)并补充说明。
tdesign-component/test/t_popup_layout_test.dart 增加 safePadding 提取/叠加相关测试用例。
tdesign-component/test/t_popup_options_test.dart 增加 useSafeArea 默认值与 copyWith 更新的测试覆盖。
tdesign-site/src/popup/README.md 更新 Popup API 文档:补充说明与参数表(包含 useSafeArea),并重排/精简部分文案。
tdesign-site/src/text/README.md 为文本组件补充“简介/设计原则/技巧”等说明,并调整 API 段落结构。
tdesign-site/src/time-counter/README.md 调整样式工厂方法与状态枚举等文档结构位置。
tdesign-site/src/tab-bar/README.md 为配置类型补充“简介”并统一 API 文档结构。
tdesign-site/src/toast/README.md 为 TToast API 增加“简介”。
tdesign-site/src/textarea/README.md 优化参数说明的行内标记(maxLength/maxLines 等)。
tdesign-site/src/tag/README.md 为 TTag / TSelectTag / TTagStyle 补充“简介”,并调整 API 章节顺序。
tdesign-site/src/tabs/README.md 调整枚举章节顺序/命名展示,使枚举说明与类型更匹配。
tdesign-site/src/table/README.md 调整 typedef 章节顺序/命名展示,并补充部分“简介”。
tdesign-site/src/swiper/README.md 调整 TPageTransformer 构造方法与工厂方法文档的顺序。
tdesign-site/src/swipe-cell/README.md 优化 API 文档格式与行内标记(反引号替代部分方括号引用)。
tdesign-site/src/steps/README.md 为 Steps 相关类型补充“简介”。
tdesign-site/src/stepper/README.md 为 Stepper 补充“简介”。
tdesign-site/src/slider/README.md 为 Slider/RangeSlider 补充“简介”。
tdesign-site/src/rate/README.md 为 Rate 补充“简介”并优化部分行内标记。
tdesign-site/src/radio/README.md 调整 RadioGroup 简介段落排版(去掉缩进/换行)。
tdesign-site/src/pull-down-refresh/README.md 优化参数说明的行内标记(反引号替代方括号引用)。

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

Comment on lines +150 to +154
final safePadding = PopupLayout.safePaddingFor(
options.placement,
MediaQuery.paddingOf(context),
options.useSafeArea,
);

## 字段与 [TPopupPlacement]
`TPopup.show` 的配置对象。
## 如何创建
Comment on lines +615 to +616
| onClose | VoidCallback? | - | 开始关闭时触发(与 [onVisibleChange](false, …) 同期)。 |
| onClosed | VoidCallback? | - | 展示周期结束触发;通常于关闭动画结束后,被直接移除时可能无动画。 |
Comment on lines +714 to +716
### TTimeCounterStatus
#### 简介
计时组件控制器转态
Comment on lines +216 to +218
第二步,正则替换如下:
匹配(前半有默认值,后半无默认值):this\.(`a-z|A-Z`+)[]*`\=`+[]*`a-z|A-Z`+\,|this\.(`a-z|A-Z`+)\,
替换:$1$2: this.$1$2,
Comment on lines 604 to 607
### BadgeConfig
#### 简介
飘新配置
#### 默认构造方法
Comment on lines 369 to +373
#### 简介
RadioGroup分组对象,继承自TCheckboxGroup,字段含义与父类一致
RadioGroup应该嵌套在RadioGroup内,所有在RadioGroup的RadioButton只能有一个被选中

cardMode: 使用卡片样式,需要配合direction 和 directionalTdRadios 使用,
组合为横向、纵向卡片,同时需要在每个TRadio上设置cardMode参数。
RadioGroup应该嵌套在RadioGroup内,所有在RadioGroup的RadioButton只能有一个被选中
cardMode: 使用卡片样式,需要配合direction 和 directionalTdRadios 使用,
组合为横向、纵向卡片,同时需要在每个TRadio上设置cardMode参数。
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