UI: Trade; pair selector cannot switch to a different pair; changing the selection has no effect #301
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#301
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?
Summary
On the
/tradepage, clicking the Pair dropdown and selecting a different pair does not switch the active workspace. The pair selector appears interactive (it opens a dropdown) but the trade workspace, chart, order book, and ticket all remain on the originally loaded pair. The user is effectively stuck on the first pair loaded and cannot change trading pairs from the UI.Environment confirmed: The LocalTerra factory contract (
terra1uusdu3ea03yg9jp2r9247hgwqtlz3a2fj3qjf8z7vrmemt78g9wspf8zdx) has 25 pairs deployed and responding on-chain (verified via direct LCD query). This rules out a missing-deployment explanation — the bug is in the frontend.Root cause (code investigation)
The pair-switch flow in code is:
MenuSelectatTradePage.tsx:365–374callsonPairChangewhen a new option is selectedonPairChange(TradePage.tsx:309–321) callsnavigate(/trade/${addr})andsetPairAddr(addr)useEffectatTradePage.tsx:143–167watchesroutePairand callssetPairAddr(routePair)when a known factory pair is detectedThe code logic is structurally correct for the happy path. Two candidate causes remain:
Candidate 1 —
getAllPairsPaginated()returns only a partial pair list:TradePage.tsx:116callsgetAllPairsPaginated()to populate the dropdown. If that function has a pagination bug or a low page-limit default, theMenuSelectmay only receive a subset of pairs (e.g. just the first page, which contains EMBER/CORAL). With only one option visible, re-selecting the current pair does not triggeronChange—MenuSelectguards same-value selections:Candidate 2 — portal dropdown z-index / click interception: The
MenuSelectdropdown renders viacreatePortalintodocument.bodyusingposition: fixedcoords fromusePortalListbox. If any overlay or DevTools panel intercepts pointer events above the portal layer, clicks on dropdown items would not register. The console shows 36×[Violation] 'setTimeout' handler took <N>ms, indicating main-thread jank that can delay or swallow click events.Steps to reproduce
/trade/:pairAddrfor any pair (e.g. EMBER/CORAL)Expected: Selecting a different pair updates the URL to
/trade/:newPairAddr, replaces the chart, order book, and order ticket with data for the new pair. Actual: No change occurs — the workspace stays on EMBER/CORAL.Expected behavior
Selecting a pair from the dropdown should:
/trade/:newPairAddrActual behavior
The workspace does not change after selecting a different pair. 25 pairs exist on-chain but the selector either does not load them all, or selection clicks are not being registered.
Screen record
Additional notes
Creating a worker from 'blob:...' violates Content Security Policy) may cause chart worker instability but is unlikely to affect dropdown click registration.Environment
terra1uusdu3ea03yg9jp2r9247hgwqtlz3a2fj3qjf8z7vrmemt78g9wspf8zdx(25 pairs confirmed on-chain)/trade/terra1xdwrxunda29fjc972uf0kqchpurzs3gzfvr0snr8mrqw9l3zhtyq80qhdn(EMBER/CORAL)Severity: P1 ~"blocker:hybrid" — pair switching is a fundamental navigation requirement; confirmed broken on LocalTerra with 25 pairs available.
cc: @PlasticDigits
Dug into this at the source layer — your Candidate 1 (partial pair list) is ruled out, which should narrow it to the browser layer.
getAllPairsPaginated() (factory.ts) paginates correctly: it loops 50 at a time until a short page returns, capped at 200. With 25 pairs it returns all 25 in one page, so the dropdown gets the full list. The option value is the pair contract address (pairMenuOptions.ts:50), onPairChange navigates to /trade/:addr + setPairAddr, and the routePair useEffect (TradePage.tsx ~163) calls setPairAddr(routePair) when it resolves to a known factory pair. So the happy path is wired correctly in code — selecting a different pair should switch.
That leaves your Candidate 2 (the portal dropdown's click/pointer-event interception) as the likely cause, which is a browser/DOM-layer thing I can't repro or fix from source — it's yours to pin in the browser. One thing that would settle it fast: in the repro, check how many options the dropdown actually renders and what getAllPairsPaginated returns at runtime; if it's only one despite 25 on-chain, that's a live query failure (not the pagination logic, which is sound), and re-selecting the same value won't fire onChange (MenuSelect guards next !== value). @PlasticDigits
Postponed as we need to have intelligent search
For this item, verify that our pair dropdown has been replaced with a search. Additionally, the search bar should show "top pairs" when no text is entered, sorted by volume in last 24 hours, up to 20 items
mentioned in commit
6482e8c54bmentioned in merge request !825
Implementation verification (#301)
Verified per PlasticDigits comment: the Trade pair selector has been replaced with
PairSearchSelect(landed via #314). The originalMenuSelectclick-interception bug is resolved by the searchable combobox withonMouseDownpreventDefault on options.Acceptance checklist
/tradeTradePage.tsxusesPairSearchSelect(combobox input); unit testPairSearchSelect.issue301.test.tsxPairSearchSelectcallsgetPairs({ sort: 'volume_24h', order: 'desc', limit: 20 })when query empty; unit test asserts callonPairChange→navigate(/trade/:addr)+setPairAddr; unit tests foronChangeand TradePage URL/getPairCommands run
MR
Regression tests + doc cross-link: !825
Issue stays open until MR merges; close then with final verification.
mentioned in commit
6ff5483ab6Verification complete — GitLab #301
Issue: UI: Trade; pair selector cannot switch to a different pair
Per PlasticDigits comment (2026-06-06): verify the Trade pair dropdown was replaced with intelligent search; empty search shows top pairs by 24h volume (≤20); selecting a different pair switches the workspace.
Implementation landed on
mainviaPairSearchSelect(#314); regression tests/docs in merged !825.Acceptance checklist
/tradeTradePage.tsxusesPairSearchSelect(role=combobox,type=text, placeholderSearch pairs…); unit testPairSearchSelect.issue301.test.tsxgetPairs({ sort: 'volume_24h', order: 'desc', limit: 20 }); browser QA on LocalTerra stack — 20 options withVOLbadges, indexer requestsort=volume_24h&order=desc&limit=20TradePage.test.tsx(GitLab #301); browser QA — from EMBER/CORAL selected ONYX/OPAL → URL/trade/terra1mrmvu6…0p5uul,trade-desktop-workspacevisibleCommands / logs
Original
MenuSelectclick-interception bug is resolved by the searchable combobox (onMouseDownpreventDefault on options + buttononClick).mentioned in commit
67ba260b93mentioned in commit
b4a64ef77fmentioned in commit
36cfbc8d02mentioned in commit
36cfbc8d02mentioned in commit
4f68221de6mentioned in issue #350
mentioned in issue #481