fix(ai-pick): derive tab count from detail list
This commit is contained in:
@@ -1,29 +1,28 @@
|
|||||||
# AGENTS.md
|
# AGENTS.md
|
||||||
|
|
||||||
## Repository
|
## Repository and validation
|
||||||
|
|
||||||
- This is the HarmonyOS stage-mode HAR `@b2c/first_page` (`biz_firstpage`), not a host app. The host supplies several hoisted dependencies and runtime services.
|
- Stage-mode HAR `@b2c/first_page`: main module `biz_firstpage`, with a separate `src/ohosTest` Hypium test module. Root `Index.ets` is the host-facing export surface.
|
||||||
- There is no standalone build: `hvigorw`, `oh_modules`, and the sibling `../biz_quote` dependency are absent here. Do not add undeclared host dependencies or claim build/test success; verify ArkTS changes by inspection and in the host project.
|
- This checkout is not independently runnable: `hvigorfile.ts` defines HAR tasks, but `hvigorw`, `oh_modules`, and sibling `../biz_quote` are absent. Sources also use host-provided modules beyond the root manifest's `biz_quote` and theme-manager dependencies.
|
||||||
- Load the `arkts-grammar-standards` skill before modifying `.ets` files.
|
- Do not claim local build or test success, add host dependencies, or invent standalone commands. Validate integration, including `src/ohosTest` scaffolding where applicable, in the host project.
|
||||||
|
|
||||||
## Wiring
|
## Feed wiring
|
||||||
|
|
||||||
- The public package entrypoint is root `Index.ets`; export new host-facing symbols there.
|
- Export new host-facing symbols from root `Index.ets`.
|
||||||
- `FirstPage.createNodeView` dispatches feed cards by `FirstPageConstant.KEY_*`. A new feed card needs its key, component, and dispatch branch; card metadata is normally read from `src/main/resources/rawfile/first_page_cards_config.json`.
|
- A normal feed card needs a datacenter `FirstPageConstant.KEY_*`, model insertion, and a `FirstPage.createNodeView` dispatch branch; metadata normally comes from `src/main/resources/rawfile/first_page_cards_config.json`.
|
||||||
- `market-ranking` is a special feed card under `src/main/ets/market-ranking/`, inserted with `KEY_MARKET_RANKING` and rendered directly by `FirstPage`. Its config key is `marketRanking`, loaded by `FirstPageCardsConfigLoader`.
|
- `market-ranking` is special: `FirstPage` inserts and renders it directly under `KEY_MARKET_RANKING`; its loader config key is `marketRanking`.
|
||||||
|
- The two `FirstPageConstant.ets` files differ: `datacenter/` defines card `KEY_*` values; `util/` exports `TITLE_BAR_HEIGHT` only.
|
||||||
|
|
||||||
## Market Ranking
|
## Market ranking
|
||||||
|
|
||||||
- `MarketRankingDataFetcher` first fetches the recommended contract list over `@kit.NetworkKit`; `MarketRankingHqRequestClient` then subscribes those contracts through the host `TableRequestClient`/4106 infrastructure. Do not replace either path with mock data or a second quote client.
|
- Keep the two-stage data path: `MarketRankingDataFetcher` obtains recommended contracts through `@kit.NetworkKit`, then `MarketRankingHqRequestClient` subscribes them through the host `TableRequestClient`/4106 path. Do not substitute mock data or another quote client.
|
||||||
- `MarketRankingConstant.ets` is currently shared by UI, HTTP, and HQ code: `TAB_METRICS`/`PERIOD_RANGES` contain labels, HTTP parameters, and 4106 field IDs. Changing order, IDs, or child-tab semantics affects both request paths; update them together and consult `doc/market-ranking-known-issues.md` before refactoring.
|
- `MarketRankingConstant.ets` couples UI labels, HTTP parameters, and 4106 fields in `TAB_METRICS` and `PERIOD_RANGES`; update ordering, IDs, and child-tab semantics together.
|
||||||
- HQ requests use 4106, frame `2201`, scenario `qht_qihuo_sort`, and `pushtime=2.5`; subscriptions must be released on page invisibility, Tab changes, refresh, and component destruction. TCP reconnect rebuilds the subscription from the original HTTP contract list.
|
- Keep 4106 frame `2201`, scenario `qht_qihuo_sort`, and `pushtime=2.5` aligned with the subscription path. Release subscriptions on invisibility, tab changes, refresh, and destruction; reconstruct on TCP reconnect from the original HTTP contract list.
|
||||||
- The component guards asynchronous HTTP and quote callbacks with request/subscription versions; preserve those guards when changing refresh or Tab behavior. Row clicks use host `jumpToQuote()` and must preserve contract, market, and name list ordering.
|
- Preserve HTTP/quote request and subscription version guards. Preserve contract, market, and name ordering when rows call host `jumpToQuote()`.
|
||||||
- Market-ranking host integration still requires validation of 4106 field IDs, standard-price fields, HTTP environment/auth, lifecycle/reconnect behavior, and quote-page routing; see `doc/market-ranking-known-issues.md`.
|
- Validate 4106 IDs and standard-price fields, HTTP environment/auth, lifecycle/reconnect behavior, and quote routing in the host; see `doc/market-ranking-known-issues.md` before changing this area.
|
||||||
|
|
||||||
## Conventions
|
## Resources and release
|
||||||
|
|
||||||
- Use `$r('app.color.*')` and the light/dark resource qualifiers for colors; do not hardcode theme colors. Put user-facing strings in `src/main/resources/{base,zh_CN,en_US}/element/string.json`.
|
- Put user-facing text in `src/main/resources/{base,zh_CN,en_US}/element/string.json`; use `$r('app.color.*')` with light/dark qualifiers rather than hardcoded theme colors.
|
||||||
- `FirstPageDebugUtil.isMarketRankingUseTestUrl` and other test URL switches default to `false`; leave them disabled in commits.
|
- Keep `FirstPageDebugUtil.isMarketRankingUseTestUrl` and other test-URL switches `false` in commits.
|
||||||
- Two files are named `FirstPageConstant.ets`: `datacenter/FirstPageConstant.ets` holds `KEY_*` card-dispatch constants, while `util/FirstPageConstant.ets` only exports `TITLE_BAR_HEIGHT`. Import the correct one.
|
- Preserve existing root/deep `biz_quote` import style. For public or reflective symbols, account for release ArkGuard rules in `obfuscation-rules.txt` and `consumer-rules.txt`.
|
||||||
- `biz_quote` is imported both from its package root and deep paths; preserve the existing import style when touching quote code.
|
|
||||||
- Release builds enable ArkGuard through `build-profile.json5`; keep `obfuscation-rules.txt` and `consumer-rules.txt` in mind when adding public or reflective symbols.
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function parseRawTab(item: RawPickTabItem): PickTabData {
|
|||||||
imgs: isSystemPeriod
|
imgs: isSystemPeriod
|
||||||
? [strategyDetail.white_img ?? '', strategyDetail.black_img ?? '']
|
? [strategyDetail.white_img ?? '', strategyDetail.black_img ?? '']
|
||||||
: [],
|
: [],
|
||||||
count: strategyItem.detail_count ?? 0,
|
count: resData.list.length,
|
||||||
};
|
};
|
||||||
const tabData: PickTabData = {
|
const tabData: PickTabData = {
|
||||||
strategy: strategy,
|
strategy: strategy,
|
||||||
|
|||||||
Reference in New Issue
Block a user