Price (USD) chart timeframe selector freezes after repeated switches, requires page refresh to restore #148
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#148
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?
Issue Summary
After selecting a pair on the
/tradepage, the Price (USD) chart timeframe selector stops responding after approximately 5–6 consecutive timeframe changes. Once frozen, clicking any timeframe button produces no visual update and no chart rebind. The selector shows no loading state, no error, and no indication that it is stuck. A full page refresh is required to restore normal function.Reproduction Steps
/tradeExpected Behavior
Each timeframe selection should update the Price (USD) chart to the corresponding interval without limit on the number of consecutive switches. No refresh should be required to continue switching timeframes.
Actual Behavior
After approximately 5–6 timeframe changes, the selector freezes. Subsequent clicks on any timeframe button are visually acknowledged but produce no chart update. The chart remains stuck on the last applied timeframe. No error state, spinner, or user-facing message is shown. Only a full page refresh restores the control.
Environment Details
localterra(local Docker)VITE_NETWORK=local npm run devmake indexer-dev)make deploy-localWallet / Device Details
http://localhost:1317, RPChttp://localhost:26657Screenrecord
Severity / Impact
P2 Polish. Chart remains visible but is no longer interactive the timeframe selector is silently dead until refresh. This impairs pre-trade context reading for any trader doing analysis on the current pair. No funds are at risk and order placement is unaffected. The freeze pattern (silent after N interactions, no error surfaced) suggests an unhandled promise rejection, a stale event listener, or a chart library subscription that is not being torn down and re-initialised on repeated pair or timeframe changes.
It is classified under **W6-C1 in [116](**https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/116#:~:text=Work%20items-,%23116,-Full%20deep%20visual) (Chart embed / timeframe controls — Updates dimension: "pair switch rebinds chart; no stale symbol on axis"). Discovered during W4-C2 inspection on
/trade.cc : @PlasticDigits
mentioned in issue #116
@totdking Video clip is missing - seems it did not properly attach
mentioned in issue #151
mentioned in commit
d04b0e98ffFix landed on
main(d04b0e9)Root cause: Each timeframe change set React Query
isLoading, which unmountedPriceChartLightweightCanvasand re-ran asynccreateChart. After ~5–6 rapid switches, overlapping inits left the chart stuck while interval buttons still updated.Changes:
PriceChart:placeholderData: keepPreviousDataso the plot stays mounted during interval refetch; first load only shows full-panel loading; refetch showsdata-testid="price-chart-interval-loading"overlay.PriceChartLightweightCanvas:chartInitIdRefdrops stale async inits and tears down orphan chart instances.PriceChart.test.tsx).skills/AGENTS_FRONTEND_PRICE_CHART.mdinvariant #10.Verification checklist (please confirm on
/tradewith LocalTerra + indexer)@brouie — please verify on your environment when you have a moment. Leaving the issue open until QA signs off.
/cc @totdking
Verification checklist (please confirm on
/tradewith LocalTerra + indexer)Issue noticed
The change of pairs on
/tradealways brings out an error from the pageScreen record:
This happens for all pairs across the
/tradetabcc: @PlasticDigits
mentioned in commit
7f37096604Fix landed on
main(7f37096)Root cause: The #148 interval fix applied
placeholderData: keepPreviousDatato the pair-keyed candles query (['candles', pairAddress, interval]). On pair switch, React Query kept the previous pair's OHLC as placeholder while fetching the new pair. That stale data was fed into a still-mountedPriceChartLightweightCanvas, triggering a lightweight-charts render crash (Cannot read properties of undefined (reading 'length')) and the route ErrorBoundary ("Something went wrong").Changes:
priceChartCandlesPlaceholder.ts:keepPreviousCandlesForIntervalSwitch— keeps prior rows only whenpairAddressis unchanged (interval refetch); drops placeholder on pair change.PriceChart: uses the selective placeholder helper;key={pairAddress}onPriceChartLightweightCanvasfor a clean remount on pair switch.skills/AGENTS_FRONTEND_PRICE_CHART.mdinvariant #10,skills/AGENTS_FRONTEND_TRADE_PAIR_SWITCH.mdinvariant #5.Verification checklist (please confirm on
/tradewith LocalTerra + indexer)@brouie — please verify on your environment when you have a moment. Leaving the issue open until QA signs off.
/cc @totdking
QA sign-off — closing #148
Shipped on
origin/main:7f37096(pair-switch follow-up) on top ofd04b0e9(interval freeze fix). Localmainmatchesorigin/main; no open fix branches.Two-part resolution
d04b0e9keepPreviousData+ interval loading overlay +chartInitIdRef— canvas stays mounted on interval refetch7f37096Cannot read properties of undefined (reading 'length'))keepPreviousCandlesForIntervalSwitch— placeholder only whenpairAddressunchanged;key={pairAddress}remounts canvas on pair changeExpected UX (invariants)
data-testid="price-chart-interval-loading").Verification (2026-05-26, LocalTerra + indexer +
VITE_NETWORK=local)/trade.priceChartCandlesPlaceholder.test.ts+PriceChart.test.tsx(20 tests, incl. interval reuse + pair remount regressions).Docs / agent cross-links
skills/AGENTS_FRONTEND_PRICE_CHART.mdinvariant #10skills/AGENTS_FRONTEND_TRADE_PAIR_SWITCH.mdinvariant #5/cc @totdking @brouie — reopen if pair switch or interval stress regresses on your stack.
mentioned in issue #211
mentioned in issue #225
marked as related to #225
mentioned in issue #226
marked as related to #226
mentioned in issue #228
marked as related to #228
mentioned in issue #543
mentioned in issue #705
mentioned in merge request !1197
mentioned in issue #717