Skip to content

feat(frontend): pricing plans: Free, Premium (coming soon) and Pay as you go - #48

Open
Aspirant200715 wants to merge 6 commits into
mergit-io:mainfrom
Aspirant200715:feat/pricing-page
Open

Aspirant200715 wants to merge 6 commits into
mergit-io:mainfrom
Aspirant200715:feat/pricing-page

Conversation

@Aspirant200715

Copy link
Copy Markdown
Collaborator

Replaces the two-card plan choice with three plans and adds a public /pricing page with a comparison table.

What changed

  • PlanCards and src/pricing/plans.ts: one source for the plan-choice dialog and the pricing page.
  • FundingChoice keeps its behaviour (Start free -> startTrial, Connect a wallet -> picker and merge prompt, Look around first); only the cards changed, plus a Compare plans link.
  • /pricing: cards and a comparison table. Free goes to sign in (or the dashboard when signed in), Pay as you go opens wallet connect.
  • Premium is visible but disabled, with no price, until credit packs exist.
  • Figures are the gateway defaults (5 USDC grant, 2 USDC per plan, 3 plans a day) and the page says they can change.

What I verified

  • tsc, eslint, prettier clean; vitest 229 passed.
  • Full Playwright suite, mock and live: 202 passed.
  • Screenshots of the dialog and page in light and dark, and the dialog at 390px.

Not verified

  • The /pricing page at phone width.
  • Starting a trial from the pricing page itself; the e2e only checks it leads to the dashboard, where the existing dialog does that.
  • One live test (account.spec.ts:50) failed once under load and passed on rerun.

… you go

- shared plan data and cards for the choose-your-plan dialog and a new /pricing page
- comparison table across funding, limits, verification, settlement and service
- Free and Pay as you go keep their existing wiring (startTrial, wallet connect)
- Premium is shown but disabled, with no price, until credit packs exist
It held a local path (/home/aspirant/Projects/mergit/frontend/node_modules)
instead of a real node_modules tree.

@OfficialAbhinavSingh OfficialAbhinavSingh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged with main locally, full suite green (224 passed, 0 unexpected).

checked /pricing by eye in light, dark and at 375px wide: no horizontal overflow, plan cards and the comparison table both render fine, Premium reads "Coming soon" consistently in the cards and the table.

one thing fixed and pushed to this branch (8fb5bc2): frontend/node_modules was accidentally committed as a tracked file holding a local path (/home/aspirant/Projects/mergit/frontend/node_modules) instead of a real tree. removed.

@Viscous106 Viscous106 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing the frontend/node_modules symlink. Re-checking the current diff against my earlier review: the CI check is still red, and most of the content findings are untouched. I read the diff only. I did apply it to a copy of main's frontend/ and run prettier, tsc -b, eslint, vite build and the whole vitest suite, and all passed, so the failure is probably the Playwright e2e step (most likely e2e/pricing.spec.ts, or the FundingChoice dialog change breaking an existing live spec). I couldn't run Playwright or see the job log, so please check which test fails.

Not fixed, please address before merge

  1. Reputation claim (plans.ts:69, plans.ts:455-458): "Work counts toward an agent's reputation once validated" and the "Counts toward an agent's reputation" row still read as live behaviour. The app says reputation isn't computed and redirects the live leaderboard. Soften it or mark it as coming soon.
  2. Premium shows YES for features that don't exist (plans.ts:464-473, "Everything in Free" at :396): escrow, release after verification, on-chain receipt, dispute window, all agents. plans.test.ts:327-335 exempts "shared" rows, so the test enforces nothing. Use SOON in those cells.
  3. Hardcoded limits: "5 USDC", "2 USDC" and "3" appear in plans.ts:377,382,435,442,443, FundingChoice.tsx:98 and Pricing.tsx:540,631,634. The gateway reads them from env (FREE_CREDITS_USDC_UNITS, the plan cap, CREDIT_PLANS_PER_DAY), and the comment at plans.ts:346 admits it. plans.test.ts:313 locks "5 USDC" in. Read them from config or label them as defaults. The Free card also says "no wallet and no cost" (plans.ts:378) while stating limits that env can change; the footer hedges this and the cards don't.
  4. Accessibility:
    • PlanCards.tsx:266: the cards are h3 directly under the h1, and the first h2 ("Compare plans", Pricing.tsx:584) comes after them.
    • Pricing.tsx:587: the scrolling table wrapper has no tabindex, role="region" or label, so keyboard users can't scroll it.
    • Pricing.tsx:605: th scope="colgroup" with no <colgroup>. Use scope="rowgroup" or a caption.
    • auth.css:718-726: white 11px text on the mint-to-azure ribbon is about 3.4:1 against #0e9f74, under AA for small text. The amber .plan-soon badge and the mint ticks (pricing.css:1031-1032) are worth measuring too.
  5. CSS: the featured column is hardcoded as nth-child(4) (pricing.css:1043-1044). The 6px hover lift is clipped by .plan-dialog { overflow-y: auto } (auth.css:662-665). .plan-soon is declared twice (auth.css:728 and :755).
  6. Tests: plans.test.ts only asserts data shape, and the signed-in e2e (pricing.spec.ts:44-47) is titled "plan choice starts the trial" but only checks an href. Nothing tests the Pay as you go button or FundingChoice.

Nits: .gitignore still has node_modules/ with a trailing slash, which doesn't match a symlink. Use node_modules. PlanCards.tsx imports from "react" twice and re-exports PlanId without using it. The reduced-motion rules are split between pricing.css and auth.css.

Not verified: which e2e step fails, the live-mode e2e specs against the new dialog, contrast ratios beyond the ribbon, and whether the base is current with main.

Viscous106 and others added 3 commits November 3, 2026 09:55
…in test_caddy_hardening

- 'Plans' also matched 'Compare plans' (strict-mode violation), failing test:e2e
- ruff E501 on test_caddy_hardening.py:113 failed the control-plane check
@Aspirant200715

Copy link
Copy Markdown
Collaborator Author

CI on this branch was red for two small reasons: the e2e looked up the h2 "Plans" by substring and also matched "Compare plans" (now exact: true), and test_caddy_hardening.py:113 was over the ruff line limit. Fixed both; the full e2e suite passes locally. One question for Yash: the "reputation is not scored yet" wording in the table looks stale now that reputation.py computes it from validated wallet-funded work. Is "coming soon" deliberate?

A rework of this page reintroduced the stale per-plan cap this PR had already
fixed: PLAN_CAP_USDC went back to a literal 2, with a comment claiming
CREDIT_PLAN_CAP_USDC_UNITS defaults to 2000000. It does not —
chain/gateway/src/main.rs still defaults it to FREE_CREDITS_USDC_UNITS itself
(the grant), with its own comment naming the 2-under-5 mismatch as a past bug.
No deploy file sets it to 2000000 either.

PLAN_CAP_USDC is now derived from FREE_CREDITS_USDC directly, so the two
cannot drift apart silently again, and a regression test (removed in the
same rework) is back, extended to also check the derivation.

Full suite green: 292 vitest, 233 Playwright passed (the one Playwright
failure, the flows story, is the pre-existing flaky-under-load test; it
passes alone).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants