bug(frontend): /pool Manage must expose provide, withdraw, zap add, and zap withdraw as peer actions #660

Closed
opened 2026-08-26 04:11:18 +00:00 by PlasticDigits · 15 comments
PlasticDigits commented 2026-08-26 04:11:18 +00:00 (Migrated from gitlab.com)

Summary

/pool page-level Add / Withdraw are one-sided zap (#533), but the labels look like ordinary LP. Two-sided Provide Liquidity / Withdraw Liquidity live only under pair Manage → Advanced. Retail users cannot tell which action they are taking and cannot find two-sided provide/withdraw.

Ship one pair-scoped Manage IA: four peer actions on the expanded row — Provide Liquidity, Withdraw Liquidity, 1-side zap add, 1-side zap withdraw. Do not leave zap as page chrome. Do not hide two-sided behind Advanced.

Related (do not reopen mechanics): #533 (Z533 zap math), #559 (Z559 floors), #531 (how-to H531-3), #547 (table + Manage expand), #489 (copy), #653 (one chrome layer), #462 (pre-sign), #201 (tab vs submit name collision).

Current codebase

#533 made page-level zap the default retail surface and parked two-sided under Advanced. That IA is now the bug.

Surface Behavior today
PoolPage.tsx Above search + table: OneSidedAddCard + OneSidedWithdrawCard (md:grid-cols-2). Headings are Add / Withdraw (ONE_SIDED_ADD_TITLE / ONE_SIDED_WITHDRAW_TITLE). Each card has its own pair / LP picker — not scoped to a table row.
PoolPairsTable.tsx Sortable catalog table. Row Manage toggles expandedAddr and mounts one PoolAdvancedManage (pool-row-manage-panel). Default table paint does not getPool / getPairFeeConfig (P547-9).
PoolAdvancedManage.tsx Root is shell-panel-strong. Two-sided provide/withdraw tabs live inside <details data-testid="pool-card-advanced" open> whose summary is Advanced (ONE_SIDED_ADVANCED_LABEL). Tabs: Provide Liquidity / Withdraw Liquidity. Native wrap checkboxes, ratio warning, IL, gas gate, pre-sign stay here.
Zap cards OneSidedAddCard: Token (wallet > 0) + Pair (factory) + Amount. OneSidedWithdrawCard: LP (wallet LP > 0) + Withdraw as + Amount. Quote/submit: quoteOneSidedAdd / oneSidedLiquidityTx (wrap → pool-only swap → provide, or withdraw → swap → unwrap). Empty pool: Empty pool. Use Advanced. (ONE_SIDED_EMPTY_POOL_ERROR).
How-to / docs H531-3 and POOL_LP_HOWTO_TWO_SIDED say retail Add is one-sided and two-sided is Advanced. docs/user-lunc-liquidity.md and docs/frontend.md § Z533 / P547-8 repeat that. Design-system glossary still says “Both tokens required” / wrap checkbox.
E2E / units Smoke and tx specs assert page-level pool-one-sided-add / pool-one-sided-withdraw. Two-sided paths use openPoolCardAdvanced (e2e/helpers/pool-ui.ts) which expands Manage and the Advanced <details>. PoolPage.test.tsx U1/U2 assume zap cards exist without opening Manage.

pool-card-advanced is open by default after Manage expand, so two-sided tabs are not fully collapsed — they are still labeled and grouped as Advanced, and the primary Add/Withdraw on the page are zap. That is the confusion.

Why this is needed

  1. Zap is mislabeled as Add/Withdraw. Users opening /pool see Add/Withdraw first. Those flows swap to ratio (and may wrap). They are not two-sided provide_liquidity / pro-rata withdraw. Pre-sign and IL exist, but the page chrome does not say zap.
  2. Zap is not pair-scoped. Page cards pick any factory pair. Manage is the pair the user already chose in the table. Zap belongs there so the pair cannot silently differ from the row.
  3. Two-sided is treated as power-user chrome. Empty-pool first deposit must be two-sided (MINIMUM_LIQUIDITY / Z533-5). Hiding it under Advanced (and teaching “use Advanced”) makes the only valid first-deposit path look optional.
  4. Four actions are four products. Two-sided provide, two-sided withdraw, zap-in, and zap-out have different messages, fees, and failure modes. They need peer buttons with distinct names — not two page cards plus a nested Advanced disclosure.
  5. #531 / #547 docs cannot stay honest if the page still leads with unlabeled zap and parks provide/withdraw under Advanced.

Constraints / guardrails

  1. IA only — do not re-solve zap. Keep Z533-1–Z533-10 and Z559-1–Z559-4 (ratio split, floors, wrap implied by token, unwrap only the zap-out amount, factory-only zap, pool-only hop, submit-aligned quote, 18-dec LP, no new pair/router Zap execute).
  2. Four peer actions under Manage (visible without an Advanced <details>): Provide Liquidity, Withdraw Liquidity, 1-side zap add, 1-side zap withdraw. #489: labels ≤ ~5 words. If “1-side zap add” wraps badly at 375px, Zap Add / Zap Withdraw are acceptable synonyms — the word zap (or one-sided) must remain so this is not confused with two-sided.
  3. No page-level zap cards. Remove the md:grid-cols-2 Add/Withdraw block from PoolPage. Search, how-to, outage banners, and the table stay.
  4. Pair is implicit from the expanded row. Zap add must not expose a second pair picker. Zap withdraw must target this pair’s LP (no LP picker that can select another pair’s LP). Off-pair input tokens that still route into a pair leg remain allowed (Z533-6).
  5. One action form at a time. Do not mount all four quote/submit trees on expand. Lazy-mount the selected action so Manage expand stays one LCD getPool / fee config (P547-9). Never getPool on every table row.
  6. Empty pool: zap add/withdraw disabled with one short sentence that points at Provide Liquidity (not “Use Advanced”). First deposit stays two-sided.
  7. Indexer-only / non-factory rows: zap stays factory-only. Two-sided may remain if the pair contract is reachable; do not advertise zap on Indexer-only marks.
  8. Do not nest chrome. PoolAdvancedManage is already shell-panel-strong. Do not drop another shell-panel* / page-level zap card inside it (C653-1). Forms are typography + existing provide card-glass wells, not a second panel.
  9. Keep safety gates on every action: IL (#366), pause, blacklist, code-id freeze (#585), wrap-mapper pause / treasury match, gas envelopes, clickwrap, NFA, Expert Mode impact, pre-sign (#462). Pre-sign action text must match the selected button (do not show “Provide Liquidity” on a zap-add submit).
  10. Tab vs submit names (#201). Expand/tab controls and submit CTAs must stay distinguishable (first/last or distinct accessible names / testids). Do not reuse Provide Liquidity for both a zap tab and a two-sided submit.
  11. Production gems (#562): do not reintroduce gem-bridge zap on production pickers.
  12. Do not change pair mint/burn math, fee treasury, wrap-mapper bps, factory whitelist, or catalog rank.
  13. Update copy + playbooks in the same change: H531-3, poolLpHowtoCopy.ts, oneSidedLiquidityCopy.ts, ONE_SIDED_EMPTY_POOL_ERROR, docs/frontend.md (Z533 / P547-8 / P547-9), docs/user-lunc-liquidity.md, design-system glossary (stale “Both tokens required”), AGENTS_FRONTEND_POOL_* skills. How-to stays opt-in / dismissible (H531-7).
  14. E2E helpers must open Manage + action tab, not pool-card-advanced. Update openPoolCardAdvanced or replace it; do not leave a dead Advanced disclosure for tests to click.
  15. LocalTerra for on-chain paths. Do not skip with a false “no LocalTerra.”

Relevant files

File Role
frontend-dapp/src/pages/PoolPage.tsx Page-level zap grid to remove; table / search / how-to stay
frontend-dapp/src/components/pool/PoolPairsTable.tsx Manage expand; mount pair manage once
frontend-dapp/src/components/pool/PoolAdvancedManage.tsx Two-sided today; become pair manage (rename optional)
frontend-dapp/src/components/pool/OneSidedAddCard.tsx Zap-in form; pair picker must become implicit
frontend-dapp/src/components/pool/OneSidedWithdrawCard.tsx Zap-out form; LP must pin to this pair
frontend-dapp/src/utils/oneSidedLiquidityCopy.ts Add / Withdraw / Advanced labels
frontend-dapp/src/utils/oneSidedLiquidityQuote.ts Empty pool. Use Advanced.
frontend-dapp/src/utils/poolLpHowtoCopy.ts H531-3 “two-sided is Advanced”
frontend-dapp/src/pages/PoolPage.test.tsx Assumes page-level zap without Manage
frontend-dapp/e2e/helpers/pool-ui.ts openPoolCardAdvanced
frontend-dapp/e2e/pool-one-sided-533.spec.ts / pool-one-sided-533-tx.spec.ts Page-level zap
frontend-dapp/e2e/pool-table-547.spec.ts / pool-lp-howto-531.spec.ts / wrap-pool.spec.ts / pool-tx.spec.ts Advanced + page zap
docs/frontend.md Z533, H531-3, P547-8/9
docs/user-lunc-liquidity.md Retail backup
docs/design-system.md Glossary: Pool / Provide / Withdraw
skills/AGENTS_FRONTEND_POOL_ONE_SIDED.md “two-sided lives under Advanced”
skills/AGENTS_FRONTEND_POOL_TABLE.md “one-sided cards” on the page
skills/AGENTS_FRONTEND_POOL_LP_HOWTO.md H531-3
  1. Rename or keep PoolAdvancedManage as the pair manage panel. Replace the Advanced <details> with a single tab row of four actions (wrap on narrow). Default selected tab: none, or last-used in-session — do not auto-open a signable form until the user picks an action.
  2. Extract zap forms so they accept pair: PairInfo (and factory set only for off-pair token routing). Delete page-level pair/LP pickers.
  3. Keep existing zap quote/tx helpers; only change mount + labels + empty-pool copy.
  4. Keep two-sided provide/withdraw forms as they are (auto-fill #480, wrap checkboxes, ratio warning, donate still possible on off-ratio).
  5. Update make verify-issue-531 / 533 / 547 / 559 expectations and add make verify-issue-660 for the new IA. Playwright smoke: 5 workers. Tx: 1 worker.

Acceptance criteria

  • M1 /pool default paint has no page-level Add/Withdraw zap cards (pool-one-sided-add / pool-one-sided-withdraw are absent until a row Manage is expanded and a zap action is selected).
  • M2 Expanding Manage on a factory pair shows four peer controls: Provide Liquidity, Withdraw Liquidity, 1-side zap add, 1-side zap withdraw (or Zap Add / Zap Withdraw). None of these require opening Advanced.
  • M3 There is no pool-card-advanced Advanced disclosure wrapping two-sided provide/withdraw. ONE_SIDED_ADVANCED_LABEL is unused on /pool.
  • M4 Zap add/withdraw operate on the expanded pair only. Changing table row / collapsing Manage cannot submit against a different pair.
  • M5 Two-sided provide/withdraw remain fully usable (empty-pool bootstrap, wrap checkboxes, ratio warning, #480 auto-fill / withdraw preview, #147 gas gate, #462 pre-sign).
  • M6 Empty pool: zap actions disabled with one sentence pointing at Provide Liquidity. Two-sided provide stays enabled.
  • M7 Indexer-only rows: zap actions disabled or omitted. Two-sided not advertised as zap.
  • M8 How-to + user-lunc-liquidity.md + frontend.md + design-system glossary + pool skills no longer say “two-sided is Advanced” or “Use Advanced.” They describe Manage → four actions.
  • M9 P547 table invariants hold: catalog default, no N+1 LCD, no header essays, how-to dismissible.
  • M10 C653: no shell-panel* inside the manage shell-panel-strong. make verify-issue-653 still passes.
  • M11 Existing zap/two-sided safety gates still fire (pause, blacklist, freeze, mapper pause, stale quote, Expert Mode).
  • M12 make verify-issue-531, 533, 547, 559 pass after helper/copy updates. New make verify-issue-660 covers M1–M11.

Test plan (all paths)

ID Path Expect
T1 /pool disconnected, no Manage How-to + search + table. No zap cards. No LCD pool queries per row.
T2 Manage expand, no action Four tabs visible. No signable form until a tab is selected.
T3 Provide Liquidity Two amount fields, wrap checkboxes, IL, ratio warning, pre-sign Provide Liquidity.
T4 Withdraw Liquidity LP amount, both-asset preview, pre-sign Withdraw Liquidity.
T5 1-side zap add Token + Amount only (no pair picker). Quote + pre-sign name the zap action. Wrap implied by native token.
T6 1-side zap withdraw This pair’s LP + Withdraw as + Amount. No other-pair LP picker. Unwrap only zap-out amount.
T7 Empty pool Zap add disabled (“…Provide Liquidity”). Two-sided provide works (MINIMUM_LIQUIDITY).
T8 Indexer-only row Zap hidden/disabled. Factory mark still correct.
T9 Switch tabs Amounts/quotes do not submit on the wrong action. Stale zap quote cannot fire provide.
T10 Collapse / other row Previous form unmounts. No submit against the old pair.
T11 Search / column sort / page expandedAddr clears (already does). Manage does not stick to the wrong pair.
T12 How-to #lp-howto Steps name Manage + four actions. Forbidden-copy check still empty.
T13 375px and 1280px Four tabs wrap; all four reachable; no nested card-in-card. Light + dark.
T14 Portfolio “Manage on Pool” Still reaches /pool. Optional: deep-link a pair later — not required.
T15 Pause / blacklist / freeze / mapper pause Each selected action disables CTA + existing short error.
T16 Off-pair token → factory pair zap-in Still quotes or No route. Pair remains the Manage row.
T17 Production hide gems Zap token/pair universe still omits gems (P562).
T18 Playwright smoke (5 workers) Update 531 / 533 / 547 / wrap-pool specs. No pool-card-advanced dependency.
T19 LocalTerra tx (1 worker) One two-sided provide and one zap-add still land (existing 533-tx / wrap-pool / pool-tx).
T20 Units PoolPage.test.tsx U1/U2 move to Manage+tab. Copy tests reject leftover “Advanced” pool IA.

Test plan (attack, hack, abuse)

ID Vector Guard
A1 User signs zap thinking it is 1:1 two-sided provide (half swapped, fee + IL) Distinct zap labels; pre-sign action ≠ Provide Liquidity; IL still on zap add.
A2 Off-ratio two-sided donate presented as zap Two-sided stays its own tab; ratio warning unchanged; zap still refuses off-ratio provide (Z533-4).
A3 Page-level leftover card + Manage form → submit wrong pair Page cards gone; pair implicit; submit uses expanded row address only.
A4 Mount zap quoters on every row (LCD / indexer DoS) Forms mount only on expanded row + selected action (P547-9).
A5 Hidden Advanced disclosure still used to sneak donate / hide two-sided Advanced wrapper removed; tests fail if pool-card-advanced returns.
A6 Pre-sign phishing: action label does not match messages Action string is the selected tab; amounts from that form snapshot (#462).
A7 Zap-out unwraps full wallet cLUNC/cUSTC (old #533 bug) Z533-8 still enforced; no regress of withdraw unwrap loop.
A8 Indexer-only / foreign pair zap Factory-only (Z533-6).
A9 Stale quote / pair switch mid-debounce CTA disabled while stale; collapse unmounts mutation inputs.
A10 Tab and submit share the same accessible name (#201) Distinct names or testids; Playwright strict mode stays green.
A11 How-to innerHTML / third-party URLs Static React; in-app links only (H531-10 / A2).
A12 Nested shell-panel overlay / clickjack manage C653 + check_chrome_nesting.py.
A13 Expert Mode / extreme impact bypass via zap tab Existing impact block stays on zap add.
A14 Gem-bridge zap in production P562 still applies.
A15 Code-id freeze / pause bypass by switching tabs Gates re-evaluate per action; execute still blocked.

Verification criteria

Done when:

  1. A reviewer can open /pool, expand Manage on a factory pair, and use all four actions without an Advanced disclosure or page-level Add/Withdraw cards.
  2. Empty-pool first deposit is obviously Provide Liquidity, not “find Advanced.”
  3. Zap cannot be mistaken for two-sided provide: labels + pre-sign say zap / one-sided.
  4. make verify-issue-531 make verify-issue-533 make verify-issue-547 make verify-issue-559 make verify-issue-653 and the new make verify-issue-660 pass.
  5. make test-frontend (scoped Pool + howto + oneSided copy) is green.
  6. Playwright smoke (5 workers) and at least one LocalTerra two-sided + one zap-add tx path pass.
  7. Docs/skills/glossary no longer teach “two-sided is Advanced” or page-level Add as the only retail LP.

Out of scope: new on-chain Zap message, APR/farm chrome, changing zap split/floors, pair math, wrap fees, catalog rank, Portfolio pair deep-link (nice-to-have).

## Summary `/pool` page-level **Add** / **Withdraw** are **one-sided zap** (#533), but the labels look like ordinary LP. Two-sided **Provide Liquidity** / **Withdraw Liquidity** live only under pair **Manage → Advanced**. Retail users cannot tell which action they are taking and cannot find two-sided provide/withdraw. Ship **one pair-scoped Manage IA**: four peer actions on the expanded row — **Provide Liquidity**, **Withdraw Liquidity**, **1-side zap add**, **1-side zap withdraw**. Do not leave zap as page chrome. Do not hide two-sided behind **Advanced**. Related (do not reopen mechanics): [#533](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/533) (Z533 zap math), [#559](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/559) (Z559 floors), [#531](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/531) (how-to H531-3), [#547](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/547) (table + Manage expand), [#489](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/489) (copy), [#653](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/653) (one chrome layer), [#462](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/462) (pre-sign), [#201](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/201) (tab vs submit name collision). ## Current codebase #533 made **page-level** zap the default retail surface and parked two-sided under **Advanced**. That IA is now the bug. | Surface | Behavior today | |---------|----------------| | **`PoolPage.tsx`** | Above search + table: `OneSidedAddCard` + `OneSidedWithdrawCard` (`md:grid-cols-2`). Headings are **Add** / **Withdraw** (`ONE_SIDED_ADD_TITLE` / `ONE_SIDED_WITHDRAW_TITLE`). Each card has its **own** pair / LP picker — not scoped to a table row. | | **`PoolPairsTable.tsx`** | Sortable catalog table. Row **Manage** toggles `expandedAddr` and mounts **one** `PoolAdvancedManage` (`pool-row-manage-panel`). Default table paint does not `getPool` / `getPairFeeConfig` (**P547-9**). | | **`PoolAdvancedManage.tsx`** | Root is `shell-panel-strong`. Two-sided provide/withdraw tabs live inside `<details data-testid="pool-card-advanced" open>` whose summary is **Advanced** (`ONE_SIDED_ADVANCED_LABEL`). Tabs: **Provide Liquidity** / **Withdraw Liquidity**. Native wrap checkboxes, ratio warning, IL, gas gate, pre-sign stay here. | | **Zap cards** | `OneSidedAddCard`: Token (wallet `> 0`) + Pair (factory) + Amount. `OneSidedWithdrawCard`: LP (wallet LP `> 0`) + Withdraw as + Amount. Quote/submit: `quoteOneSidedAdd` / `oneSidedLiquidityTx` (wrap → pool-only swap → provide, or withdraw → swap → unwrap). Empty pool: `Empty pool. Use Advanced.` (`ONE_SIDED_EMPTY_POOL_ERROR`). | | **How-to / docs** | **H531-3** and `POOL_LP_HOWTO_TWO_SIDED` say retail Add is one-sided and two-sided is **Advanced**. `docs/user-lunc-liquidity.md` and `docs/frontend.md` § Z533 / P547-8 repeat that. Design-system glossary still says “Both tokens required” / wrap checkbox. | | **E2E / units** | Smoke and tx specs assert **page-level** `pool-one-sided-add` / `pool-one-sided-withdraw`. Two-sided paths use `openPoolCardAdvanced` (`e2e/helpers/pool-ui.ts`) which expands Manage **and** the Advanced `<details>`. `PoolPage.test.tsx` U1/U2 assume zap cards exist without opening Manage. | `pool-card-advanced` is `open` by default after Manage expand, so two-sided tabs are not fully collapsed — they are still **labeled and grouped as Advanced**, and the **primary** Add/Withdraw on the page are zap. That is the confusion. ## Why this is needed 1. **Zap is mislabeled as Add/Withdraw.** Users opening `/pool` see Add/Withdraw first. Those flows swap to ratio (and may wrap). They are not two-sided `provide_liquidity` / pro-rata withdraw. Pre-sign and IL exist, but the **page chrome** does not say zap. 2. **Zap is not pair-scoped.** Page cards pick any factory pair. Manage is the pair the user already chose in the table. Zap belongs there so the pair cannot silently differ from the row. 3. **Two-sided is treated as power-user chrome.** Empty-pool first deposit **must** be two-sided (`MINIMUM_LIQUIDITY` / Z533-5). Hiding it under Advanced (and teaching “use Advanced”) makes the only valid first-deposit path look optional. 4. **Four actions are four products.** Two-sided provide, two-sided withdraw, zap-in, and zap-out have different messages, fees, and failure modes. They need **peer** buttons with distinct names — not two page cards plus a nested Advanced disclosure. 5. **#531 / #547 docs cannot stay honest** if the page still leads with unlabeled zap and parks provide/withdraw under Advanced. ## Constraints / guardrails 1. **IA only — do not re-solve zap.** Keep Z533-1–Z533-10 and Z559-1–Z559-4 (ratio split, floors, wrap implied by token, unwrap **only** the zap-out amount, factory-only zap, pool-only hop, submit-aligned quote, 18-dec LP, no new pair/router `Zap` execute). 2. **Four peer actions under Manage** (visible without an Advanced `<details>`): **Provide Liquidity**, **Withdraw Liquidity**, **1-side zap add**, **1-side zap withdraw**. #489: labels ≤ ~5 words. If “1-side zap add” wraps badly at 375px, **Zap Add** / **Zap Withdraw** are acceptable synonyms — the word **zap** (or **one-sided**) must remain so this is not confused with two-sided. 3. **No page-level zap cards.** Remove the `md:grid-cols-2` Add/Withdraw block from `PoolPage`. Search, how-to, outage banners, and the table stay. 4. **Pair is implicit from the expanded row.** Zap add must not expose a second pair picker. Zap withdraw must target **this** pair’s LP (no LP picker that can select another pair’s LP). Off-pair **input tokens** that still route into a pair leg remain allowed (Z533-6). 5. **One action form at a time.** Do not mount all four quote/submit trees on expand. Lazy-mount the selected action so Manage expand stays one LCD `getPool` / fee config (**P547-9**). Never `getPool` on every table row. 6. **Empty pool:** zap add/withdraw disabled with one short sentence that points at **Provide Liquidity** (not “Use Advanced”). First deposit stays two-sided. 7. **Indexer-only / non-factory rows:** zap stays factory-only. Two-sided may remain if the pair contract is reachable; do not advertise zap on Indexer-only marks. 8. **Do not nest chrome.** `PoolAdvancedManage` is already `shell-panel-strong`. Do **not** drop another `shell-panel*` / page-level zap card inside it (**C653-1**). Forms are typography + existing provide `card-glass` wells, not a second panel. 9. **Keep safety gates** on every action: IL (#366), pause, blacklist, code-id freeze (#585), wrap-mapper pause / treasury match, gas envelopes, clickwrap, NFA, Expert Mode impact, pre-sign (#462). Pre-sign **action** text must match the selected button (do not show “Provide Liquidity” on a zap-add submit). 10. **Tab vs submit names (#201).** Expand/tab controls and submit CTAs must stay distinguishable (`first`/`last` or distinct accessible names / testids). Do not reuse `Provide Liquidity` for both a zap tab and a two-sided submit. 11. **Production gems (#562):** do not reintroduce gem-bridge zap on production pickers. 12. **Do not change** pair mint/burn math, fee treasury, wrap-mapper bps, factory whitelist, or catalog rank. 13. **Update copy + playbooks in the same change:** H531-3, `poolLpHowtoCopy.ts`, `oneSidedLiquidityCopy.ts`, `ONE_SIDED_EMPTY_POOL_ERROR`, `docs/frontend.md` (Z533 / P547-8 / P547-9), `docs/user-lunc-liquidity.md`, design-system glossary (stale “Both tokens required”), `AGENTS_FRONTEND_POOL_*` skills. How-to stays opt-in / dismissible (**H531-7**). 14. **E2E helpers** must open **Manage + action tab**, not `pool-card-advanced`. Update `openPoolCardAdvanced` or replace it; do not leave a dead Advanced disclosure for tests to click. 15. **LocalTerra** for on-chain paths. Do not skip with a false “no LocalTerra.” ## Relevant files | File | Role | |------|------| | `frontend-dapp/src/pages/PoolPage.tsx` | Page-level zap grid to remove; table / search / how-to stay | | `frontend-dapp/src/components/pool/PoolPairsTable.tsx` | Manage expand; mount pair manage once | | `frontend-dapp/src/components/pool/PoolAdvancedManage.tsx` | Two-sided today; become pair manage (rename optional) | | `frontend-dapp/src/components/pool/OneSidedAddCard.tsx` | Zap-in form; pair picker must become implicit | | `frontend-dapp/src/components/pool/OneSidedWithdrawCard.tsx` | Zap-out form; LP must pin to this pair | | `frontend-dapp/src/utils/oneSidedLiquidityCopy.ts` | Add / Withdraw / Advanced labels | | `frontend-dapp/src/utils/oneSidedLiquidityQuote.ts` | `Empty pool. Use Advanced.` | | `frontend-dapp/src/utils/poolLpHowtoCopy.ts` | H531-3 “two-sided is Advanced” | | `frontend-dapp/src/pages/PoolPage.test.tsx` | Assumes page-level zap without Manage | | `frontend-dapp/e2e/helpers/pool-ui.ts` | `openPoolCardAdvanced` | | `frontend-dapp/e2e/pool-one-sided-533.spec.ts` / `pool-one-sided-533-tx.spec.ts` | Page-level zap | | `frontend-dapp/e2e/pool-table-547.spec.ts` / `pool-lp-howto-531.spec.ts` / `wrap-pool.spec.ts` / `pool-tx.spec.ts` | Advanced + page zap | | `docs/frontend.md` | Z533, H531-3, P547-8/9 | | `docs/user-lunc-liquidity.md` | Retail backup | | `docs/design-system.md` | Glossary: Pool / Provide / Withdraw | | `skills/AGENTS_FRONTEND_POOL_ONE_SIDED.md` | “two-sided lives under Advanced” | | `skills/AGENTS_FRONTEND_POOL_TABLE.md` | “one-sided cards” on the page | | `skills/AGENTS_FRONTEND_POOL_LP_HOWTO.md` | H531-3 | ## Recommended direction 1. Rename or keep `PoolAdvancedManage` as the **pair manage** panel. Replace the Advanced `<details>` with a **single tab row** of four actions (wrap on narrow). Default selected tab: none, or last-used in-session — do not auto-open a signable form until the user picks an action. 2. Extract zap forms so they accept `pair: PairInfo` (and factory set only for off-pair token routing). Delete page-level pair/LP pickers. 3. Keep existing zap quote/tx helpers; only change mount + labels + empty-pool copy. 4. Keep two-sided provide/withdraw forms as they are (auto-fill #480, wrap checkboxes, ratio warning, donate still possible on off-ratio). 5. Update `make verify-issue-531` / `533` / `547` / `559` expectations and add `make verify-issue-660` for the new IA. Playwright smoke: **5 workers**. Tx: **1 worker**. ## Acceptance criteria - [ ] **M1** `/pool` default paint has **no** page-level Add/Withdraw zap cards (`pool-one-sided-add` / `pool-one-sided-withdraw` are absent until a row Manage is expanded **and** a zap action is selected). - [ ] **M2** Expanding **Manage** on a factory pair shows four peer controls: **Provide Liquidity**, **Withdraw Liquidity**, **1-side zap add**, **1-side zap withdraw** (or Zap Add / Zap Withdraw). None of these require opening **Advanced**. - [ ] **M3** There is **no** `pool-card-advanced` Advanced disclosure wrapping two-sided provide/withdraw. `ONE_SIDED_ADVANCED_LABEL` is unused on `/pool`. - [ ] **M4** Zap add/withdraw operate on the **expanded pair only**. Changing table row / collapsing Manage cannot submit against a different pair. - [ ] **M5** Two-sided provide/withdraw remain fully usable (empty-pool bootstrap, wrap checkboxes, ratio warning, #480 auto-fill / withdraw preview, #147 gas gate, #462 pre-sign). - [ ] **M6** Empty pool: zap actions disabled with one sentence pointing at **Provide Liquidity**. Two-sided provide stays enabled. - [ ] **M7** Indexer-only rows: zap actions disabled or omitted. Two-sided not advertised as zap. - [ ] **M8** How-to + `user-lunc-liquidity.md` + `frontend.md` + design-system glossary + pool skills no longer say “two-sided is Advanced” or “Use Advanced.” They describe Manage → four actions. - [ ] **M9** P547 table invariants hold: catalog default, no N+1 LCD, no header essays, how-to dismissible. - [ ] **M10** C653: no `shell-panel*` inside the manage `shell-panel-strong`. `make verify-issue-653` still passes. - [ ] **M11** Existing zap/two-sided safety gates still fire (pause, blacklist, freeze, mapper pause, stale quote, Expert Mode). - [ ] **M12** `make verify-issue-531`, `533`, `547`, `559` pass after helper/copy updates. New `make verify-issue-660` covers M1–M11. ## Test plan (all paths) | ID | Path | Expect | |----|------|--------| | **T1** | `/pool` disconnected, no Manage | How-to + search + table. No zap cards. No LCD pool queries per row. | | **T2** | Manage expand, no action | Four tabs visible. No signable form until a tab is selected. | | **T3** | Provide Liquidity | Two amount fields, wrap checkboxes, IL, ratio warning, pre-sign **Provide Liquidity**. | | **T4** | Withdraw Liquidity | LP amount, both-asset preview, pre-sign **Withdraw Liquidity**. | | **T5** | 1-side zap add | Token + Amount only (no pair picker). Quote + pre-sign name the zap action. Wrap implied by native token. | | **T6** | 1-side zap withdraw | This pair’s LP + Withdraw as + Amount. No other-pair LP picker. Unwrap only zap-out amount. | | **T7** | Empty pool | Zap add disabled (“…Provide Liquidity”). Two-sided provide works (`MINIMUM_LIQUIDITY`). | | **T8** | Indexer-only row | Zap hidden/disabled. Factory mark still correct. | | **T9** | Switch tabs | Amounts/quotes do not submit on the wrong action. Stale zap quote cannot fire provide. | | **T10** | Collapse / other row | Previous form unmounts. No submit against the old pair. | | **T11** | Search / column sort / page | `expandedAddr` clears (already does). Manage does not stick to the wrong pair. | | **T12** | How-to `#lp-howto` | Steps name Manage + four actions. Forbidden-copy check still empty. | | **T13** | 375px and 1280px | Four tabs wrap; all four reachable; no nested card-in-card. Light + dark. | | **T14** | Portfolio “Manage on Pool” | Still reaches `/pool`. Optional: deep-link a pair later — not required. | | **T15** | Pause / blacklist / freeze / mapper pause | Each selected action disables CTA + existing short error. | | **T16** | Off-pair token → factory pair zap-in | Still quotes or `No route.` Pair remains the Manage row. | | **T17** | Production hide gems | Zap token/pair universe still omits gems (**P562**). | | **T18** | Playwright smoke (5 workers) | Update 531 / 533 / 547 / wrap-pool specs. No `pool-card-advanced` dependency. | | **T19** | LocalTerra tx (1 worker) | One two-sided provide **and** one zap-add still land (existing 533-tx / wrap-pool / pool-tx). | | **T20** | Units | `PoolPage.test.tsx` U1/U2 move to Manage+tab. Copy tests reject leftover “Advanced” pool IA. | ## Test plan (attack, hack, abuse) | ID | Vector | Guard | |----|--------|-------| | **A1** | User signs zap thinking it is 1:1 two-sided provide (half swapped, fee + IL) | Distinct **zap** labels; pre-sign action ≠ **Provide Liquidity**; IL still on zap add. | | **A2** | Off-ratio two-sided donate presented as zap | Two-sided stays its own tab; ratio warning unchanged; zap still refuses off-ratio provide (Z533-4). | | **A3** | Page-level leftover card + Manage form → submit wrong pair | Page cards gone; pair implicit; submit uses expanded row address only. | | **A4** | Mount zap quoters on every row (LCD / indexer DoS) | Forms mount only on expanded row + selected action (**P547-9**). | | **A5** | Hidden Advanced disclosure still used to sneak donate / hide two-sided | Advanced wrapper removed; tests fail if `pool-card-advanced` returns. | | **A6** | Pre-sign phishing: action label does not match messages | Action string is the selected tab; amounts from that form snapshot (#462). | | **A7** | Zap-out unwraps full wallet cLUNC/cUSTC (old #533 bug) | Z533-8 still enforced; no regress of withdraw unwrap loop. | | **A8** | Indexer-only / foreign pair zap | Factory-only (Z533-6). | | **A9** | Stale quote / pair switch mid-debounce | CTA disabled while stale; collapse unmounts mutation inputs. | | **A10** | Tab and submit share the same accessible name (#201) | Distinct names or testids; Playwright strict mode stays green. | | **A11** | How-to `innerHTML` / third-party URLs | Static React; in-app links only (H531-10 / A2). | | **A12** | Nested `shell-panel` overlay / clickjack manage | C653 + `check_chrome_nesting.py`. | | **A13** | Expert Mode / extreme impact bypass via zap tab | Existing impact block stays on zap add. | | **A14** | Gem-bridge zap in production | P562 still applies. | | **A15** | Code-id freeze / pause bypass by switching tabs | Gates re-evaluate per action; execute still blocked. | ## Verification criteria Done when: 1. A reviewer can open `/pool`, expand **Manage** on a factory pair, and use all four actions **without** an Advanced disclosure or page-level Add/Withdraw cards. 2. Empty-pool first deposit is obviously **Provide Liquidity**, not “find Advanced.” 3. Zap cannot be mistaken for two-sided provide: labels + pre-sign say zap / one-sided. 4. `make verify-issue-531` `make verify-issue-533` `make verify-issue-547` `make verify-issue-559` `make verify-issue-653` and the new `make verify-issue-660` pass. 5. `make test-frontend` (scoped Pool + howto + oneSided copy) is green. 6. Playwright smoke (5 workers) and at least one LocalTerra two-sided + one zap-add tx path pass. 7. Docs/skills/glossary no longer teach “two-sided is Advanced” or page-level Add as the only retail LP. **Out of scope:** new on-chain Zap message, APR/farm chrome, changing zap split/floors, pair math, wrap fees, catalog rank, Portfolio pair deep-link (nice-to-have).
PlasticDigits commented 2026-08-26 04:11:19 +00:00 (Migrated from gitlab.com)

marked as related to #533

marked as related to #533
PlasticDigits commented 2026-08-26 04:11:21 +00:00 (Migrated from gitlab.com)

marked as related to #531

marked as related to #531
PlasticDigits commented 2026-08-26 04:11:21 +00:00 (Migrated from gitlab.com)

marked as related to #547

marked as related to #547
PlasticDigits commented 2026-08-26 04:11:22 +00:00 (Migrated from gitlab.com)

marked as related to #559

marked as related to #559
PlasticDigits commented 2026-08-26 04:11:23 +00:00 (Migrated from gitlab.com)

marked as related to #489

marked as related to #489
PlasticDigits commented 2026-08-26 04:11:24 +00:00 (Migrated from gitlab.com)

marked as related to #653

marked as related to #653
PlasticDigits commented 2026-08-26 04:11:44 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-08-26 04:12:19 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-08-26 07:41:23 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1175

mentioned in merge request !1175
PlasticDigits commented 2026-08-26 07:50:56 +00:00 (Migrated from gitlab.com)

mentioned in commit 4608b451e5

mentioned in commit 4608b451e533e5c88a6f47d7f2ee7d718e1c9acf
PlasticDigits commented 2026-08-26 07:51:21 +00:00 (Migrated from gitlab.com)

Implementation is in !1175.

Acceptance (M1–M12) — done in this change:

  • M1 No page-level zap cards until Manage + zap tab
  • M2 Four peer tabs (Provide / Withdraw / Zap Add / Zap Withdraw); no Advanced
  • M3 No pool-card-advanced; ONE_SIDED_ADVANCED_LABEL unused
  • M4 Zap pinned to expanded pair (no pair/LP picker)
  • M5 Two-sided provide/withdraw still usable (forms, wrap, IL, pre-sign); LocalTerra provide tx green
  • M6 Empty pool: zap disabled; Empty pool. Use Provide Liquidity.
  • M7 Indexer-only rows omit zap tabs
  • M8 How-to, user guide, frontend.md, glossary, skills no longer teach Advanced
  • M9 P547 table invariants (catalog, no N+1 LCD, how-to dismissible)
  • M10 C653: zap forms are card-glass wells; make verify-issue-653 passed
  • M11 Existing safety gates left in place (pause, freeze, blacklist, IL, gas, pre-sign)
  • M12 make verify-issue-531 / 533 / 547 / 559 / 653 / 660

Test plan

  • T1–T6, T13 Playwright smoke
  • T7–T11, T20 units (PoolPage.test.tsx)
  • T12 how-to copy
  • T18 helper + spec updates (no pool-card-advanced click)
  • T19 LocalTerra two-sided provide + P4 zap-add

Not in this MR (issue out of scope or optional):

  • T14 Portfolio “Manage on Pool” still reaches /pool; pair deep-link not added
  • T15–T17 pause/blacklist/freeze/mapper, off-pair zap-in, production gem hide — existing gates, not re-proven with new dedicated specs
  • T13 light+dark phone tabs covered; explicit dark-theme screenshot not added
  • Zap math/floors, APR/farm, catalog rank — out of scope
Implementation is in !1175. **Acceptance (M1–M12)** — done in this change: - [x] **M1** No page-level zap cards until Manage + zap tab - [x] **M2** Four peer tabs (Provide / Withdraw / Zap Add / Zap Withdraw); no Advanced - [x] **M3** No `pool-card-advanced`; `ONE_SIDED_ADVANCED_LABEL` unused - [x] **M4** Zap pinned to expanded pair (no pair/LP picker) - [x] **M5** Two-sided provide/withdraw still usable (forms, wrap, IL, pre-sign); LocalTerra provide tx green - [x] **M6** Empty pool: zap disabled; `Empty pool. Use Provide Liquidity.` - [x] **M7** Indexer-only rows omit zap tabs - [x] **M8** How-to, user guide, frontend.md, glossary, skills no longer teach Advanced - [x] **M9** P547 table invariants (catalog, no N+1 LCD, how-to dismissible) - [x] **M10** C653: zap forms are `card-glass` wells; `make verify-issue-653` passed - [x] **M11** Existing safety gates left in place (pause, freeze, blacklist, IL, gas, pre-sign) - [x] **M12** `make verify-issue-531` / `533` / `547` / `559` / `653` / `660` **Test plan** - [x] T1–T6, T13 Playwright smoke - [x] T7–T11, T20 units (`PoolPage.test.tsx`) - [x] T12 how-to copy - [x] T18 helper + spec updates (no `pool-card-advanced` click) - [x] T19 LocalTerra two-sided provide + P4 zap-add Not in this MR (issue out of scope or optional): - **T14** Portfolio “Manage on Pool” still reaches `/pool`; pair deep-link not added - **T15–T17** pause/blacklist/freeze/mapper, off-pair zap-in, production gem hide — existing gates, not re-proven with new dedicated specs - **T13 light+dark** phone tabs covered; explicit dark-theme screenshot not added - Zap math/floors, APR/farm, catalog rank — out of scope
PlasticDigits commented 2026-08-26 09:19:28 +00:00 (Migrated from gitlab.com)

mentioned in commit 29ed0bdad3

mentioned in commit 29ed0bdad36cf9cb8120b54d658cc0c511600f27
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-08-26 09:19:31 +00:00
PlasticDigits commented 2026-08-26 09:30:56 +00:00 (Migrated from gitlab.com)

mentioned in issue #661

mentioned in issue #661
PlasticDigits commented 2026-08-26 09:31:08 +00:00 (Migrated from gitlab.com)

Merged to main via !1175 after resolving onto current main. Four peer Manage tabs kept; #661 name/symbol + wrap default re-applied on Provide. E2E helpers must not extra-click Provide (that toggles the tab closed).

Leftover: /pool Manage four tabs, no page-level zap cards, no Advanced disclosure. make verify-issue-660 (Playwright when LocalTerra is up).

Merged to `main` via !1175 after resolving onto current `main`. Four peer Manage tabs kept; #661 name/symbol + wrap default re-applied on Provide. E2E helpers must not extra-click Provide (that toggles the tab closed). Leftover: `/pool` Manage four tabs, no page-level zap cards, no Advanced disclosure. `make verify-issue-660` (Playwright when LocalTerra is up).
PlasticDigits commented 2026-08-26 09:31:36 +00:00 (Migrated from gitlab.com)

mentioned in issue #673

mentioned in issue #673
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#660
No description provided.