Skip to content

fix(web): mobile trading layout, chart touch controls, reduced motion - #1098

Merged
abayomicornelius merged 1 commit into
SO4-Markets:mainfrom
Petrelid:fix/mobile-trading-ux-1055-1056-1057-1058
Nov 24, 2026
Merged

abayomicornelius merged 1 commit into
SO4-Markets:mainfrom
Petrelid:fix/mobile-trading-ux-1055-1056-1057-1058

Conversation

@Petrelid

Copy link
Copy Markdown
Contributor

Closes #1055
Closes #1056
Closes #1057
Closes #1058

#1055 and #1058 have identical text, so one set of changes covers both.

Changes

Responsive layout: #1055 / #1058

  • Shared ScrollArea collapsed to 10px. Commit 387030d leaked a scrollbar-thumb class string (data-vertical:w-2.5 touch-none select-none …) onto the wrapper. data-orientation matches those variants, so every vertical ScrollArea was 10px wide with touch scrolling disabled. Because of this the trade keyboard-shortcuts dialog rendered blank at every width, and the command palette list was affected too. Removed the string and added a regression test.
  • The floating Help button covered controls. It sat over the OHLC "Show" toggle at 320px, the Positions tab at 768px, and Reset layout at 1280px. It now sits in flow at the start of the workspace footer, which is visible at all widths. Reset layout stays md+ only.
  • The chart source/OHLC strip clipped. At phone widths the L/C values and network label were cut off, and digits overlapped at 768px. The strip now wraps, and legend items don't break.
  • Shortcut descriptions now wrap instead of being truncated.

Chart touch usability: #1056

  • Swipes on the chart no longer block page scroll. The chart had touch-action: none. It now uses pan-y together with lightweight-charts' vertTouchDrag: false, so vertical swipes scroll the page while horizontal drag and pinch still pan and zoom.
  • Timeframe buttons, the new view controls, Retry / Refresh now, and the OHLC table toggle use the shared touch-target utility (44px on coarse pointers).
  • The timeframe highlight now re-measures on resize, so it stays under the selected button when buttons grow or the device rotates. Fixed the "Switch to 5m chart ()" tooltip.
  • Zoom in / Zoom out / Fit all candles buttons give keyboard and assistive-technology users equivalents of the pinch, wheel, and drag gestures. They're disabled until candles load, and zoom-in stops at 10 bars.

Reduced motion: #1057

  • Audited shared UI and the trade flows. Spinners were unconditionally animate-spin; the Button spinner even paired that with motion-safe:animate-spin, which defeated it. Fixed in Button, TransactionStatus, TxStatus, LoadingPage, and the ConfirmationDialog submit spinner. Without motion they show a static ring, and aria-busy / status text still convey the state.
  • Added motion-reduce alternatives to transform, width, and opacity motion: RollingNumber, Meter, ProgressIndicator, Switch thumb, Sidebar chevron, RouteProgressBar, depth-ladder fills, chart/depth-chart stale fades, market-selector chevron, trade-panel entry fades, and the Navbar arrow. Live/stale pulses are now motion-safe:.
  • EmptyState's one-off duration-500/duration-300 now use the existing duration-slowest/duration-slow tokens, and there's no entry animation under reduced motion.
  • Select and DropdownMenu popups keep their opacity fade (it marks open/close) but drop the zoom and slide, for both the system preference and the in-app toggle. This uses targeted data-slot rules next to the existing dialog/sheet ones; no broad transition rules.
  • I also fixed the identical one-token instances in earn (FaucetCooldown), referrals (tier progress), and changelog, per AGENTS.md §3 (fix sibling instances of the same bug).

Testing

  • packages/ui: ScrollArea regression (3 cases fail before / pass after). New __tests__/reduced-motion.test.tsx contract suite (all 10 cases fail before / pass after).
  • apps/web: new TVChart.test.tsx (touch sizing, indicator re-measure incl. scroll offset, arrow keys) and KeyboardShortcutsHelp.test.tsx. TVChartContainer.test.tsx gained touch-action / gesture options / zoom / fit / wrap cases (44/44 pass).
  • e2e/trade-responsive.spec.ts: the network helper gained an opt-in deterministic klines stub, so the chart renders with data. New cases cover chart-strip containment, Help not overlapping any control plus a visible shortcut list, and coarse-pointer 44px chart controls with a tap-through. 24/24 pass with -j 2 (CI's default). With 4 workers on my 8-core / 7 GB machine, the dev server starved and some page loads timed out; that was load, not the change (I compared idle DOM churn and long tasks with baseline and they matched).
  • Related specs (trade, trade-a11y-journey, trade-workspace-visual, mobile-nav, trade-long-session, design-system-visual, skip-link) produce an identical failure set before and after this change locally. Upstream main CI is already red on Playwright (128 failed), mostly visual-snapshot suites.

Commit gate

⚠️ I opened this PR at the author's request while the full gate (§1) was still running. I'll post the results as a comment. Already run: tsc for apps/web (clean) and the targeted unit and e2e suites above. Things to know:

  • apps/web has no test script, so bun run test does not run web unit tests. Run directly, the web suite already has 65 failures on main.
  • bun run changelog:validate already fails on main because of other entries (ob-058, ob-060, 780); the new entry has no errors.
  • I did not regenerate visual snapshots. Local rendering already differs from the committed baselines on main, so local updates wouldn't be CI-equivalent. The gallery ScrollArea demo and trade workspace will legitimately change (the old rendering was the 10px bug).

Screenshots

Before After
320 chart
320 help dialog
768
1280

Note: the "before" captures were taken mid-work. The 320 chart shot already includes the ScrollArea fix but none of the chart or Help changes, and the 768/1280 shots predate the Help and chart changes. The colourful circle at the bottom-right is the dev-only TanStack devtools launcher.

Closes SO4-Markets#1055, SO4-Markets#1056, SO4-Markets#1057, SO4-Markets#1058.

Responsive layout (SO4-Markets#1055/SO4-Markets#1058): the shared ScrollArea wrapper carried a
leaked scrollbar-thumb class string (data-vertical:w-2.5, touch-none,
select-none) from 387030d. data-orientation matches those variants, so
every vertical ScrollArea collapsed to a 10px column: the trade shortcuts
dialog rendered blank at all widths, and touch scrolling and text
selection were off. The fixed Help button covered the OHLC table toggle
(phone), the Positions tab (tablet) and Reset layout (desktop); it now
sits in flow in the workspace footer. The chart source/OHLC strip did not
wrap, clipping candle values and the network label off-screen.

Chart touch (SO4-Markets#1056): the chart set touch-action:none, so any swipe that
started on it could not scroll the page. It now uses pan-y with
vertTouchDrag disabled; horizontal drag and pinch still drive the chart.
Timeframe, view, retry and table-toggle controls use the shared
touch-target utility, the timeframe highlight re-measures on resize, and
zoom in/out/fit buttons give keyboard and AT users equivalents of the
gestures.

Reduced motion (SO4-Markets#1057): spinners were unconditionally animate-spin (the
Button spinner paired it with motion-safe, defeating it); transform/width
transitions, pulses and entry animations lacked reduced alternatives;
EmptyState used one-off durations. Fixed per component with existing
tokens, no broad rules. Select/DropdownMenu popups keep their fade but
drop zoom and slide for both the system and in-app preference.

Tests: ScrollArea regression (fails before, passes after), a shared
reduced-motion contract suite (10 cases fail before, pass after), TVChart
and TVChartContainer touch/view-control tests, KeyboardShortcutsHelp
tests, and new trade-responsive e2e cases (24/24 pass with 2 workers).
Opened at the user's request while the full commit gate was still running;
results are reported on the PR.
@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Petrelid is attempting to deploy a commit to the Ijai's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@Petrelid Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@abayomicornelius
abayomicornelius merged commit d89d1c7 into SO4-Markets:main Nov 24, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants