ux: /trade layout — flatten nested chrome, independent Recent trades, toggle side panels (no drag-resize) #561
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#561
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?
Related: order-ticket heading, compact Connect Wallet, and Buy/Sell colors are #563.
Summary
The
/tradedesktop workspace stacks nested cards, embeds Recent trades in the chart column behind a drag-to-resize split, and exposes always-on splitter bars. That makes the chart feel boxed-in, forces traders to drag a thin handle to see the tape, and lets a user collapse the chart out of the visual hierarchy. Treat the chart as the dominant surface: one chrome layer per region, tape as an independent bottom row, and toggle/hide for the order book and order ticket (chart expands into the vacated space). Do not ship drag-resize in the default layout.This is a product-completeness UX change for a live-money trading screen. Persistent splitter chrome reads as unfinished.
Current codebase
Desktop (
lg+,min-width: 1024px) is a nestedreact-resizable-panelstree inTradePage.tsx:PriceChart(PriceChart.tsx) is already ashell-panel-strongregion (headline, interval chips, fullscreen). Wrapping it again incard-glassis the visible box-in-box. Sub-desktopTradeChartSlotstill useswrapInCard={true}(same double chrome).Recent trades on desktop live inside the chart column (
trade-desktop-tape-panel, default collapsed per #417). Users expand viatrade-desktop-tape-toggleor by dragging the horizontal handle. Sub-desktop already places tape as an independent grid row (md:row-start-3+TradeWorkspaceDisclosure).Playwright
trade-page-responsive.spec.tsP10 currently requires draggingtrade-ticket-resize-handleand asserting the ticket width changes.AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.mdcurrently says keepreact-resizable-panelsunless there is a product decision — this issue is that decision.Design system today:
docs/design-system.mdmapsshell-panel*to page sections andcard-glassto nested blocks, but does not forbid wrapping a section that already has chrome.Why the new implementation is needed
shell-panel-stronginside a secondcard-glass(plus the workspace frame) reads as clutter, not hierarchy. Retail DEX terminals use one surface per region.Constraints / guardrails
PanelResizeHandlechrome from the default/tradelayout. Do not add a Settings “Customize layout” / numeric column editor in this issue. If drag-resize is ever revived, it must be opt-in behind an advanced setting and off by default — out of scope here.TradeOrderTicketmount (#178). Hide with CSS +inert(or equivalent) rather than a second instance. Do not remount a second ticket onlgvs sub-lg.PriceChartstayflex flex-col min-h-0/h-fullso candles are not clipped. Flattening chrome must not restore a fixed chart height.trade-ticket-submit-footer. Hiding the ticket hides that footer with it (header Connect Wallet remains).trade-sub-lg-workspace). No new splitter bars belowlg. Flatten double chrome on the sub-lg chart card. Tape may remain a disclosure on small viewports.getTrades/TradeRecentTradesSection/ indexer outage copy (#164, #174). Do not change tape amount/price formatting (that is #557).tradeWorkspacePanels.ts('1'/'0'). Ignore any other stored string. No JSON, noeval, no query-param layout (no shareable “hidden ticket” phishing URLs required).price-chart-fullscreen) stays. Panel toggles complement it; they do not replace it.docs/design-system.mdand the design-system agent skill. First apply on/trade. Audit Swap / Pool / Limits / Charts forcard-glasswrappingshell-panel*(or card-in-card). Fix trivial extra wrappers in the same change; do not rewrite those routes’ IA.Relevant files
frontend-dapp/src/pages/TradePage.tsxPanelGroup, resize handles, chart/tape nestingfrontend-dapp/src/pages/TradePage.test.tsxfrontend-dapp/src/utils/tradeWorkspacePanels.tsfrontend-dapp/src/utils/__tests__/tradeWorkspacePanels.test.tsfrontend-dapp/src/utils/tradePageLayout.tslgmedia queryfrontend-dapp/src/components/trade/TradeRecentTradesSection.tsxfrontend-dapp/src/components/trade/TradeWorkspaceDisclosure.tsxfrontend-dapp/src/components/charts/PriceChart.tsxshell-panel-strongfrontend-dapp/src/components/trade/OrderBookPanel.tsxcard-glassfrontend-dapp/src/components/trade/TradeOrderTicket.tsxfrontend-dapp/e2e/trade-page-responsive.spec.tsdocs/frontend.md§ Trade page — responsive layout / onboarding IAPanelGroup+ collapsed tape invariantsdocs/design-system.mdskills/AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.mdskills/AGENTS_FRONTEND_DESIGN_SYSTEM.mdskills/AGENTS_FRONTEND_TRADE_ONBOARDING_IA.mdRecommended direction
shell-panel/shell-panel-strong/card-glassin another of the same family. Page background → section surface → content.PanelGroup(disabledhandles removed from the DOM). Regions: book | chart | ticket on the top row; Recent trades full-width (or chart-column-aligned) bottom row, not a vertical split inside the chart cell.card-glassaroundTradeChartSloton desktop and setwrapInCard={false}on sub-lg too (or drop the wrapper helper). LetPriceChartbe the only surface.TRADE_TAPE_EXPANDED_KEY.cl8y-dex-trade-book-visible/cl8y-dex-trade-ticket-visible(names illustrative). Both hidden → chart uses the full workspace width. Always show a control to restore a hidden panel (do not leave a dead end).trade-ticket-resize-handle/trade-book-chart-resize-handle/trade-chart-tape-resize-handleon desktop. Add tests for hide/show book and ticket and chart width growth.docs/frontend.mddesktop row, onboarding tape invariant, design-system principle, andAGENTS_FRONTEND_TRADE_PAGE_LAYOUT.mdrule 1.Acceptance criteria
/tradedesktop chart is a single surface (PriceChartshell-panel-strong). Nocard-glasswrapping it.PanelResizeHandle(or equivalent drag chrome) in the default/tradelayout. P10 rewritten.localStoragevalues fall back to defaults (both side panels visible; tape first-visit compact).lggrid unchanged in structure (#146); chart double-wrap flattened. Still exactly oneTradeOrderTicketmount (#178).docs/frontend.md, design-system, andAGENTS_FRONTEND_TRADE_PAGE_LAYOUT.mdmatch the new layout.make verify-issue-<iid>covers unit + targeted e2e.Test plan — functional paths
Layout / chrome
lg(1280×720 and 1440×900): three columns; chart widest; no resize handles in DOM (getByTestIdabsent).trade-sub-lg-workspace): order of book / ticket / chart / tape per #146; no desktop handles.Recent trades
cl8y-dex-trade-tape-expanded): compact/collapsed tape without covering the plot.TradesTable(or outage / retry) visible; Collapse returns to compact. Reload preserves.Panel toggles
inert/not visible; chartwidthincreases; ticket width unchanged (or not expanded at book’s expense).inertrather than unmount (document the choice; if unmount, defaults restore — pick one and test it).Ticket / book interactions
trade-ticket-submit-footer; expiry scroll still above footer (existing P6/P7).Persistence helpers
readTradePanelExpanded/ new visibility helpers:'1'/'0'only;null→ default; garbage → default;localStoragethrow → default.Test plan — attack, hack, and abuse vectors
true,{"hidden":true},<script>, very long strings. UI uses defaults or boolean parse only; no DOM injection; no crash.trade-limit-submit/trade-market-submit(if still in DOM). Must not open wallet modal, must not broadcast.autofocus/ programmatic focus must not pull keyboard intoaria-hiddenticket. Restore control remains operable.postMessagelayout API./trade/:pair?layout=or hash flags must not hide the ticket or book (no shareable “deposit-looking” stripped ticket). Toggles are local only.lgbreakpoint repeatedly: still one ticket; no duplicate Place limit.localStoragethrows: toggles still work for the session; no uncaught exception white-screen.pairAddr, not a previous pair’s draft, unless the draft is explicitly cleared (document). Do not place on the wrong pair.Verification criteria
Manual (dark + light, 1280×720 and 1440×900):
/tradeon a hub pair — single chart surface, tape in the bottom row, no white splitter bars, hide/show book and ticket with chart expansion, Place limit footer only when ticket visible, fullscreen still works. Phone/tablet: no splitters, tape still reachable. Nested-card audit notes in the MR for Swap / Pool / Limits / Charts.marked as related to #563
changed the description
mentioned in merge request !1095
mentioned in commit
48f17aad35Post-merge note (!1095 on main). L561 layout (CSS grid, no drag-resize, independent tape, hide book/ticket) is on
main, stacked with #563 ticket heading.Remaining:
trade-sub-lg-workspace).make verify-issue-561on the stacked main (P10 Playwright).mentioned in issue #563
mentioned in issue #573
marked as related to #573
mentioned in commit
03a6763a67Verification complete (on
main@6e6c5a0c)/tradedesktop layout was already on main from !1095 (CSS grid, no drag-resize, independent tape, hide book/ticket). This follow-up verified L561-1–L561-12 against LocalTerra + Playwright, then fixed remaining gaps:TradePageWorkspaceSkeletonand HTML bootstrap still used the old 24/52/24 nested chart/tape stack. They now use book | chart | ticket plus an independent tape row (trade-workspace-skeleton-desktop-tape,trade-bootstrap-block-tape) so LCP placeholders do not revive splitter chrome.PanelResizeHandles at 1280, 1440, tablet, or phone. Hide ticket and hide book both expand the chart; tape is a bottom-row sibling. Phone stack locatestrade-ticket-heading(Buy {base}, #563) instead of aPlace limitheading.pairAddr.docs/frontend.md,docs/testing.md,AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md,AGENTS_FRONTEND_TRADE_INITIAL_LOAD.md,AGENTS_E2E_STRICT_CHAIN.md,AGENTS_FRONTEND_TRADE_TICKET_HEADING.mdcrosslinked.make verify-issue-561covers unit + skeleton/bootstrap + P10–P13.Also aligned three unrelated
make test-frontendassertion drifts (LCD outage copy SEC-E05;/limitsUpdateLimitOrderPricescale arg) so the issue’s verification command passes.Commands run
Checklist (issue body + post-merge note)
Layout / chrome
PriceChartshell-panel-strong(no wrappingcard-glass)trade-desktop-tape-panel)PanelResizeHandle/trade-*-resize-handlein the default layout; P10 asserts absence3.2fr); restore control stays visible (P12)inert+interactive={false}; restore visible (P10 + unit)1fr / 2.2fr / 1frkeeps chart largest'1'/'0'only; corrupt storage → defaultslggrid unchanged; oneTradeOrderTicketmountpairAddr(A9)make verify-issue-561Attack / abuse
?layout=does not hide panelspairAddr(Layout remount)Post-merge remaining
trade-sub-lg-workspace) — P13 + #146 specsClosing: all issue-body acceptance criteria, test-plan automation, and the post-merge comment’s remaining rungs passed.
mentioned in issue #652
mentioned in issue #653
mentioned in merge request !1151