@@ -13,6 +13,7 @@ import {
1313 chartRangeEmptyNote ,
1414 chartUnavailable ,
1515 filterAssetHistoryByRange ,
16+ assetHistoryCoverage ,
1617 formatOverviewInstant ,
1718 formatOverviewShortInstant ,
1819 accountNativeReadout ,
@@ -511,11 +512,11 @@ export function OverviewPage({ accounts, accountFacts, accountOptionsRevision, o
511512 const selectedUpdatedAt = accountId === "all" ? null : accountFactsUpdatedAt ( selectedFacts ) ;
512513 const assetsMetricLabel = accountId === "all" ? "账户最新估值(按币种)" : selectedWalletValuation ? "钱包总资产" : "总资产" ;
513514 const selectedCashLabel = accountId === "all" ? "账户现金(按来源语义和币种)" : selectedAccount ? cashLabelForPlatform ( selectedAccount . platformKey ) : "可用现金" ;
514- const filteredWalletPoints = walletChartSelected
515- ? filterAssetHistoryByRange ( historyKey === requestedHistoryKey ? walletHistory ?. points || [ ] : [ ] , range ) : [ ] ;
516- const filteredAccountPoints = walletChartSelected
517- ? [ ] : filterAssetHistoryByRange ( historyKey === requestedHistoryKey && accountHistory ?. identity_mismatch !== true && accountHistory ?. series . currency === currency
518- ? ( accountHistory ?. series . points || [ ] ) . filter ( point => point . currency === currency ) : [ ] , range ) ;
515+ const storedWalletPoints = walletChartSelected && historyKey === requestedHistoryKey ? walletHistory ?. points || [ ] : [ ] ;
516+ const storedAccountPoints = ! walletChartSelected && historyKey === requestedHistoryKey && accountHistory ?. identity_mismatch !== true && accountHistory ?. series . currency === currency
517+ ? ( accountHistory ?. series . points || [ ] ) . filter ( point => point . currency === currency ) : [ ] ;
518+ const filteredWalletPoints = walletChartSelected ? filterAssetHistoryByRange ( storedWalletPoints , range ) : [ ] ;
519+ const filteredAccountPoints = walletChartSelected ? [ ] : filterAssetHistoryByRange ( storedAccountPoints , range ) ;
519520 const geometry = walletChartSelected
520521 ? buildBinanceWalletHistoryChartGeometry ( filteredWalletPoints )
521522 : buildAssetChartGeometry ( filteredAccountPoints ) ;
@@ -546,6 +547,9 @@ export function OverviewPage({ accounts, accountFacts, accountOptionsRevision, o
546547 break_before : point . break_before ,
547548 } ) ) , range ) ) ;
548549 const shownGeometry = accountId === "all" ? aggregateGeometry : geometry ;
550+ const historyCoverage = assetHistoryCoverage ( accountId === "all"
551+ ? aggregateCurrencySeries
552+ : walletChartSelected ? storedWalletPoints : storedAccountPoints , range ) ;
549553 const benchmarkSeries = RETURN_INDEX_LEGEND . map ( name => presentMarketBenchmarkSeries ( storedBenchmarkPoints , name ) ) ;
550554 const primaryBenchmark = benchmarkSeries [ 0 ] ;
551555 const benchmarkGeometry = buildBenchmarkChartGeometry ( primaryBenchmark . points ) ;
@@ -809,6 +813,7 @@ export function OverviewPage({ accounts, accountFacts, accountOptionsRevision, o
809813 < div className = "asset-chart-meta" >
810814 < span > { shownGeometry . dots [ 0 ] ?. date } → { shownGeometry . dots [ shownGeometry . dots . length - 1 ] ?. date } </ span >
811815 < span > { currency } { shownGeometry . minLabel } – { shownGeometry . maxLabel } </ span >
816+ { historyCoverage ?. shorterThanRange ? < span className = "asset-chart-coverage" > { t ( "历史仅 {days} 天(自 {date} 起),不代表更长期表现。" , { days : historyCoverage . days , date : historyCoverage . firstDate } ) } </ span > : null }
812817 { accountId === "all" && aggregateSeries . omittedPartialDateCount > 0 ? < span > { t ( "有 {count} 个日期省略了缺观察的账户,线段在缺口处断开。" , { count : aggregateSeries . omittedPartialDateCount } ) } </ span > : null }
813818 </ div >
814819 </ div > : < div className = "chart-empty" >
0 commit comments