fix: connected wallet dropdown alignment and spacing #671
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#671
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
Fix alignment and spacing on the connected wallet dropdown (header chip menu — the surface QA called the “wallet modal”). Bundle menu-row icon+label layout + header address wrap + docs/verify in one issue. Do not split “CSS flex” vs “AddressRow wrap” vs “Copy address vs other rows.”
Related: #185 (labeled menu rows), #140 (chip + dropdown), #183 (
CopyButton), #188 (AddressRow), #186 (chip network), #187 (dismiss + Escape), #144 (:focus-visibleon.wallet-menu-item), #214 (focus into first menuitem), #488 / #489 (tokens + no lectures).Not this issue:
WalletModal.tsx(disconnected Connect Wallet dialog —wallet-option-card). The broken surface is.wallet-menuafter the connected chip is opened.Current codebase
The connected header chip opens an absolute
.wallet-menuunder.wallet-dropdown-wrap. Header = LUNC balance + full-bech32AddressRow. Body = labeled rows from#185plus Portfolio / Trader / Disconnect. Copy address is the only row that lays out icon+label horizontally. Every other row stacks the icon above the label. The header address wraps mid-string with an underline and leaves copy/explorer icons on a following line.WalletButton.tsx:showDropdown→.wallet-menu+app-menu-dismiss+role="menu". HeaderWalletLuncBalance+AddressRow showFull(data-testid="wallet-menu-address-row"). ThenWalletDropdownMenuItems+LinkMy Portfolio +LinkTrader profile + Disconnect.WalletDropdownMenuItems.tsx:CopyButton menuLabel="Copy address"; explorer<a class="wallet-menu-item">; switch<button class="wallet-menu-item">. Testidswallet-menu-copy-address/wallet-menu-view-explorer/wallet-menu-switch-wallet.CopyButton.tsxmenuLabelbranch adds Tailwindinline-flex items-center gap-2on top ofwallet-menu-item. Icon-only /buttonLabelvariants are other surfaces.index.css~1152–1178:.app-menu-linkis in the shared nav group (display: inline-flex; align-items: center; gap: 8px)..wallet-menu-itemis not. The later shared rule (~1277–1293) only setsjustify-content: flex-start, padding, width, and focus — nodisplay/align-items/gap/flex-wrap: nowrap. Tailwind preflight makessvg { display: block }, so a block SVG + following text wraps to two lines.AddressRow.tsx:showFull→ full bech32 +break-all+underlineon the label<a>, parentinline-flex flex-wrap. Menu min-width is 210px (.wallet-menu). Icons wrap onto their own line. Chip trigger already usesshortenAddress.docs/frontend.md§ Connected wallet dropdown: order + testids, no row-layout invariant. § AddressRow:showFull+break-allis documented as intended for this menu.skills/AGENTS_FRONTEND_WALLET_CHIP.mdlists affordances, not flex alignment.WalletButton.test.tsx,WalletDropdownMenuItems.test.tsx,CopyButton.test.tsx,AddressRow.test.tsx,e2e/navigation.spec.tswallet block: presence / click / focus, never computed flex or icon/label bounding boxes.Why this is needed
#185shipped labels without a shared row primitive. OnlyCopyButtonopted into flex. Explorer / Switch / Portfolio / Trader / Disconnect did not. Per-row Tailwind will drift again.break-all+ underline in a 210px panel wraps mid-string and orphans the header copy/explorer icons. The same actions already exist as labeled rows. The header should stay honest (full address available) without looking like overflow.Constraints / guardrails
WalletModalconnect cards, WalletConnect pairing, or.app-menu-linkunless a shared helper is extracted and those surfaces stay visually unchanged.#185/#140behavior. Menu order: balance + address header → Copy address → View on explorer (omit when URLnull) → Switch wallet → My Portfolio → Trader profile → Disconnect. Samedata-testids. Switch stilldisconnect()thensetWalletModalOpen(true). Copy still writes the full bech32 viacopyToClipboard/CopyButton. Explorer stillgetExplorerAddressUrlonly (noopener noreferrer)..wallet-menu-item, not by copying Tailwind onto every row. Shared rule must includedisplay: inline-flex(orflex),align-items: center,gap(8px to match.app-menu-link),flex-wrap: nowrap,justify-content: flex-start.CopyButtonmenuLabelmay drop redundant Tailwind once the class is correct.CopyButtonmodes. Icon-only (AddressRow / TokenIdentity) andbuttonLabel(WalletConnect #519) must stay icon-button / pairing-copy. Do not putrole="menuitem"on those.terra1…suffix) withtitle/ accessible name = full bech32, or a wrap that does not mid-word-underline a 44-char string and does not drop icons onto a lonely second row. Full address must remain copyable. Do not add “this is your wallet address” copy. ChangingshowFullfor this consumer is allowed; defaultAddressRow(Pool / Trader / Protocol hub) must still supportshowFull+ shorten for other pages.#185rows to “clean up” the header.--ink*/--menu-bg/--line. No*-neo. No extracard-glass/shell-panelinside the menu. Light + dark.:focus-visibleon.wallet-menu-item/.copy-button. First menuitem still receives focus on open; Escape + dismiss still close and return focus to the chip. Hit targets stay usable (≥ existing padding). Do not shrink icons beloww-4 h-4.sm+) and phone (<smchip). Menu already hasmax-height+overflow-y: auto(short / mobile). Rows must not force a 2× height from stacked icons. Menu must not cover the mobile tab bar more than it does today (z-index55).docs/frontend.md§ Connected wallet dropdown andAGENTS_FRONTEND_WALLET_CHIP.md. Update AddressRow notes if the wallet header no longer usesshowFullwrap.Relevant files
frontend-dapp/src/index.css.wallet-menu,.wallet-menu-item(primary fix)frontend-dapp/src/components/wallet/WalletButton.tsxfrontend-dapp/src/components/wallet/WalletDropdownMenuItems.tsxfrontend-dapp/src/components/ui/CopyButton.tsxmenuLabelrow; drop redundant flex if CSS owns itfrontend-dapp/src/components/ui/AddressRow.tsxfrontend-dapp/src/components/wallet/WalletLuncBalance.tsxfrontend-dapp/src/components/wallet/__tests__/WalletButton.test.tsxfrontend-dapp/src/components/wallet/__tests__/WalletDropdownMenuItems.test.tsxfrontend-dapp/src/components/ui/__tests__/CopyButton.test.tsxmenuLabelstill menuitem; icon-only unchangedfrontend-dapp/src/components/ui/__tests__/AddressRow.test.tsxfrontend-dapp/e2e/navigation.spec.tsfrontend-dapp/e2e/helpers/wallet-ui.tsdocs/frontend.mdskills/AGENTS_FRONTEND_WALLET_CHIP.mdskills/AGENTS_FRONTEND_ADDRESS_ROW.mdscripts/qa/verify-issue-NNN.sh+Makefilemake verify-issue-NNNRecommended direction
.wallet-menu-itemnext to the existing override (same gap/alignment as.app-menu-link). Keep the flat:focus-visiblering..wallet-menu-itemto the shared navinline-flexgroup only if that does not re-apply chrome borders /min-height: 36px/ centered justify that the override already strips. Safer: set display/align/gap on.wallet-menu-itemitself.wallet-menu-address-row, use truncatedshortenAddress(match chip density, e.g. 8/6 or 6/6) +title={address}+ keep icon clusterflex-nowrapon the same row. Clipboard / explorer still use the full string. IfshowFullmust remain for QA, constrain wrap (overflow-wrap+ no underline on the wrapping label; iconsshrink-0on the first line).toHaveStyle/getComputedStyle(or jsdom class assertions) that every[role=menuitem]in the open menu is a horizontal flex row. Playwright: icon and label bounding boxes share a row (icony≈ labely, iconx< labelx) on desktop and 390px.make verify-issue-NNN: WalletButton + dropdown + CopyButton menuLabel + AddressRow + CSS grep for.wallet-menu-itemflex + docs/skill invariants. Optional Playwright when LocalTerra is up (5 workers; noe2e-tx).Acceptance criteria
getExplorerAddressUrl; row hidden when URL isnull.CopyButtonandbuttonLabelpairing copy unchanged.docs/frontend.md+AGENTS_FRONTEND_WALLET_CHIP.mddocument the row-layout invariant.make verify-issue-NNNexists and is green.Test plan (all paths)
CSS / unit
[role=menuitem]computeddisplayisflexorinline-flex;flex-directionisrow;align-itemsiscenter;flex-wrapisnowrap(or equivalent class contract).role="menuitem"and copies the full address (existing CopyButton test).href= helper URL; omitted when helper returnsnull.disconnectthensetWalletModalOpen(true).hrefs unchanged (/portfolio,/trader/${address}).disconnectand closes the menu.titleor accessible name includes full bech32; copy still writes full string.AddressRowwithout the wallet-header mode (Pool LP, trader header, Protocol hub) still shortens by default and still supportsshowFullwhere those pages need it.role="menuitem", stillaria-labelonly.buttonLabelpairing copy: not a menuitem (existing #519 test).#palette on these rows; no*-neo.E2E (Playwright, 5 workers, no
e2e-tx)target="_blank"+relincludingnoopener; Switch wallet opens Connect Wallet heading.data-theme) smoke: menu readable, no clipped labels.Docs / verify
docs/frontend.mdstates icon+label are one row via.wallet-menu-item.AGENTS_FRONTEND_WALLET_CHIP.mdforbids stacking icons above labels.make verify-issue-NNNgreps the flex rule + runs the unit files above.Test plan (attack, hack, and abuse)
addressstring (trimmed by existing helper). Do not copy innerHTML, ajavascript:URL, or attacker-controlled query text. Existing empty/whitespacecopyToClipboardfail path unchanged.hrefonly fromgetExplorerAddressUrl. If helper is mocked tojavascript:alert(1)ordata:text/html,…, treat as invalid / omit the row (same asnull) — do not render a livejavascript:link. Keeprel="noopener noreferrer".<script>,"><img src=x onerror=…>, HTML entities in a spoofed address string must not execute.titlemust not break out of the attribute./portfolio,/trader/${address}). Do not acceptaddressthat turns the path into//evilorhttps://…. Invalid / empty address: do not render the connected menu (existing gate isif (address))..wallet-menuz-indexabove modal portals (connect modal / terms). Dismiss backdrop still covers the page so a leftover menu cannot sit over Swap CTAs after “close.”preventDefaulton Tab in a way that traps the user.:focus-visiblering remains visible (nooutline: nonewithout a replacement ring).role="menuitem"). Do not nest a second<a>inside a menuitem (double navigation / overlay). Header AddressRow links stay separate from menu rows.ulunaonly.useNativeUlunaBalance). Menumax-height+ overflow stays so a zoomed/short viewport cannot lock the page scroll.color-schemebutton face (same class of bug as token listboxes). Rows use--ink-dim/--inkon--menu-bg.menuLabelclasses must not make AddressRow / TokenIdentity / pairing copy into full-width menuitems or stealrole="menu"semantics outside the wallet menu.Verification criteria
Done when:
#185/#140specified.make test-frontendcovers the new layout assertions;make verify-issue-NNNis green; Playwright geometry checks pass when the smoke stack is up.showFull+break-allmid-wrap is the desired wallet-header look (unless a reviewer explicitly keeps full wrap and it no longer orphans icons).marked as related to #185
marked as related to #140
marked as related to #188
marked as related to #183
marked as related to #144
mentioned in commit
756acf1edcmentioned in merge request !1169
mentioned in commit
c7b888ff56mentioned in commit
fa67862b24mentioned in issue #672
Merged to
mainvia !1169. Close tests from #672 were kept innavigation.spec.ts.Leftover: connected wallet dropdown icon+label rows after frontend rebuild.
make verify-issue-671.mentioned in issue #673