Repository navigation
Mobile: scroll-shadow cue on horizontally-scrolling data tables (#150) - #151
Conversation
Below 900px table.data becomes an overflow-x scroller. Mobile scrollbars are overlay-only (vanish at rest), so a wide table gave no sign the last column was clipped — reported from the Sales list where the Customer column was cut mid-word. Add the Lea Verou pure-CSS scroll-shadow to the shared table.data rule: two surface->transparent cover layers pinned to the content (local) mask the shadow at whichever edge is reached; two --scroll-cue radial layers pinned to the scroller (scroll) show through wherever content overflows. Result: a right fade while there is more right, a left fade once scrolled, neither at rest with no overflow. No JS, no per-table markup, so every data table (Sales, History, Audit, Stock, Reports) gets it at once. --scroll-cue is a theme token (light + both dark blocks); the cover uses --surface, so it works in both themes. Static gradient, so nothing to gate on prefers-reduced-motion. Guarded by a StockPage test asserting the table.data hook the CSS keys off still renders.
Two fixes from review + phone testing of the History table: - Dark mode showed no cue: a black shadow (rgba(0,0,0,.5)) is invisible on the near-black table surface. Switch --scroll-cue in both dark blocks to a light glow (rgba(255,255,255,.16)) so the overflow edge reads as 'more here'. - The cue faded out toward the top and bottom rows: the shadow layers were radial (Verou's original), which on a tall table (History runs a dozen rows) leaves the first and last rows uncued. Switch them to linear gradients for a uniform bar down the whole edge (pi review). Also widen the cover's solid stop 35% -> 40% so it fully spans the 0.85rem cue with nothing peeking at the rested edge. Re-verified at 412px, light and dark, on a 12-row table: uniform edge cue top to bottom, none when the table fits.
Review round complete — codex + 2 Claude agents + picodex — no findings, approve. All four background layers valid; Claude agent 1 (feature-dev) — no high-confidence defects. Confirmed shorthand ordering, the local/scroll cover-masks-cue behavior on the self-scrolling Claude agent 2 (cavecrew) — no issues. Same conclusions. pi (deepseek-v4-flash, single-pass) — no functional defect; two polish items adopted:
Extra fix from phone testing (not a reviewer finding)Testing the dark History table on a real phone showed no cue at all: a dark shadow ( 373 tests pass, tsc + vite build clean. CI re-running on the latest push. |
Closes #150.
Problem
Below 900px
table.databecomesoverflow-x: auto. Mobile scrollbars are overlay-only — they appear during a scroll and vanish at rest — so a wide table gives no sign the last column is clipped. Reported from the Sales list at 412px: the Customer column cut mid-word ("Hotel Paraí…") with no cue. Affects every data table (Sales, History, Audit, Stock, Reports).Fix
Lea Verou's pure-CSS scroll-shadow, dropped into the shared
table.datarule so it covers every table at once — no JS, no per-table markup:--surface→ transparent,background-attachment: local) ride the content and mask the shadow at whichever edge you've reached;--scroll-cue→ transparent,background-attachment: scroll) sit at the element edges and show through wherever content still overflows.Net: right fade while there's more right, left fade once scrolled, neither at rest when the table fits.
--scroll-cueis a theme token (light + both dark blocks); the cover uses--surface, so both themes work. Static gradient → nothing to gate onprefers-reduced-motion.Verification
Headless Chromium at 412px, light + dark. A debug render (covers→lime, shadows→red) confirmed the geometry: at rest the left cover masks the left shadow and the right shadow shows; mid-scroll both edges show; a table that fits shows neither. Real render at the shipped alpha shows a soft right-edge fade past the last visible column.
Tests
373 pass (+1). New StockPage guard asserts the
table.datahook the CSS keys off still renders — the class is the whole contract, so a refactor dropping it would silently kill the affordance. jsdom can't render the gradient (visual, browser-verified above). Coverage above floor (90.64 / 84.46 / 71.07). tsc + vite build clean.Docs
No new user-facing term (a visual affordance, not a named concept), so no GLOSSARY / Help / glossary-table change — consistent with the issue's checklist.
Deferred (own slice): stacking ID-heavy rows into cards to remove horizontal scroll entirely; the scroll-shadow is the cheap fix that removes the "is there more?" ambiguity now.
Part of epic #14 (Phase 1.1).