feat(popup): add useSafeArea for edge placements and optimize comments#950
Open
RSS1102 wants to merge 7 commits into
Open
feat(popup): add useSafeArea for edge placements and optimize comments#950RSS1102 wants to merge 7 commits into
useSafeArea for edge placements and optimize comments#950RSS1102 wants to merge 7 commits into
Conversation
Member
|
|
Contributor
📱 APK 下载 |
useSafeArea for edge placementsuseSafeArea for edge placements and optimize comments
There was a problem hiding this comment.
Pull request overview
本 PR 主要为 TPopup 贴边弹出(top/bottom/left/right)新增 useSafeArea 配置,用于根据系统安全区(刘海/状态栏/手势区域)对浮层定位进行避让;同时对站点侧组件 API 文档进行了结构化整理(补充“简介”、调整段落/顺序、统一部分行内标记风格)。
Changes:
- 为
TPopupOptions增加useSafeArea(默认true),并在路由/布局层将安全区 padding 叠加到贴边方向的Positioned定位中。 - 增补/调整 popup 相关单测,覆盖
safePaddingFor与wrapPositioned的安全区叠加行为。 - 批量优化
tdesign-site/src/**/README.mdAPI 文档结构与表述(新增“简介”、调整内容块位置、统一部分引用为反引号等)。
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参数。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
feat(popup): 为贴边弹出方向新增
useSafeArea本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单
组件类名: 修改描述(示例:TBottomTabBar: 修复iconText模式,底部溢出2.5像素)