Skip to content

refactor(example): 重组全组件 Demo 并映射 Web 文档 - #1142

Merged
RSS1102 merged 24 commits into
developfrom
rss1102/refactor/demo-example-web-mapping
Sep 20, 2026
Merged

RSS1102 merged 24 commits into
developfrom
rss1102/refactor/demo-example-web-mapping

Conversation

@RSS1102

@RSS1102 RSS1102 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

🤔 这个 PR 的性质是?

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

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

🔗 相关 Issue

无关联 Issue;本 PR 延续 #1139 的 Demo 结构整理。

💡 需求背景和解决方案

原有 Example 页面同时承担页面入口、示例元数据、状态和具体实现;Web 组件文档又保存手写 Dart 副本,容易与实际运行 Demo 分叉。

本 PR 完成:

  • 将 57 个组件 Demo 及 Font、Radius、Shadows 3 个基础页面统一整理到 example/lib/page/<component>/,形成 60 个 <component>_page.dart 入口;
  • 页面入口直接保存 ExampleModule 分组、完整 ExampleItem 元数据与顺序,不保留只承载分组的模块文件;
  • 将 375 个公开 ExampleItem 各自迁入一个语义化独立文件;运行 Demo 与可复制代码引用同一个 Widget,状态、Controller、局部数据、helper 和生命周期归属对应示例;
  • Calendar、Sidebar、Form、Progress、Stepper、Tag、TreeSelect 等辅助 example 一并整理;Sidebar 的多文件辅助页通过显式 includes 合并,不由解析器猜测隐藏依赖;
  • 新增严格页面 manifest 与 flutter-example-group 文档指令,Web 按公开分组、描述和顺序展开生成资产;缺失清单、非法映射或未注册资产直接失败,不再回退到目录扫描;
  • 57 份组件文档映射 365 份组件示例,Font、Radius、Shadows 对应另外 10 份基础示例,共 375 份;
  • 新增 Demo 结构、生成资产及 Web 全量映射门禁,阻止页面私有状态回流、模块文件回流、资产漂移及手写 Dart 副本回流。

设计与验收记录:specs/045-example-code-web-mapping

本 PR 不修改组件公开 API、默认行为或视觉结果,不属于 breaking change。

本地验证结果:

  • Flutter 3.32.0 / 3.47.0:根包与 example 子包 flutter analyze 均通过,0 issues;
  • Demo 结构检查通过:60 个入口、0 个旧分组文件、375 个公开 ExampleItem 与独立代码资产一一对应;
  • 示例生成器 --check 通过,严格生成器测试 11/11;
  • example 全量非视觉测试通过:69 个测试文件、294/294;
  • Web 映射测试 6/6,通过全量检查:57 份组件文档映射 365 份组件示例,另有 10 份基础示例;
  • npm run site 生产构建通过,108 modules transformed;
  • macOS Golden 仅出现平台字体栅格差异,未修改 Linux 权威基线;最终以本 PR 最新 head 的 Linux Flutter 3.32 CI 为准。

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

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

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

  • 标题遵循 Conventional Commits 格式:type(<scope>?): 修改描述
    示例:fix(TBottomTabBar): 修复 iconText 模式底部溢出
  • “相关 Issue”处带上修复的 Issue 链接或无关联 Issue
  • 已添加对应的 Spec 链接,或已由 Review 确认本次改动无需 Spec
  • 相关文档已补充或无须补充

@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

完成

Web Demo

APK 下载

@RSS1102
RSS1102 marked this pull request as draft September 19, 2026 20:05
@RSS1102 RSS1102 changed the title refactor(example): 统一全组件示例与 Web 文档映射 refactor(example): 重组全组件 Demo 并映射 Web 文档 Sep 19, 2026
@RSS1102
RSS1102 marked this pull request as ready for review September 19, 2026 20:43
@RSS1102
RSS1102 marked this pull request as draft September 20, 2026 01:58
@RSS1102
RSS1102 marked this pull request as ready for review September 20, 2026 05:26
@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.

@RSS1102
RSS1102 merged commit 47e070a into develop Sep 20, 2026
17 of 18 checks passed
@RSS1102
RSS1102 deleted the rss1102/refactor/demo-example-web-mapping branch September 20, 2026 10:46
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.

2 participants