fix(swap): keep the form stable and consolidate route, fees and signing into DETAILS #1498
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#1498
Loading…
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 and why this change is needed
The Swap form shifts vertically when quote loading/errors appear above the input area. Below the inputs, a separate route card, duplicate network fee rows, two independent disclosures and technical explanatory copy consume space. A valid disconnected-wallet quote can show no minimum return. The information is difficult to scan and changing quote state changes the card's structure. Bundle these layout, disclosure, alignment and minimum-return presentation defects in one implementation.
Investigation baseline: reviewed repository HEAD (
efb5fba29d3dc401d0d026d8b683db8054458920) (2026-10-14 UTC). This report is a sanitized technical synthesis. No reporter identity, conversation, supplied screenshot, wallet actor/context digest, credential, private endpoint or workstation information is attached. Reported live symptoms are distinguished from independently observed/source-confirmed behavior.Current codebase and confirmed findings
frontend-dapp/src/pages/SwapPage.tsx:1703–1777renders outage, pricing progress and quote failures before the inputs; line 1718 conditionally insertsQuoteDataLoadingProgress. The upper input position therefore depends on quote state.showQuoteOnlycomes from disconnected-wallet acquire guidance, not a distinct quote economic model.card-glassroute section, a visible “Route” heading, a compactTerraClassicTxFeeHint, and a separate “Trade details” disclosure. A secondTerraClassicTxFeeHintappears inside that disclosure at line 2239.SwapPreSubmitSummary.minReceiveHumanpassed to the signing summary (line 2435) are gated on!showQuoteOnly. Consequently a valid anonymous quote deliberately renders “Min return —”, even though the executable quote contains a checked positive floor.components/swap/SwapPreSubmitSummary.tsx,components/common/TerraClassicTxFeeHint.tsx,components/ui/TokenLogo.tsx,components/QuoteDataLoadingProgress.tsx,utils/swapPayAcquireGuidance.ts,hooks/useSubmitAlignedSimQuote.ts,utils/rawAmountMath.ts,services/terraclassic/swapNetworkFee.ts,services/terraclassic/offlineSwapBudget.ts(paths relative tofrontend-dapp/src). Existing tests includepages/SwapPage.test.tsx,components/swap/__tests__/SwapPreSubmitSummary.test.tsxand fee-hint/network-fee tests.Independent investigation evidence (2026-10-14 UTC)
A bounded anonymous live phone observation of native USTC→CL8Y at 132 units ran from approximately 02:29:41–02:30:16 UTC at 390×844. In 225 samples across 35,054ms, receive output changed nine times and loading toggled eight times. Four settled→blank/loading→settled cycles returned the identical
1.088581125941251074 CL8Yamount. The Pay input's top position alternated between 266px and 290px; route and both existing DETAILS sections disappeared during each wait. Seventeen samples had blank receive. There was no unsupported notice in this specific phone window. This is a fresh independent UI reproduction of quote flicker and 24px displacement, not proof of the original historical cohort or its cause.A separate bounded backend probe admitted 17 anonymous GETs (15 quotes and two attempted health reads) over at least 185s. It used 5% quote-relative protection and maker cap 8 with native pool-only behavior. Native USTC→CL8Y (132), CL8Y→USTC (132), and CL8Y→cLUNC (13) produced 12 validated positive quote responses. CL8Y→USTC changed from validated HTTP200 at phases 0/10/25/90s to typed HTTP422
unsupported_semanticsat phase 185s (02:28:35 UTC). Two USTC quote reads had no response in the probe transport; they are retained as probe failures, not called product rejections. The API result demonstrates an intermittent backend outcome under this observation window; it does not establish whether the final negative was authoritative, stale admission state or configuration recovery failure.Limits retained: initial browser setup timed out before samples; the next attempt completed phone sampling but timed out in desktop setup. Both timed-out attempts remain failed/incomplete and are not desktop coverage; the separately recorded desktop retest below supplies a later completed observation. The initial health reads used the wrong API path, leaving contemporaneous deployed revision unverified; a separate official read-only artifact attester was stopped after its bounded investigation window and did not establish frontend/root provenance. A later public
/healthread reported backendefb5fba29d3dc401d0d026d8b683db8054458920; it is backend-only and later than the samples. No request included an actor, no provider access or wallet signing was permitted, and no screenshot or conversation was published. Browser observations are DOM samples rather than independent validation of every intercepted response; investigate the expiry/publication race before claiming a root cause.A separately retained desktop retest completed 200 DOM samples over 35,143ms for CL8Y→USTC at 132 units (1280×900, approximately 02:35:55–02:36:31 UTC). It initially displayed
14080.882263 USTC, briefly switched to loading/blank and recovered the same amount, then rendered “This trade is not supported by current pricing.” That notice disappeared and returned while the receive remained blank. Across the window there were four receive/loading/price-notice switches, three unsupported-notice switches, 146 blank-receive samples and 135 unsupported-notice samples; Pay moved between 278px and 336px (58px). The retest admitted 73 reads, blocked five disallowed requests and completed with no setup error. The initial failed desktop attempt remains retained; this new successful observation does not erase it. These are real current UI transitions, but DOM sampling alone cannot determine whether a later backend negative was legitimate.Relevant source links: SwapPage.tsx, SwapPreSubmitSummary.tsx, TerraClassicTxFeeHint.tsx.
Recommended implementation and required layout
Keep one Swap card in this order:
isFetchingis true.DETAILSdisclosure. Preserve its open state across same-intent refreshes; do not remount it when a quote updates. Show trading/wrapper/tax costs, one network fee estimate, slippage protection, transaction deadline, positive minimum return with output symbol, action, actual pay/receive, genuine execution contract(s) and chain. Avoid duplicate values/labels where a single checked row suffices. Keep label/value baselines aligned on phone and desktop.Slippage/fee meanings are handled by the linked metric issue; quote lifetime/recovery by the linked lifecycle issue. Do not reproduce those algorithms in the layout component.
Constraints and guardrails
The new layout explicitly supersedes older guidance requiring a separate route card, “Trade details”/“Signing details” labels and pricing banners above the form. Update
docs/frontend.md,docs/swap-max-spread-ux.mdand applicable agent guidance so it no longer conflicts with this requirement. Preserve all independent execution controls: original expiry/intent/generation/actor binding; positive upward-rounded post-hook/final floors; quote-relative policy; exact gross funding; fee/Max/native reserve parity; 5/30/99 controls; pause/freeze/blacklist/launch guards; required risk acknowledgement; no automatic signing/resend. Local quote/review/preparation must remain offline. Network gas is a separate LUNC cost, shown once in DETAILS and excluded from order slippage.Acceptance criteria
Test plan for all paths
Attack, hack and abuse test plan
Attempt spoofed token symbols/long labels, missing or hostile logos, HTML/script-bearing API errors, malicious contract/explorer URLs and repeated assets. UI must use escaped bounded allowlisted copy, real execution identities and safe URL handling. Attempt forged quote floors/fees, malformed/overflow decimals, same-symbol identity substitution, expired quote reuse, A→B→A response races and account/context replay; no display simplification or green “None” can make these executable. Flood rapid edits and disclosure toggles to verify cancellation, bounded requests, no duplicate submits, retained focus and no hidden controls. Exercise all genuine pause/freeze/blacklist/tax/hook/unknown-budget refusals after rendering changes.
Verification criteria
Run meaningful component/geometry/accessibility tests, typecheck and applicable
make verify-issue-1480,1473,1452,1483,1489; repeat final stable source. Use only owned disposable DB/chain fixtures. Test the actual production build on desktop/phone over multiple refresh/expiry cycles; separately attest deployed frontend/backend/root artifacts for live claims. Baseline passing tests describe the old layout, not acceptance of this redesign. Complete feasible checks first; unavailable workflow holds/device/deployment prerequisites do not block implementation or issue filing. Mark unavailable acceptance explicitly, retain every executed failure, and never remove runtime safety controls to satisfy the visual design.Related work
Follow-up to #1473 (quote outcomes), #1480 (offline fees), #1483 (economic explanation) and #1489 (refresh/adoption). Implement alongside #1499 for quote lifecycle and #1500 for metric semantics. This issue owns layout/disclosure/geometry, not those algorithms. Advanced Trade entry/navigation is outside this redesign; preserve the independent #1497 work.
Completed baseline verification and retained limits
Unchanged reviewed source
efb5fba29d3dc401d0d026d8b683db8054458920; independent first/retest checks on 2026-10-14 UTC. Owned disposable Postgres had a dedicated QA role/admin-owned marked control database and fresh per-process child databases; its containers were removed. The final repository working tree is clean. These are baseline investigation checks, not implementation/acceptance of this issue.make verify-issue-1483make verify-issue-1489make verify-issue-1480make verify-issue-1473corrected, scoped retesttruncated:true; not the full matrix.make verify-issue-1452final full local runThe scoped #1473 production-build browser fixture completed 240 rows across desktop/phone: 220 useful quotes, 20 typed blockers, zero fixture failures, 114 quote requests and zero provider requests. Its original-input-through-render useful timing was p50/p95/p99/max 89.7/149.1/166.7/169.8ms against 750ms. Directions actually exercised were UST1→CL8Y, CL8Y→UST1 and USTC→CL8Y at 5%; no complete pair/protection corpus is claimed. The fixture uses synthetic pinned pool economics and zero-fee native wrappers, not production settlement or nonzero-wrapper-cost acceptance.
Retained failures: the initial #1473 run finished FAIL (14 PASS, 3 FAIL, 2 SKIP). Two configured-default fixture assertions failed in both first/retest (480/482 frontend tests passed); explicit fixture-aligned CL8Y configuration subsequently passed all 482 twice, plus a standalone 16-test retest. The initial full browser attempt failed writing its receipt with
ENOSPC; its generated truncated QA file was restored from a pre-run backup. The initial #1452 run was interrupted during the disk-space incident; the later full local run above is separate. Passing later/subset tests do not erase these failures or certify the failed full browser matrix. No shared build/user data was deleted to obtain a pass.Live evidence remains narrower: the anonymous API sample has 12 useful responses, one typed unsupported outcome and two no-response probe failures. One useful HTTP duration was 849.278ms (above the separate 500ms target); transport classes were not captured, so this is retained rather than claimed as initialized socket acceptance. Phone/desktop live DOM transitions reproduce the presentation failures but do not independently validate every response. Initial browser setup/timeouts and the stopped independent deployment attester remain failed/incomplete; a later public health read matches the reviewed backend SHA only. Exact frontend/root/contracts, full sustained live matrix, physical wallets and funded execution remain unverified. No incomplete acceptance criterion is checked, and related open issues are not closed by these source passes.
Implementation merged in PR #1501, main revision
9dfa373f989ca9684c00ce40bc0525265243dfe9(2026-10-14 UTC). Woodpecker PR pipeline #456 passed, including secrets, contracts, full frontend, indexer library/Postgres and required functional checks.Completed source/local scope:
Individual acceptance criteria are not closed by this shared source summary. Evidence, retained failures and remaining scope and the individual QA checklists are included in main. The initial documentation/owned-fixture failures were corrected and retested; prior failures remain recorded. Final issue-specific live results will follow; this issue remains open until all body/comment criteria pass.
Producer follow-up PR #1502 is merged into main
14055610ebe86fd3640ff85e8adc15e16785c6dd; required CI #458 passed all eight steps. Main and the feature worktree are synchronized.See release results and invariant links. This is source/CI completion, not a claim that every issue criterion passed. Final issue-specific live results will follow; the issues remain open.
Final QA/evidence PR #1503 merged into main
4bd3e8d31485613d6c3ddca62abbac1a1f6e6469; required CI #460 passed all eight steps. Main and the worktree are clean and synchronized with origin/main. Application runtime inputs did not change in this QA-only merge; the actual deployed revision remains the attested14055610…below.Fixes merged in PR #1501 and PR #1502. Both Coolify applications finished at independently attested release
14055610ebe86fd3640ff85e8adc15e16785c6dd; required CI pipelines 456/458 each passed all eight steps. Later helper/evidence changes do not claim a newer application deployment.The card no longer inserts quote messages above inputs or duplicates routine wrapper/network-fee copy. No safety threshold was reduced to obtain a stable layout.
Results, retained failed runs and invariant links. All issue bodies and current comments were reviewed. No complete acceptance claim: this issue stays open for the unchecked scope.
PlasticDigits referenced this issue2026-10-15 05:32:59 +00:00
Closed at the user's request as part of consolidating issues #1449–#1500.
The stable Swap summary/status, single DETAILS disclosure and anonymous minimum are implemented and deployed. Remaining native readiness/recovery failures move to #1504.
Replacement: #1504
Wallet/device chores and verification-only holds are intentionally excluded. Historical failed receipts remain unchanged; this closure does not claim every old acceptance checkbox passed.