docs+frontend: strengthen anti-nesting chrome invariant and dApp pass #653
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#653
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
The design system already says “One chrome layer per region” (#561 L561-2,
docs/design-system.md), but the wording explicitly allows nestedcard-glassinside a pageshell-panelfor “distinct inner blocks.” That exception is how/protocolGlobal stats became a panel wrapping elevenStatBoxcard-glasstiles (same pattern on Protocol fees, Charts overview strip, Trader summary). The invariant is documented but too weak, not enforced, and not applied to metric grids.Bundle into one issue: strengthen the anti-nesting / one-chrome-layer invariant in docs + skills, add a checkable rule (what is forbidden vs allowlisted), and run a dApp chrome pass that flattens remaining metric-grid nests. Do not split “update the sentence” vs “audit Charts” vs “change StatBox.”
/protocolGlobal stats + fees flattening (inline Δ%, volume %, daily chart) is #652 — implement that page there. This ticket owns the invariant and the rest of the app.Related: #652 (Protocol inline Δ% + flatten that page), #561 (Trade one-chrome; L561-2 lists Swap/Pool/Limits/Charts as audited — Protocol was not), #488 (design system), #489 (copy density; nested cards add visual noise), #550 / #569 / #586 (Protocol stats chrome).
Current codebase
docs/design-system.mdPrinciples table: “Do not wrapshell-panel/shell-panel-strong/card-glassin another of the same family for the same visual region. Page background → one section surface → content. Nestedcard-glassinside a pageshell-panelis OK for distinct inner blocks (Swap IO cards). First applied on/trade(#561).” There is no “excessive nesting” / metric-grid clause.AGENTS_FRONTEND_DESIGN_SYSTEM.mdrule 3 repeats the same exception.shell-panel+StatBoxcards.StatBox.tsxalways appliescard-glass !p-3. AnyStatBoxinsideshell-panelis automatic nest.ProtocolGlobalStats.tsx(11 tiles);ProtocolFeeStats.tsx(6 tiles);ProtocolOracleCard.tsx(StatBox grid + optional innercard-glasstable);ChartsPage.tsxoverview strip (shell-panel grid+ StatBoxes) and pair 24h stats panel;TraderSummaryStats.tsx(shell-panel+ 4 StatBoxes).swap-io-card-*card-glassinside the swapshell-panel— two interactive IO regions. Trade ticket / book / chart are siblingshell-panel*cells, not a panel-of-panels for the same region (L561-1 chart must not wrapPriceChartincard-glass)..shell-paneland.card-glassboth use 24px radius, border, blur, and a surface fill. Stacking them on a stats grid reads as a card of cards.StatBox.test.tsxdoes not assert chrome class. Norg/ ESLint rule forshell-panelwrappingcard-glass.python3 scripts/check_design_tokens.pydoes not cover nesting.QA_TEMPLATE.md§10 is theme/tokens, not nesting depth.Why this is needed
StatBoxinto section panels. Protocol production UI is the exhibit: a bordered section of bordered tiles.StatBoxdefaultcard-glass. The invariant must be global, with a short allowlist, plus a mechanical check.Constraints / guardrails
card-glassinside the swap panel stays the canonical exception (distinct interactive blocks). Document it as the exception, not the default.shell-panel*regions (L561-1–L561-3). Do not wrapPriceChart(shell-panel-strong) incard-glass. Do not reintroducePanelResizeHandle./protocolstats issue (inline Δ% + volume chart). This pass must not fight that layout: consume the sharedStatBox variant="flat"(or equivalent) those changes add; if this lands first, introduceflathere and leave Protocol tiles visually flat even before Δ% merges.shell-panel/shell-panel-strongcontaining a grid ofcard-glass(including defaultStatBox) for stats. Allowed: one section surface + typographic rows / hairline dividers / CSS grid without a second radius+border+blur.<table>— keep). Do not wrap every<tr>incard-glass.card-glassinsideshell-panel: Swap IO, pre-submit summaries, connect-wallet rows, a single chart/table well. Not: 4–11 repeated stat chips.--ink,--line,--panel-bg,--card-bg). Gold is not a fill. Light + dark both verified.title/aria-labelmust survive if StatBox markup changes). Charts USD-only (#548), trailing-window titles (#576), hub/oracle order (#550) stay.StatBox. Default remainscardso isolated uses (if any) do not silently lose a surface. Call sites inside a panel must passflat(or a wrapper). Prefer fixing call sites over a silent default flip that restyles every page at once without review.rgscript, or ESLint) that fails whenStatBox(card default) is a descendant ofshell-panel*in listed pages — or document an allowlist file. Do not bind-mountindexer/for cargo. Frontend-only verify is enough for this ticket.shell-panel+StatBoxhit fromrg. Out of scope: marketing OG (#578), wallet modals as such, community-tax manager forms unless they are the same metric-grid pattern.Relevant files
docs/design-system.mdskills/AGENTS_FRONTEND_DESIGN_SYSTEM.mddocs/frontend.mdQA_TEMPLATE.md§10frontend-dapp/src/components/ui/StatBox.tsxflatvariantfrontend-dapp/src/pages/ChartsPage.tsxfrontend-dapp/src/components/trader/TraderSummaryStats.tsxfrontend-dapp/src/components/protocol/ProtocolOracleCard.tsxfrontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsxfrontend-dapp/src/index.css.stat-flatprimitivescripts/check_design_tokens.pyor newscripts/check_chrome_nesting.pymake verify-issue-561/548/550/551/553Recommended direction
docs/frontend.mdglobal §):--bg-*→ oneshell-panel*per region → content.shell-panel*wrapping anothershell-panel*, or wrapping a grid ofcard-glass/ defaultStatBox, for the same region.StatBox variant="flat"(or.stat-flat): typography + optional Δ%, no second radius/border/blur.flatonce (shared with the Protocol stats sibling). Defaultcardunchanged.flathere if that issue has not merged.shell-panel+card-glassdescendants and fails on new hits outside the allowlist file./,/charts,/charts/:pair,/trader/:addr,/protocol,/trade(L561),/pool,/limits— light + dark, 375 and 1280.Acceptance criteria
card-glassis generally OK. Exception list is explicit and short.docs/frontend.mdhas a global one-chrome / anti-nesting subsection (Trade L561-2 points at it).StatBoxsupportsflat(or successor). Metric grids in scope use it.card-glasschips inside the section panel.card-glass. Trade chart still a singleshell-panel-strong(L561-1).make verify-issue-*for this ticket (or hooked intocheck_design_tokens/ lint-frontend).Test plan (all paths)
rg 'shell-panel' -g '*.tsx'inventory: each hit classified allowlist vs flattened; snapshot the allowlist in the check script.charts-overview-volume-usd, …) still present; values unchanged (#548 / #576 titles).trader-total-volume-usdstill compact USD (#553 / #551).?ticker=allowlist unchanged.make verify-issue-561(Trade chrome),548(Charts),550/ sibling Protocol issue,551/553/560(trader/portfolio).card-glass;flatdoes not.--focus-ring.Test plan (attack, hack, and abuse)
?ticker=, factory addresses) while touching Protocol oracle markup.--panel-bgmust still meet existing ink contrast (no--ink-subtleon--card-bgleftovers that disappear whencard-glassis removed).evalpage source; parse statically.Verification criteria
make lint-frontend+make test-frontend(or scoped Protocol/Charts/Trader/StatBox) green.python3 scripts/check_design_tokens.py(and new nesting check) green.make verify-issue-561green.mentioned in issue #652
mentioned in commit
30234a125fmentioned in merge request !1151
mentioned in merge request !1152
mentioned in commit
7245ac1c74mentioned in commit
c90c893493mentioned in issue #654
marked as related to #654
Merge !1151 is on
main(c90c8934) after resolving conflicts onto !1153 + !1152 (7245ac1c). Resolution kept #652 inline Δ% / daily chart on Protocol tiles and #653StatBoxstat-flat+hint+ chrome guard. Localmake verify-issue-653on the source tip was 14/14. After the conflict resolve: StatBox + Protocol + Charts + Trader RTL 82/82,check_chrome_nesting.pyandcheck_design_tokens.pygreen.Problems / leftovers (tracked on #654 — do not reopen this issue unless a merged invariant is wrong):
ci_quota_exceeded(not a code defect). Did not wait for CI./charts,/trader/:addr,/protocol,/, Swap IO stillcard-glass, Trade chart still singleshell-panel-strong, 375 + 1280, light + dark, theme toggle) was not run.mentioned in issue #655
mentioned in issue #656
mentioned in issue #657
marked as related to #657
mentioned in issue #659
mentioned in issue #660
marked as related to #660
mentioned in issue #662
mentioned in issue #663
mentioned in issue #664
mentioned in issue #665
mentioned in issue #666
marked as related to #666
mentioned in issue #667
marked as related to #667
mentioned in issue #668
mentioned in issue #669
marked as related to #669
mentioned in issue #670
mentioned in issue #671
mentioned in issue #677
mentioned in issue #680
mentioned in issue #689
mentioned in issue #692
mentioned in issue #693
mentioned in issue #703
mentioned in issue #713
mentioned in issue #715