Introduce adaptive OSSLibrariesLicensePage with LicenseDetailView - #4
Merged
Merged
Conversation
- 移除独立的 OSSLibrariesLicenseListPage 和 OSSLibrariesLicenseDetailPage 页面 - 新增 OSSLibrariesLicensePage 自适应页面,支持手机和大屏设备 - 新增 LicenseDetailView 组件用于详情内容展示 - 更新路由配置和页面导入路径 - 修改 README 文档中的页面引用说明 - 添加对平板和电视设备的支持 - 重构导航逻辑,使用 NavDestination 实现分栏布局
- 添加 navigationMode 状态管理分栏模式 - 设置导航栏宽度为 37.5% 以适配分栏布局 - 监听导航模式变化并更新界面状态 - 根据分栏模式动态调整详情页标题栏显示逻辑 - 在分栏模式下隐藏返回按钮并使用库名作为主标题 - 添加 detailTitleOf 方法处理分栏模式下的标题显示
- 适配大屏设备,如平板、折叠屏、智慧屏 - 列表页与详情页合并为单个自适应容器页 OSSLibrariesLicensePage - 替换 OSSLibrariesLicenseListPage / OSSLibrariesLicenseDetailPage - 升级 deveco-cli 从 1.2.2 到 1.3.0 - 升级 vite 为 @voidzero-dev/vite-plus-core@0.2.8 - 升级 pnpm 版本从 11.20.0 到 11.22.0 - 更新多个依赖包版本包括 hono、content-type、ws 等
- 将 HAR_VERSION 从 0.0.7 更新到 0.0.8 - 更新 entry 中依赖的 osslibraries_ui 版本号
Contributor
Reviewer's Guide将开源许可证 UI 重构为自适应的单页面容器,内嵌可复用的详情视图组件;更新导出与文档到新路由;同时为平板适配版本提升工具链与 HAR 版本。 自适应许可证页面从列表到详情的导航时序图sequenceDiagram
actor User
participant OSSLibrariesLicensePage
participant LibsLoader
participant LibsHolder
participant NavPathStack
participant HdsNavigation
participant LicenseDetailView
User->>OSSLibrariesLicensePage: open OSSLibrariesLicensePage
OSSLibrariesLicensePage->>OSSLibrariesLicensePage: aboutToAppear()
OSSLibrariesLicensePage->>LibsLoader: fromRawfile(context)
LibsLoader-->>OSSLibrariesLicensePage: libs
OSSLibrariesLicensePage->>LibsHolder: set(libs)
OSSLibrariesLicensePage->>HdsNavigation: build() with NavBar and DetailDestination
User->>OSSLibrariesLicensePage: tap LicenseItem
OSSLibrariesLicensePage->>OSSLibrariesLicensePage: navigateToDetail(uniqueId)
alt pathStack has detail
OSSLibrariesLicensePage->>NavPathStack: replacePathByName(UI_DETAIL_PAGE_ROUTE, params)
else no detail yet
OSSLibrariesLicensePage->>NavPathStack: pushPathByName(UI_DETAIL_PAGE_ROUTE, params)
end
HdsNavigation->>OSSLibrariesLicensePage: DetailDestination(name, pageInfos)
OSSLibrariesLicensePage->>LicenseDetailView: construct with uniqueId
LicenseDetailView->>LicenseDetailView: aboutToAppear()
LicenseDetailView->>LibsHolder: get()
LibsHolder-->>LicenseDetailView: libs
LicenseDetailView->>LicenseDetailView: findLibrary(uniqueId) and render details
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience打开你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideRefactors the OSS license UI into an adaptive single-page container with a reusable detail view, updates exports and documentation to the new route, and bumps tooling versions and HAR version for the tablet-ready release. Sequence diagram for adaptive license page navigation from list to detailsequenceDiagram
actor User
participant OSSLibrariesLicensePage
participant LibsLoader
participant LibsHolder
participant NavPathStack
participant HdsNavigation
participant LicenseDetailView
User->>OSSLibrariesLicensePage: open OSSLibrariesLicensePage
OSSLibrariesLicensePage->>OSSLibrariesLicensePage: aboutToAppear()
OSSLibrariesLicensePage->>LibsLoader: fromRawfile(context)
LibsLoader-->>OSSLibrariesLicensePage: libs
OSSLibrariesLicensePage->>LibsHolder: set(libs)
OSSLibrariesLicensePage->>HdsNavigation: build() with NavBar and DetailDestination
User->>OSSLibrariesLicensePage: tap LicenseItem
OSSLibrariesLicensePage->>OSSLibrariesLicensePage: navigateToDetail(uniqueId)
alt pathStack has detail
OSSLibrariesLicensePage->>NavPathStack: replacePathByName(UI_DETAIL_PAGE_ROUTE, params)
else no detail yet
OSSLibrariesLicensePage->>NavPathStack: pushPathByName(UI_DETAIL_PAGE_ROUTE, params)
end
HdsNavigation->>OSSLibrariesLicensePage: DetailDestination(name, pageInfos)
OSSLibrariesLicensePage->>LicenseDetailView: construct with uniqueId
LicenseDetailView->>LicenseDetailView: aboutToAppear()
LicenseDetailView->>LibsHolder: get()
LibsHolder-->>LicenseDetailView: libs
LicenseDetailView->>LicenseDetailView: findLibrary(uniqueId) and render details
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并留下了一些整体反馈:
- 在
navigateToDetail中,当pathStack.size() > 0时总是替换现有路径,可能会在无意中丢弃其他目的地;可以考虑在决定使用pushPathByName还是replacePathByName之前,先检查栈顶路径是否已经是详情路由。 HdsNavigation和HdsNavDestination当前都对background_secondary和 MINI 标题模式进行了硬编码;如果你预期不同宿主应用的主题或标题栏行为会有所差异,建议将这些值参数化,或复用一个共享的辅助方法,以避免后续出现重复代码。
面向 AI Agents 的提示
Please address the comments from this code review:
## Overall Comments
- In `navigateToDetail`, always replacing the existing path when `pathStack.size() > 0` may unintentionally discard other destinations; consider checking whether the top path is already a detail route before deciding between `pushPathByName` and `replacePathByName`.
- Both `HdsNavigation` and `HdsNavDestination` currently hard-code `background_secondary` and MINI title modes; if you expect theming or title-bar behavior to vary per host app, consider parameterizing these values or reusing a shared helper to avoid later duplication.
## Individual Comments
### Comment 1
<location path="skills/osslibraries-usage/SKILL.md" line_range="268" />
<code_context>
-| `LicenseDetailParams` | Detail page route params interface, field `uniqueId: string` |
+| `LicenseDetailParams` | Detail route params interface, field `uniqueId: string` |
Route names are centralized in `RouteNames.ets` (`UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE`); host apps should import and reuse these constants instead of string literals.
</code_context>
<issue_to_address>
**suggestion:** Consider clarifying how the `UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE` constants relate to the new single `OSSLibrariesLicensePage`.
Since the routes are now served by a single adaptive `OSSLibrariesLicensePage`, this line referencing separate `UI_LIST_PAGE_ROUTE` and `UI_DETAIL_PAGE_ROUTE` could be clearer. Please indicate whether both constants now resolve to the same page or if one is deprecated, so integrators understand how to use them correctly.
Suggested implementation:
```
| `OSSLibrariesLicensePage` | Adaptive license page used for both list and detail routes |
```
```
Route names are centralized in `RouteNames.ets` (`UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE`); host apps should import and reuse these constants instead of string literals. Both route constants currently resolve to the same adaptive `OSSLibrariesLicensePage` component: `UI_LIST_PAGE_ROUTE` is intended for the main license list entry point, while `UI_DETAIL_PAGE_ROUTE` is used for deep-linking into a specific library's detail. The routing layer renders the same page in both cases, and `UI_DETAIL_PAGE_ROUTE` remains supported for backward compatibility with existing integrations.
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈改进后续评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In
navigateToDetail, always replacing the existing path whenpathStack.size() > 0may unintentionally discard other destinations; consider checking whether the top path is already a detail route before deciding betweenpushPathByNameandreplacePathByName. - Both
HdsNavigationandHdsNavDestinationcurrently hard-codebackground_secondaryand MINI title modes; if you expect theming or title-bar behavior to vary per host app, consider parameterizing these values or reusing a shared helper to avoid later duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `navigateToDetail`, always replacing the existing path when `pathStack.size() > 0` may unintentionally discard other destinations; consider checking whether the top path is already a detail route before deciding between `pushPathByName` and `replacePathByName`.
- Both `HdsNavigation` and `HdsNavDestination` currently hard-code `background_secondary` and MINI title modes; if you expect theming or title-bar behavior to vary per host app, consider parameterizing these values or reusing a shared helper to avoid later duplication.
## Individual Comments
### Comment 1
<location path="skills/osslibraries-usage/SKILL.md" line_range="268" />
<code_context>
-| `LicenseDetailParams` | Detail page route params interface, field `uniqueId: string` |
+| `LicenseDetailParams` | Detail route params interface, field `uniqueId: string` |
Route names are centralized in `RouteNames.ets` (`UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE`); host apps should import and reuse these constants instead of string literals.
</code_context>
<issue_to_address>
**suggestion:** Consider clarifying how the `UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE` constants relate to the new single `OSSLibrariesLicensePage`.
Since the routes are now served by a single adaptive `OSSLibrariesLicensePage`, this line referencing separate `UI_LIST_PAGE_ROUTE` and `UI_DETAIL_PAGE_ROUTE` could be clearer. Please indicate whether both constants now resolve to the same page or if one is deprecated, so integrators understand how to use them correctly.
Suggested implementation:
```
| `OSSLibrariesLicensePage` | Adaptive license page used for both list and detail routes |
```
```
Route names are centralized in `RouteNames.ets` (`UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE`); host apps should import and reuse these constants instead of string literals. Both route constants currently resolve to the same adaptive `OSSLibrariesLicensePage` component: `UI_LIST_PAGE_ROUTE` is intended for the main license list entry point, while `UI_DETAIL_PAGE_ROUTE` is used for deep-linking into a specific library's detail. The routing layer renders the same page in both cases, and `UI_DETAIL_PAGE_ROUTE` remains supported for backward compatibility with existing integrations.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- 修复了 navigateToDetail 方法中的页面覆盖逻辑,使其更加安全 - 添加了对页面栈中详情页状态的准确判断 - 更新了 SKILL.md 中关于路由名称使用的详细说明 - 发布 v0.0.9 版本
- 将修复类型从 bug fix 调整为代码重构优化 - 提升 navigateToDetail 函数的安全性和稳定性 - 改进覆盖逻辑的实现方式以增强健壮性
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.
Summary by Sourcery
引入一个自适应的统一许可证页面,将列表视图和详情视图结合在一起,并将许可证详情重构为可复用的内容组件。
New Features:
OSSLibrariesLicensePage,这是一个自适应容器页面,在手机和大屏布局中使用单一的 HdsNavigation 展示许可证列表和详情。LicenseDetailView暴露为独立组件,以便在导航目的地中复用。Enhancements:
LicenseDetailView,通过传入的 uniqueId 从LibsHolder读取数据,而不是使用路由参数。Build:
Documentation:
Original summary in English
Summary by Sourcery
Introduce a single adaptive license page that combines list and detail views and refactor the license detail into a reusable content component.
New Features:
OSSLibrariesLicensePage, an adaptive container page that shows the license list and detail using a single HdsNavigation for phone and large-screen layouts.LicenseDetailViewas a standalone component for reuse in navigation destinations.Enhancements:
LicenseDetailViewthat reads data fromLibsHoldervia a passed uniqueId instead of router params.Build:
Documentation: