Skip to content

feat(Picker): 新增 onColumnScrollEnd 支持按需加载#958

Merged
RSS1102 merged 10 commits into
developfrom
rss1102/refactor/picker-filenames
Jun 9, 2026
Merged

feat(Picker): 新增 onColumnScrollEnd 支持按需加载#958
RSS1102 merged 10 commits into
developfrom
rss1102/refactor/picker-filenames

Conversation

@RSS1102

@RSS1102 RSS1102 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

🤔 这个 PR 的性质是?

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

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

🔗 相关 Issue

💡 需求背景和解决方案

refactor(picker): rename files and class names, and fix the loop of initialization variables.

📝 更新日志

  • feat(Picker): 新增 onColumnScrollEnd 支持按需加载并优化代码文件结构。

  • 本条 PR 不需要纳入 Changelog

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

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

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

RSS1102 and others added 3 commits June 4, 2026 22:50
- picker_column_wheel.dart → wheel_column.dart (PickerColumnWheel → WheelColumn)
- t_picker_items.dart → picker_data.dart (TPickerItems/TPickerColumns/TPickerLinked → PickerItems/PickerColumns/PickerLinked)
- t_picker_keys.dart → picker_keys.dart (TPickerKeys → PickerKeys)
- t_picker_normalize.dart → picker_normalize.dart (TPickerNormalize → PickerNormalize)
- t_item_widget.dart → picker_item.dart (TItemWidget → PickerItemWidget)
- t_picker_option.dart → picker_option.dart (TPickerOption → PickerOption)
- t_picker_value.dart → picker_value.dart (TPickerValue → PickerValue)
- no_wave_behavior.dart → wheel_behavior.dart (NoWaveBehavior → WheelBehavior)

同时更新外部引用组件 (date_time_picker, calendar) 的类名和 import 路径
合并 calendar 重构(#926)等 develop 变更;冲突文件 t_date_picker.dart 按 develop 方向删除。

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 refactors the Picker implementation by extracting reusable wheel/row layout building blocks, adds accessibility (Semantics) support for picker columns, and introduces a column-aware callback API to better support linked/lazy-loading scenarios.

Changes:

  • Refactor picker wheel rendering into new internal widgets (WheelColumn, MultiWheelLayout) and update DateTimePicker to reuse them.
  • Update Picker API/docs/examples: onChange now includes the triggering column index, and a new onColumnScrollEnd callback is added for end-of-scroll pagination triggers.
  • Add/expand widget tests for disabled-item correction, controller rebuild regressions, a11y semantics behaviors, and ItemDistanceCalculator.

Reviewed changes

Copilot reviewed 48 out of 50 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tdesign-site/src/picker/README.md Updates docs and examples for new onChange(int col, TPickerValue) signature and mentions onColumnScrollEnd.
tdesign-component/test/t_picker_test.dart Updates existing picker tests for new callback signature; adds regression/a11y/lazy-load related tests.
tdesign-component/test/item_distance_calculator_test.dart Adds coverage for ItemDistanceCalculator style mapping behavior.
tdesign-component/test/helpers/popup_test_resource.dart Extends test resource delegate with picker-related strings for semantics labels.
tdesign-component/lib/tdesign_flutter.dart Updates exports to new picker file structure (data/keys/value/option/item).
tdesign-component/lib/src/theme/resource_delegate.dart Adds picker semantics strings to TResourceDelegate and default delegate.
tdesign-component/lib/src/components/picker/wheel_column.dart New internal single-column wheel with disabled-item correction + dedup logic.
tdesign-component/lib/src/components/picker/wheel_behavior.dart Renames/marks internal scroll behavior for wheel use.
tdesign-component/lib/src/components/picker/t_picker.dart Major refactor: new callbacks, initState-only initialValue semantics, partial column updates, and Semantics wrappers.
tdesign-component/lib/src/components/picker/picker_value.dart Updates docs for new onChange(col, value) signature; imports renamed files.
tdesign-component/lib/src/components/picker/picker_option.dart New file for TPickerOption definition (renamed from prior file).
tdesign-component/lib/src/components/picker/picker_normalize.dart Updates imports to renamed picker files.
tdesign-component/lib/src/components/picker/picker_keys.dart New file for TPickerKeys (renamed from prior file).
tdesign-component/lib/src/components/picker/picker_item.dart Renames internal item widget and exposes ItemDistanceCalculator + builder type.
tdesign-component/lib/src/components/picker/picker_data.dart Updates imports to renamed picker files; keeps picker data sealed-class model.
tdesign-component/lib/src/components/picker/picker_column_wheel.dart Removes old per-column wheel widget in favor of WheelColumn.
tdesign-component/lib/src/components/picker/multi_wheel_layout.dart New internal shared layout shell for multi-column wheel + highlight strip.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker.dart Minor formatting change.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_wheel.dart Refactors to reuse WheelColumn + MultiWheelLayout; updates scroll behavior.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_snapshot.part.dart Formatting-only adjustments.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_labels.part.dart Formatting-only adjustments.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_internal.dart Updates imports to renamed picker data/option files.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_enums.dart Formatting-only adjustments.
tdesign-component/lib/src/components/date_time_picker/t_date_time_picker_bounds.part.dart Formatting-only adjustments.
tdesign-component/lib/src/components/date_time_picker/CALENDAR_LEGACY.md Removes legacy boundary documentation file.
tdesign-component/example/test/linked_lazy_picker_scope_test.dart Adds widget tests for linked lazy picker demo scope behavior.
tdesign-component/example/test/linked_lazy_picker_policy_test.dart Adds unit tests for lazy-load policy/cache helpers.
tdesign-component/example/lib/page/t_picker_page.dart Updates demo page for new callback signature and lazy-load demo refactor/caching.
tdesign-component/example/lib/page/t_form_page.dart Updates picker usage to new onChange(col, value) signature.
tdesign-component/example/lib/page/t_calendar_page.dart Minor demo updates (button theme + comment/style tweaks).
tdesign-component/example/lib/page/linked_lazy_picker_scope.dart Refactors demo lazy-load scope to use onColumnScrollEnd + caching policy.
tdesign-component/example/lib/page/linked_lazy_picker_policy.dart Adds lazy-load page/policy/cache helper types for the demo scope.
tdesign-component/example/lib/l10n/app_zh.arb Adds picker-related localized strings.
tdesign-component/example/lib/l10n/app_localizations.dart Adds picker-related localization getters.
tdesign-component/example/lib/l10n/app_localizations_zh.dart Implements picker-related zh localization strings.
tdesign-component/example/lib/l10n/app_localizations_en.dart Implements picker-related en localization strings.
tdesign-component/example/lib/l10n/app_en.arb Adds picker-related localized strings.
tdesign-component/example/lib/base/intl_resource_delegate.dart Wires picker strings into the example’s resource delegate.
tdesign-component/example/assets/code/picker.buildTimeSelect.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildSingleColumn.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildPopupLinked.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildMonthDaySelect.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildLinkedFiveLevel.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildLazyLoad.txt Updates snippet to recommend onColumnScrollEnd for pagination triggers.
tdesign-component/example/assets/code/picker.buildItemDisabled.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildGlobalDisabled.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildCustomSize.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildCustomKeys.txt Updates snippet for cached items + new onChange(col, value) signature.
tdesign-component/example/assets/code/picker.buildCustomItemBuilder.txt Updates snippet for new onChange(col, value) signature.
tdesign-component/demo_tool/all_build.sh Updates API generation list for picker types (currently incorrect names).

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

Comment thread tdesign-component/lib/src/components/picker/t_picker.dart Outdated
Comment thread tdesign-component/demo_tool/all_build.sh Outdated
Comment thread tdesign-component/lib/src/components/picker/t_picker.dart Outdated
@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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

完成

📱 APK 下载

tdesign-flutter-0.2.7-669.apk

Copilot AI left a comment

Copy link
Copy Markdown

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 55 out of 55 changed files in this pull request and generated 2 comments.

Comment thread tdesign-component/lib/src/components/picker/t_picker.dart
Comment thread tdesign-component/lib/src/components/picker/t_picker.dart
@RSS1102 RSS1102 changed the title refactor(picker): rename files and class names, and fix the loop of initialization variables. feat(Picker): 新增 onColumnScrollEnd 支持按需加载 Jun 9, 2026
@RSS1102
RSS1102 marked this pull request as ready for review June 9, 2026 08:17
@RSS1102
RSS1102 merged commit a3b2fda into develop Jun 9, 2026
7 of 8 checks passed
@RSS1102
RSS1102 deleted the rss1102/refactor/picker-filenames branch June 9, 2026 08:21
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