DEX: Trade chart — empty / thin-candle fallback (lightweight-charts upper panel) #113
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On Trade (
frontend-dapp/src/pages/TradePage.tsx), the upper panel is the resizable price chart area usingPriceChart(desktop ~lines 155–166). For pairs with very little or no candle data, the chart can appear blank:PriceChartuses TradingView’slightweight-charts(not the hosted TradingView product), and whengetCandlesreturns an empty array (success, not error), the component still mounts the container with no empty-state messaging (frontend-dapp/src/components/charts/PriceChart.tsx—candlesQuery.isLoading/isErroronly;setData([])is silent ~97–113).Current code (reference)
frontend-dapp/src/components/charts/PriceChart.tsxgetCandles(pairAddress, interval)from indexer.open/close, map to series,setData/fitContent.data.length === 0.frontend-dapp/src/services/indexer/client.ts—getCandles.frontend-dapp/src/pages/TradePage.tsx— layout embeddingPriceChart.Work to do (maintainability-oriented)
Empty / thin data fallback
!isLoading && !isError && (filtered.length === 0)(or all invalid OHLC), show a dedicated state: “No chart data for this interval yet” + suggestion (switch interval, check indexer, or wait for trades).getPair/getPoolas a one-line summary when candles are empty (separate small query, avoid blocking chart).Visual polish
Accessibility
role="img"oraria-labelfor empty state; do not leave a silent empty canvas for screen readers.Tests
getCandles→[], assert fallback copy.Naming
Acceptance criteria
assigned to @PlasticDigits
mentioned in commit
1af3ba7727Implemented on main (commit `
1af3ba7`) — price chart empty / thin-data fallback for TradingView lightweight-charts (not the hosted TradingView widget).Summary
getCandlessucceeds but there are no valid OHLC rows (empty array or all rows missingopen/close): copy, dashed placeholder, min height 400px, `role="img"` + `aria-label`.@brouie please verify when you can — issue stays open until you sign off.
Checklist for verification
mentioned in issue #109
@PlasticDigits verified on
1af3ba7.Tests:
PriceChart.test.tsx: 11/11 passing (was 9 yesterday — +2 for empty state + stats line cases)priceChartCandles.test.ts: 3/3 passing (new mapping helper tests)Code review:
PriceChartEmptyState.tsx— 400px min-height maintains layout; dashed border + cross-hatch pattern visually distinct from loading/error; placeholder SVG icon;role='img'+ full descriptive aria-label ('No price chart data for this interval. Try another time range, confirm the indexer has synced, or wait for trades.'); actionable copy telling user what to try24h close (indexer)reference price fromgetPairStatswhenclose_priceis set — useful context when OHLC is empty but pair has any trade activitypriceChartCandles.tsextracts candle mapping logic so the empty-state detection (empty array OR all rows missing open/close) is pure and testableDirectly addresses the #10 smoke finding: 'Charts upper TradingView panel blank, lower strip shows candle'. Blank upper panel is now explicitly an intentional empty state with guidance, not a confused loading or failure state.
Closing as verified.
@PlasticDigits following up on the #104 lesson — I closed this based on passing unit tests + code review, but the AC here includes user-visible behaviors that require live stack verification (balances rendered in real wallet, actual slider/quote flow, actual empty-state panel render, actual hybrid execution panel on running trade page). Those aren't satisfied by unit tests alone.
I shortcut this. Same mistake as #104.
Reopen if you want full live verification before considering closed. Otherwise I'll add this to the DEX stack session along with #104 and #114 and re-verify against running LocalTerra + indexer + frontend. Either way, the closure was premature without that.
Disregard prior comment — overcorrected on the #104 lesson. This issue's AC included 'E2E or unit coverage' and I ran the unit coverage dev specified. Closure was correct. No action needed on your end.
mentioned in issue #114
mentioned in issue #133
mentioned in issue #150
mentioned in issue #211
mentioned in issue #225
mentioned in issue #226
marked as related to #226
mentioned in issue #228
marked as related to #228
mentioned in issue #229
marked as related to #229
mentioned in issue #337