From 91638ef8469a5ac19df83263419ba8408b428de3 Mon Sep 17 00:00:00 2001 From: Clarence Lee <35331421+cljiahao@users.noreply.github.com> Date: Wed, 2 Dec 2026 02:16:09 +0800 Subject: [PATCH 1/4] feat(dashboard): bookings on shared merqo-ui (#322) * feat(dashboard): bookings on shared merqo-ui Co-Authored-By: Claude Sonnet 5.5 * docs(bookings): note shared merqo-ui components in READMEs Co-Authored-By: Claude Sonnet 5.5 --------- Co-authored-by: Claude Sonnet 5.5 --- CHANGELOG.md | 6 + README.md | 2 + src/app/dashboard/bookings/README.md | 2 + src/app/dashboard/bookings/[id]/README.md | 2 + src/app/dashboard/bookings/[id]/page.tsx | 128 +++++++++--------- .../bookings/[id]/transaction-status-card.tsx | 6 +- .../bookings/inquiries/[id]/README.md | 2 + .../bookings/inquiries/[id]/page.tsx | 11 +- src/app/dashboard/bookings/inquiry-table.tsx | 14 +- src/app/dashboard/bookings/page.dom.test.tsx | 3 + src/app/dashboard/bookings/page.tsx | 54 +++----- 11 files changed, 126 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efa169d..522b515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Bookings, inquiries and their detail pages now use the shared Merqo section, card and empty-state components. + ## [0.11.3] - 2026-12-02 ### Changed diff --git a/README.md b/README.md index 7feed5c..b0782e3 100644 --- a/README.md +++ b/README.md @@ -407,3 +407,5 @@ A deep link into the vendor dashboard survives the login and legal gates: every The `/admin/activity` paging links and boundaries are pinned by `src/app/admin/activity/activity-paging.dom.test.tsx` (listed in `CHANGELOG.md`). The landing phone mockups use rem font sizes, so the dashboard text-size adjuster scales them like the rest of the page. + +The bookings list, inquiries and their detail pages use the shared `@merqo/ui` `Section`, `ElevatedCard` and `EmptyState` (see `CHANGELOG.md`). diff --git a/src/app/dashboard/bookings/README.md b/src/app/dashboard/bookings/README.md index f00c728..39d7b72 100644 --- a/src/app/dashboard/bookings/README.md +++ b/src/app/dashboard/bookings/README.md @@ -111,3 +111,5 @@ Money and times here come from `@merqo/ui` (`Money`, `formatMoney`, `Timestamp`, Signed-out and stale-terms vendors come back here after sign-in or terms acceptance: the page passes its own path and query to `getVendorSession` as `returnTo`. The new-inquiry and balance-due-soon badges use the `warning` tone instead of palette amber. + +The list sections ("Inquiries" and "Your bookings") are `@merqo/ui` `Section`s, and the empty inquiry list uses its `EmptyState`. The phone-only card list and the GET filter form stay local: there is no shared equivalent. diff --git a/src/app/dashboard/bookings/[id]/README.md b/src/app/dashboard/bookings/[id]/README.md index 2a1c33f..005b1ef 100644 --- a/src/app/dashboard/bookings/[id]/README.md +++ b/src/app/dashboard/bookings/[id]/README.md @@ -66,3 +66,5 @@ Money and times here come from `@merqo/ui` (`Money`, `formatMoney`, `Timestamp`, Signed-out and stale-terms vendors come back here after sign-in or terms acceptance: the page passes its own path and query to `getVendorSession` as `returnTo`. The cancel and reschedule dialogs show their inline error through the shared `FormError`. + +The Customer, Amounts and Booking ID blocks are `@merqo/ui` `ElevatedCard`s with a `Section` each, and `transaction-status-card.tsx` is an `ElevatedCard` too. diff --git a/src/app/dashboard/bookings/[id]/page.tsx b/src/app/dashboard/bookings/[id]/page.tsx index 9497ab4..c837bba 100644 --- a/src/app/dashboard/bookings/[id]/page.tsx +++ b/src/app/dashboard/bookings/[id]/page.tsx @@ -3,13 +3,20 @@ import { BookingIdCopy } from "./booking-id-copy"; import { checkoutKind } from "@/lib/checkout-kind"; import { RecoverDepositButton } from "./recover-deposit-button"; import { notFound } from "next/navigation"; -import { Money, Timestamp, formatDate, qrSvg } from "@merqo/ui"; +import { + ElevatedCard, + Money, + PageHeader, + Section, + Timestamp, + formatDate, + qrSvg, +} from "@merqo/ui"; import { getVendorSession } from "@/lib/vendor-session"; import { getBooking } from "@/lib/bookings"; import { getTransaction } from "@/lib/transactions"; import { getInquiryForBooking } from "@/lib/inquiry-inbox"; import { readVendorPlan } from "@/lib/vendor-entitlement"; -import { PageHeader } from "@merqo/ui"; import { BookingStatusBadge, BalanceDueIndicator } from "../booking-badges"; import { TermsSnapshot } from "../inquiry-badges"; import { CustomerPhone } from "../customer-phone"; @@ -76,68 +83,65 @@ export default async function BookingDetailPage({ } /> -
-

- Customer -

-
-
Phone
-
- -
- {inquiry && ( - <> -
Booking terms
-
- -
- - )} -
-
+ +
+
+
Phone
+
+ +
+ {inquiry && ( + <> +
Booking terms
+
+ +
+ + )} +
+
+
-
-

- Amounts -

-
-
Total
-
- -
-
Deposit
-
- -
-
Balance
-
- -
-
Balance due
-
- -
-
-
+ +
+
+
Total
+
+ +
+
Deposit
+
+ +
+
Balance
+
+ +
+
Balance due
+
+ +
+
+
+
-
-

- Booking ID -

-
- - {booking.id} - - -
-

- Paste this into your qkit event’s payment settings to show this - booking’s live deposit and balance status there. -

-
+ +
+
+ + {booking.id} + + +
+

+ Paste this into your qkit event’s payment settings to show + this booking’s live deposit and balance status there. +

+
+
+

{label}

@@ -53,7 +53,7 @@ export function TransactionStatusCard({ /> )} -
+ ); } diff --git a/src/app/dashboard/bookings/inquiries/[id]/README.md b/src/app/dashboard/bookings/inquiries/[id]/README.md index 8b16ed8..60b7364 100644 --- a/src/app/dashboard/bookings/inquiries/[id]/README.md +++ b/src/app/dashboard/bookings/inquiries/[id]/README.md @@ -37,3 +37,5 @@ Buttons, inputs, dialogs, badges and the other shared primitives here are import "Received" and the terms-accepted time render through `@merqo/ui` `formatDateTime` ("7 Nov 2026, 1:30 am", Singapore time). The page passes its own path to `getVendorSession` as `returnTo`, so login and the legal gate bring the vendor back to this inquiry. + +The details panel is an `@merqo/ui` `ElevatedCard`. diff --git a/src/app/dashboard/bookings/inquiries/[id]/page.tsx b/src/app/dashboard/bookings/inquiries/[id]/page.tsx index 7a6aeeb..ba8378e 100644 --- a/src/app/dashboard/bookings/inquiries/[id]/page.tsx +++ b/src/app/dashboard/bookings/inquiries/[id]/page.tsx @@ -3,7 +3,12 @@ import Link from "next/link"; import { notFound } from "next/navigation"; import { getVendorSession } from "@/lib/vendor-session"; import { getInquiry } from "@/lib/inquiry-inbox"; -import { PageHeader, formatDate, formatDateTime } from "@merqo/ui"; +import { + ElevatedCard, + PageHeader, + formatDate, + formatDateTime, +} from "@merqo/ui"; import { CustomerPhone } from "../../customer-phone"; import { InquiryStatusBadge, TermsSnapshot } from "../../inquiry-badges"; import { NewBookingDialog } from "../../new-booking-dialog"; @@ -37,7 +42,7 @@ export default async function InquiryDetailPage({ action={} /> -
+
Phone
@@ -53,7 +58,7 @@ export default async function InquiryDetailPage({

{inquiry.message}

-
+
{inquiry.booking_id ? ( diff --git a/src/app/dashboard/bookings/inquiry-table.tsx b/src/app/dashboard/bookings/inquiry-table.tsx index 5bdab4f..e776672 100644 --- a/src/app/dashboard/bookings/inquiry-table.tsx +++ b/src/app/dashboard/bookings/inquiry-table.tsx @@ -1,7 +1,12 @@ "use client"; import Link from "next/link"; -import { DataTable, Timestamp, type DataTableColumn } from "@merqo/ui"; +import { + DataTable, + EmptyState, + Timestamp, + type DataTableColumn, +} from "@merqo/ui"; import { PhoneList, PhoneRow } from "@/components/list/phone-row"; import { InquiryStatusBadge } from "./inquiry-badges"; import type { Inquiry } from "@/lib/types"; @@ -39,7 +44,12 @@ const columns: DataTableColumn[] = [ export function InquiryTable({ inquiries }: { inquiries: Inquiry[] }) { if (inquiries.length === 0) { - return

No open inquiries.

; + return ( + + ); } return ( <> diff --git a/src/app/dashboard/bookings/page.dom.test.tsx b/src/app/dashboard/bookings/page.dom.test.tsx index 61b784d..3ee5689 100644 --- a/src/app/dashboard/bookings/page.dom.test.tsx +++ b/src/app/dashboard/bookings/page.dom.test.tsx @@ -125,6 +125,9 @@ describe("BookingsPage", () => { screen.getByRole("button", { name: "Inquiry form" }), ).toBeInTheDocument(); expect(screen.getByText("No open inquiries.")).toBeInTheDocument(); + expect( + screen.getByText("New requests from your inquiry form appear here."), + ).toBeInTheDocument(); }); it("shows the empty state with no bookings", async () => { diff --git a/src/app/dashboard/bookings/page.tsx b/src/app/dashboard/bookings/page.tsx index 2941255..3eb4c26 100644 --- a/src/app/dashboard/bookings/page.tsx +++ b/src/app/dashboard/bookings/page.tsx @@ -1,5 +1,6 @@ import type { Metadata } from "next"; import { redirect } from "next/navigation"; +import { Section } from "@merqo/ui"; import { PageShell } from "@/components/page-shell"; import { getVendorSession } from "@/lib/vendor-session"; import { pathWithSearch } from "@/lib/return-to"; @@ -51,50 +52,35 @@ export default async function BookingsPage({ description="Deposit now, balance later, for events booked ahead." action={} > -
-
-

- Inquiries{" "} - - ({inquiries.length}) - -

+
+
-
- -
-
+ +
-
-

- Your bookings{" "} - - {result.ok ? `(${total})` : ""} - -

-
- -
-
- {result.ok ? ( - - ) : ( - - )} -
+
+ + {result.ok ? ( + + ) : ( + + )} {result.ok && ( bookingListHref({ ...params, page: next })} /> )} -
+
); } From ad0536e0ca1a48593755be97f4fb1db93c9ddc95 Mon Sep 17 00:00:00 2001 From: Clarence Lee <35331421+cljiahao@users.noreply.github.com> Date: Wed, 2 Dec 2026 02:35:19 +0800 Subject: [PATCH 2/4] feat(dashboard): transactions, config, plan, profile and admin on shared merqo-ui (#324) Co-authored-by: Claude Sonnet 5.5 --- CHANGELOG.md | 1 + README.md | 2 + src/app/admin/README.md | 6 +- src/app/admin/activity/README.md | 2 + src/app/admin/activity/activity-section.tsx | 2 +- src/app/admin/page.tsx | 118 ++++-------------- src/app/admin/recent-activity-table.tsx | 91 ++++++++++++++ src/app/admin/vendors/README.md | 2 + src/app/admin/vendors/vendors-table.tsx | 3 +- src/app/dashboard/README.md | 1 - src/app/dashboard/config/README.md | 2 + .../dashboard/config/payment-config-form.tsx | 6 +- src/app/dashboard/plan/README.md | 2 + src/app/dashboard/plan/page.tsx | 18 +-- src/app/dashboard/transactions/README.md | 4 +- .../transaction-table.dom.test.tsx | 83 +++--------- .../transactions/transaction-table.tsx | 50 ++------ 17 files changed, 177 insertions(+), 216 deletions(-) create mode 100644 src/app/admin/recent-activity-table.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 522b515..1d4d649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed +- Payments, Plan, payment setup and the admin overview, vendors and activity pages now use more of the shared `@merqo/ui` components (stat tiles, sections, cards, data tables). Payments shows one table at every width, with the Kit and Created columns hidden on phones. Behaviour, plan limits and copy are unchanged. - Bookings, inquiries and their detail pages now use the shared Merqo section, card and empty-state components. ## [0.11.3] - 2026-12-02 diff --git a/README.md b/README.md index b0782e3..2bc961e 100644 --- a/README.md +++ b/README.md @@ -409,3 +409,5 @@ The `/admin/activity` paging links and boundaries are pinned by `src/app/admin/a The landing phone mockups use rem font sizes, so the dashboard text-size adjuster scales them like the rest of the page. The bookings list, inquiries and their detail pages use the shared `@merqo/ui` `Section`, `ElevatedCard` and `EmptyState` (see `CHANGELOG.md`). + +The payments table, payment setup, plan and admin pages use more shared `@merqo/ui` components (stat tiles, sections, cards, data tables); see `CHANGELOG.md`. diff --git a/src/app/admin/README.md b/src/app/admin/README.md index 7857d65..d81b0a8 100644 --- a/src/app/admin/README.md +++ b/src/app/admin/README.md @@ -35,8 +35,10 @@ figure-tile helper used by the overview and vendors screens. `securityStats()` in `@/lib/admin-data`), a recent cross-vendor activity feed (rows link to `/admin/vendors?q=`, or `EmptyState` when empty). Page titles use the shared `PageHeader`; statuses read Awaiting payment / Marked paid / Received. -- Overview figures use `@merqo/ui`'s shared `StatCard` (label/value plus optional - `caption` and a period-over-period `delta`/`deltaTooltip` pill, `deltaSize="xs"`). +- Overview figures use `@merqo/ui`'s `StatTile` with `card` (label/value plus optional + `caption` and a period-over-period `delta`/`deltaTooltip` pill). The recent-activity feed is + `recent-activity-table.tsx`, a `DataTable` in a Client Component whose vendor cell links to + `/admin/vendors?q=`; Kit and When hide on phones. - `vendors/` ## Connectivity diff --git a/src/app/admin/activity/README.md b/src/app/admin/activity/README.md index f0d9221..0cd15d5 100644 --- a/src/app/admin/activity/README.md +++ b/src/app/admin/activity/README.md @@ -36,3 +36,5 @@ The action select uses `FILTER_SELECT_CLASS` (with a `sm:w-56` override); paging Timestamps display through `Timestamp` (or `formatDate`/`formatDateTime`) from `@merqo/ui`, always in Asia/Singapore so server and client render identically (no hydration mismatch). Paging for this page is covered by `activity-paging.dom.test.tsx` (boundary links, second-page rows, filters kept in links, past-the-end redirect) alongside `activity-page.dom.test.tsx`. + +The Target link is a 44px tap target (`inline-flex min-h-11 items-center`). diff --git a/src/app/admin/activity/activity-section.tsx b/src/app/admin/activity/activity-section.tsx index adc81b5..7da995c 100644 --- a/src/app/admin/activity/activity-section.tsx +++ b/src/app/admin/activity/activity-section.tsx @@ -40,7 +40,7 @@ const columns: DataTableColumn[] = [ e.target ? ( {e.target} diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 36fdd07..0d48fb0 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,24 +1,13 @@ import type { Metadata } from "next"; -import Link from "next/link"; import { requireAdmin } from "@/lib/admin"; import { platformTotals, recentActivity, securityStats, } from "@/lib/admin-data"; -import { Badge } from "@merqo/ui/primitives"; - -import { - EmptyState, - Money, - PageHeader, - StatCard, - Timestamp, - formatMoney, -} from "@merqo/ui"; -import type { TxStatus } from "@/lib/types"; -import { listHref } from "@/app/admin/list-params"; +import { PageHeader, Section, StatTile, formatMoney } from "@merqo/ui"; import { pctChange } from "@/lib/utils"; +import { RecentActivityTable } from "./recent-activity-table"; export const metadata: Metadata = { title: "Admin overview", @@ -26,13 +15,6 @@ export const metadata: Metadata = { export const revalidate = 0; -// API status values are unchanged; only the displayed wording differs. -const STATUS_LABELS: Record = { - pending: "Awaiting payment", - claimed: "Marked paid", - confirmed: "Received", -}; - export default async function AdminOverviewPage() { await requireAdmin(); @@ -47,35 +29,22 @@ export default async function AdminOverviewPage() {
- - - - + + + - - -
-
-

Security

+
- -
-
+
-
-

- Recent activity across all vendors -

- {activity.length > 0 ? ( -
    - {activity.map((tx) => ( -
  • - - - - {tx.email ?? "Not set"} - - - {tx.kit_slug} - - - {STATUS_LABELS[tx.status]} - - - - - - - -
  • - ))} -
- ) : ( - - )} -
+
+ +
); } diff --git a/src/app/admin/recent-activity-table.tsx b/src/app/admin/recent-activity-table.tsx new file mode 100644 index 0000000..cff5cac --- /dev/null +++ b/src/app/admin/recent-activity-table.tsx @@ -0,0 +1,91 @@ +"use client"; + +import Link from "next/link"; +import { + DataTable, + EmptyState, + Money, + Timestamp, + type DataTableColumn, +} from "@merqo/ui"; +import { Badge } from "@merqo/ui/primitives"; +import type { TxStatus } from "@/lib/types"; +import { listHref } from "@/app/admin/list-params"; + +export type RecentActivityRow = { + id: string; + vendor_id: string; + email: string | null; + kit_slug: string; + amount_cents: number; + status: TxStatus; + created_at: string; +}; + +// API status values are unchanged; only the displayed wording differs. +const STATUS_LABELS: Record = { + pending: "Awaiting payment", + claimed: "Marked paid", + confirmed: "Received", +}; + +// `columns` holds `cell` render callbacks, so `DataTable` has to be rendered +// from a Client Component rather than the server page. +const columns: DataTableColumn[] = [ + { + header: "Vendor", + cell: (tx) => ( + + {tx.email ?? "Not set"} + + ), + }, + { + header: "Kit", + className: "hidden sm:table-cell", + cell: (tx) => tx.kit_slug, + }, + { + header: "Status", + cell: (tx) => ( + + {STATUS_LABELS[tx.status]} + + ), + }, + { + header: "Amount", + align: "end", + cell: (tx) => , + }, + { + header: "When", + className: "hidden sm:table-cell", + cell: (tx) => ( + + ), + }, +]; + +export function RecentActivityTable({ rows }: { rows: RecentActivityRow[] }) { + return ( + tx.id} + emptyState={ + + } + /> + ); +} diff --git a/src/app/admin/vendors/README.md b/src/app/admin/vendors/README.md index 76da4f4..300e2d4 100644 --- a/src/app/admin/vendors/README.md +++ b/src/app/admin/vendors/README.md @@ -40,3 +40,5 @@ Buttons, inputs, dialogs, badges and the other shared primitives here are import Paging and the failed-read card are the shared `UrlPager` and `ListError` from `@/components/list/`. Timestamps display through `Timestamp` (or `formatDate`/`formatDateTime`) from `@merqo/ui`, always in Asia/Singapore so server and client render identically (no hydration mismatch). + +The Transactions column is end-aligned through the column `align` option. diff --git a/src/app/admin/vendors/vendors-table.tsx b/src/app/admin/vendors/vendors-table.tsx index 74b3c90..b04ea11 100644 --- a/src/app/admin/vendors/vendors-table.tsx +++ b/src/app/admin/vendors/vendors-table.tsx @@ -40,7 +40,8 @@ const columns: DataTableColumn[] = [ { header: "Transactions", cell: (v) => v.transaction_count, - className: "text-right tabular-nums", + align: "end", + className: "tabular-nums", }, { header: "Joined", diff --git a/src/app/dashboard/README.md b/src/app/dashboard/README.md index 6afacf4..24f126b 100644 --- a/src/app/dashboard/README.md +++ b/src/app/dashboard/README.md @@ -105,5 +105,4 @@ Gotchas: - `DataTable` has no row-level link, so make one cell's link a 44px target (`inline-flex min-h-11 items-center`) and hide low-value columns on phones with a column `className` of `hidden sm:table-cell`. - `SegmentedControl` link mode needs `LinkComponent={Link}` (from `next/link`) for client-side navigation, and `selected` on the active option sets `aria-current="page"`. - `ElevatedCard` has no padding of its own; add `p-6` (or similar) on the card. -- `src/app/admin/page.tsx` still uses the deprecated `StatCard`; move it to `StatTile card` in slice 4. - `@merqo/ui` has no bottom tab bar, More sheet or side rail export. Its `DashboardNav` only offers `mobileNav="menu" | "none"` (a burger menu), so the phone tab bar and desktop rail stay local in `src/components/nav`. diff --git a/src/app/dashboard/config/README.md b/src/app/dashboard/config/README.md index d723bfb..0a72839 100644 --- a/src/app/dashboard/config/README.md +++ b/src/app/dashboard/config/README.md @@ -112,3 +112,5 @@ Buttons, inputs, dialogs, badges and the other shared primitives here are import Inline save errors on the payment form use the shared `FormError`. The Stripe and HitPay link warnings in `pointer-presets.ts` contain no em dash. The amber warning on a pointer URL uses the `warning` tone (`--warning` in `globals.css`), not a palette colour. + +The sample QR preview sits in a shared `ElevatedCard`. diff --git a/src/app/dashboard/config/payment-config-form.tsx b/src/app/dashboard/config/payment-config-form.tsx index c4ed8dc..386c5ec 100644 --- a/src/app/dashboard/config/payment-config-form.tsx +++ b/src/app/dashboard/config/payment-config-form.tsx @@ -24,7 +24,7 @@ import { removeUnsavedImages, uploadPaykitImage, } from "@/lib/image-upload-adapter"; -import { FormError, resizeToWebp } from "@merqo/ui"; +import { ElevatedCard, FormError, resizeToWebp } from "@merqo/ui"; import { buildPayNowPayload } from "@/lib/payments/paynow"; import { isHttpUrl } from "@/lib/schemas"; import { saveConfigAction, type SaveConfigState } from "./actions"; @@ -186,12 +186,12 @@ function PayNowFields({ )} {previewPayload && ( -
+

Preview ($1.00 sample QR)

-
+ )} ); diff --git a/src/app/dashboard/plan/README.md b/src/app/dashboard/plan/README.md index 1881025..749549f 100644 --- a/src/app/dashboard/plan/README.md +++ b/src/app/dashboard/plan/README.md @@ -44,3 +44,5 @@ Page chrome here (PageHeader) comes from `@merqo/ui`; paykit keeps no local copy The merqo base URL used by the page comes from `@merqo/ui/kit-api`. Signed-out and stale-terms vendors come back here after sign-in or terms acceptance: the page passes its own path and query to `getVendorSession` as `returnTo`. + +The current-plan panel is an `ElevatedCard` and "What paid plans add" is a shared `Section`. diff --git a/src/app/dashboard/plan/page.tsx b/src/app/dashboard/plan/page.tsx index cb5ceb0..feda6ee 100644 --- a/src/app/dashboard/plan/page.tsx +++ b/src/app/dashboard/plan/page.tsx @@ -6,8 +6,13 @@ import { freeListCutoff, FREE_LIST_DAYS, isPaidPlan } from "@/lib/free-limits"; import { resolvePlanView } from "@/lib/plan-view"; import { readVendorPlan } from "@/lib/vendor-entitlement"; import { merqoBaseUrl } from "@merqo/ui/kit-api"; -import { PricingLadder, fetchPlanCatalog } from "@merqo/ui"; -import { PageHeader } from "@merqo/ui"; +import { + ElevatedCard, + PageHeader, + PricingLadder, + Section, + fetchPlanCatalog, +} from "@merqo/ui"; export const metadata: Metadata = { title: "Plan", @@ -66,7 +71,7 @@ export default async function PlanPage() {
-
+

You are on {view.plan === "pro" ? "Pro" : "Free"}

@@ -79,11 +84,10 @@ export default async function PlanPage() { > Change plan in your Merqo account -
+ {paid ? null : ( -
-

What paid plans add

+
  • Full payment history with search. Free keeps the last{" "} @@ -101,7 +105,7 @@ export default async function PlanPage() { hidden on Free.

    ) : null} -
+
)} {catalog && paid && !currentListed ? ( diff --git a/src/app/dashboard/transactions/README.md b/src/app/dashboard/transactions/README.md index d3000f9..8c0e294 100644 --- a/src/app/dashboard/transactions/README.md +++ b/src/app/dashboard/transactions/README.md @@ -21,7 +21,7 @@ across every kit — plus, for Pro vendors, a per-payment refund action. renders `Kit`/`Reference`/`Amount`/`Status`/`Created` columns through `@merqo/ui` DataTable, plus a `Refund` column with `RefundDialog` when `isPro`. Amounts are shown with `Money` from `@merqo/ui` ("S$4.50"), in a right-aligned column. Empty state is the shared dashed `EmptyState` ("No payments yet"); the table sits in an - `hidden sm:block` wrapper; below 640px a `PhoneList` of expandable rows (amount + status, kit + date; tap for the reference and `RefundDialog`) replaces it, switched by CSS only. The Refund gate (Pro and confirmed) is the shared `canRefund` in `transaction-table.tsx`. + horizontally scrollable wrapper at every width; the Kit and Created columns are `hidden sm:table-cell`, so phones see Reference, Amount, Status and the action buttons. The Refund gate (Pro and confirmed) is the shared `canRefund` in `transaction-table.tsx`. - `transaction-notices.tsx` — `HiddenNote` (older payments Free hides) and `FreeRangeNote` ("Free shows the last 30 days."). A failed read renders the shared `ListError` ("Couldn't load payments"); the filter select uses `FILTER_SELECT_CLASS`. - `transaction-status-badge.tsx` — `TransactionStatusBadge({ status })` @@ -97,7 +97,7 @@ across every kit — plus, for Pro vendors, a per-payment refund action. Reachable from `dashboard-nav.tsx`'s "Payments" link. `page.tsx` reads transactions via `@/lib/vendor-session` and `@/lib/transactions`, and reads which rows have a screenshot (`transactionIdsWithProof`) and renders -`transaction-table.tsx` (a `Proof` column and phone-row button via +`transaction-table.tsx` (a `Proof` column via `proof-dialog.tsx`), which renders `refund-dialog.tsx` for Pro vendors — that dialog calls `issueRefundAction` in `actions.ts`. diff --git a/src/app/dashboard/transactions/transaction-table.dom.test.tsx b/src/app/dashboard/transactions/transaction-table.dom.test.tsx index 564ba1a..ce6f81f 100644 --- a/src/app/dashboard/transactions/transaction-table.dom.test.tsx +++ b/src/app/dashboard/transactions/transaction-table.dom.test.tsx @@ -1,6 +1,6 @@ // @vitest-environment jsdom import { describe, it, expect, vi } from "vitest"; -import { fireEvent, render, screen, within } from "@testing-library/react"; +import { render, screen, within } from "@testing-library/react"; import { TransactionTable } from "./transaction-table"; import type { Transaction } from "@/lib/types"; @@ -17,15 +17,13 @@ const TX: Transaction = { created_at: "2026-07-15T00:00:00Z", }; -// jsdom applies no Tailwind CSS, so both the phone list and the table are in -// the DOM; each assertion scopes to the one it means. vi.mock("./actions", () => ({ loadPaymentProofAction: vi.fn(), issueRefundAction: vi.fn(), })); describe("TransactionTable proof", () => { - it("offers View screenshot only on rows with a proof, in table and phone list", () => { + it("offers View screenshot only on rows with a proof", () => { const other = { ...TX, id: "tx2", order_ref: "A-002" }; render( { name: "View screenshot", }), ).toHaveLength(1); - const list = within(screen.getByRole("list", { name: "Payments" })); - fireEvent.click(list.getAllByRole("button", { name: /S\$4\.50/ })[0]); - expect( - list.getAllByRole("button", { name: "View screenshot" }), - ).toHaveLength(1); }); it("has no Proof column when no row has a screenshot", () => { @@ -64,6 +57,21 @@ describe("TransactionTable", () => { expect(table.getByText("Received")).toBeInTheDocument(); }); + it("hides the Kit and Created columns on phones only", () => { + render(); + expect(screen.getByRole("columnheader", { name: "Kit" })).toHaveClass( + "hidden", + "sm:table-cell", + ); + expect(screen.getByRole("columnheader", { name: "Created" })).toHaveClass( + "hidden", + "sm:table-cell", + ); + expect( + screen.getByRole("columnheader", { name: "Amount" }), + ).not.toHaveClass("hidden"); + }); + it("shows an empty state with no transactions", () => { render(); expect(screen.getByText(/no payments yet/i)).toBeInTheDocument(); @@ -90,61 +98,4 @@ describe("TransactionTable", () => { screen.getByRole("columnheader", { name: /refund/i }), ).toBeInTheDocument(); }); - - describe("phone list", () => { - it("shows amount, status, kit and date on the collapsed row", () => { - render(); - const list = within(screen.getByRole("list", { name: "Payments" })); - expect(list.getByText("S$4.50")).toBeInTheDocument(); - expect(list.getByText("Received")).toBeInTheDocument(); - expect(list.getByText("qkit")).toBeInTheDocument(); - expect(list.getByText(/2026/)).toBeInTheDocument(); - expect(list.queryByText("A-001")).not.toBeInTheDocument(); - expect( - list.queryByRole("button", { name: /refund/i }), - ).not.toBeInTheDocument(); - }); - - it("expands to reveal the reference and the Refund action", () => { - render(); - const list = within(screen.getByRole("list", { name: "Payments" })); - const toggle = list.getByRole("button", { name: /S\$4\.50/ }); - fireEvent.click(toggle); - expect(toggle).toHaveAttribute("aria-expanded", "true"); - expect(list.getByText("A-001")).toBeInTheDocument(); - expect(list.getByRole("button", { name: /refund/i })).toBeInTheDocument(); - fireEvent.click(toggle); - expect(toggle).toHaveAttribute("aria-expanded", "false"); - expect(list.queryByText("A-001")).not.toBeInTheDocument(); - }); - - it("keeps the Refund action outside the toggle so tapping it does not collapse the row", () => { - render(); - const list = within(screen.getByRole("list", { name: "Payments" })); - const toggle = list.getByRole("button", { name: /S\$4\.50/ }); - fireEvent.click(toggle); - const refund = list.getByRole("button", { name: /refund/i }); - expect(toggle).not.toContainElement(refund); - fireEvent.click(refund); - expect(toggle).toHaveAttribute("aria-expanded", "true"); - }); - - it("describes the toggle with the status and secondary line", () => { - render(); - const list = within(screen.getByRole("list", { name: "Payments" })); - expect( - list.getByRole("button", { name: /S\$4\.50/ }), - ).toHaveAccessibleDescription(/Received[\s\S]*qkit/); - }); - - it("offers no Refund on a Free vendor's expanded row", () => { - render(); - const list = within(screen.getByRole("list", { name: "Payments" })); - fireEvent.click(list.getByRole("button", { name: /S\$4\.50/ })); - expect(list.getByText("A-001")).toBeInTheDocument(); - expect( - list.queryByRole("button", { name: /refund/i }), - ).not.toBeInTheDocument(); - }); - }); }); diff --git a/src/app/dashboard/transactions/transaction-table.tsx b/src/app/dashboard/transactions/transaction-table.tsx index a00c821..d7a2447 100644 --- a/src/app/dashboard/transactions/transaction-table.tsx +++ b/src/app/dashboard/transactions/transaction-table.tsx @@ -8,7 +8,6 @@ import { Timestamp, type DataTableColumn, } from "@merqo/ui"; -import { PhoneList, PhoneRow } from "@/components/list/phone-row"; import { ProofDialog } from "./proof-dialog"; import { RefundDialog } from "./refund-dialog"; import { TransactionStatusBadge } from "./transaction-status-badge"; @@ -19,7 +18,11 @@ import type { Transaction } from "@/lib/types"; // Server → Client boundary into `@merqo/ui`'s `DataTable` directly from a // page. Same shape as `admin/vendors/vendors-table.tsx`. const BASE_COLUMNS: DataTableColumn[] = [ - { header: "Kit", cell: (tx) => tx.kit_slug }, + { + header: "Kit", + className: "hidden sm:table-cell", + cell: (tx) => tx.kit_slug, + }, { header: "Reference", cell: (tx) => tx.order_ref }, { header: "Amount", @@ -32,6 +35,7 @@ const BASE_COLUMNS: DataTableColumn[] = [ }, { header: "Created", + className: "hidden sm:table-cell", cell: (tx) => , }, ]; @@ -99,40 +103,12 @@ export function TransactionTable({ ...(isPro ? [REFUND_COLUMN] : []), ]; return ( - <> - - {transactions.map((tx) => ( - } - badge={} - secondary={ - <> - {tx.kit_slug} - - - } - > -

- Reference - {tx.order_ref} -

- {withProof.has(tx.id) ? ( - - ) : null} - {canRefund(tx, isPro) ? ( - - ) : null} -
- ))} -
-
- tx.id} - /> -
- +
+ tx.id} + /> +
); } From 180bc47f3274a55c266df8e77dc5d0fdc7962124 Mon Sep 17 00:00:00 2001 From: Clarence Lee <35331421+cljiahao@users.noreply.github.com> Date: Wed, 2 Dec 2026 08:07:30 +0800 Subject: [PATCH 3/4] chore(deps): re-pin @merqo/ui to v0.68.0, bump to 0.12.0 (#323) Co-authored-by: Claude Sonnet 5.5 --- CHANGELOG.md | 3 ++- README.md | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 12 ++++++------ pnpm-workspace.yaml | 2 +- src/app/dashboard/README.md | 2 +- src/app/dashboard/dashboard-nav.dom.test.tsx | 9 ++++----- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d4d649..c7ee560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,11 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.12.0] - 2026-12-02 ### Changed +- `@merqo/ui` is now v0.68.0. In the account menu, Text size is a "Text size · 100%" submenu of preset sizes (75% to 200%) under a new "Preferences" label, replacing the inline A-/100%/A+ buttons. - Payments, Plan, payment setup and the admin overview, vendors and activity pages now use more of the shared `@merqo/ui` components (stat tiles, sections, cards, data tables). Payments shows one table at every width, with the Kit and Created columns hidden on phones. Behaviour, plan limits and copy are unchanged. - Bookings, inquiries and their detail pages now use the shared Merqo section, card and empty-state components. diff --git a/README.md b/README.md index 2bc961e..9a4f0e3 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ in the workspace root for why. Brand theme is "Banknote Engrave" of 2026-08-19 — see `globals.css`'s own header comment; `src/lib/brand-mark.ts`'s ImageResponse-generated favicon/apple-touch-icon carries the same rebrand. -The public landing is in pre-launch mode, headlined "Get paid by PayNow. Know who has paid.": an "Early access" badge, a hero with a switchable Waiting/Paid/Confirmed pay-card object, a three-step payment story on an iPhone and a vendor tablet (steps follow scroll on wide screens and are tapped through on narrow ones), an "After the payment" sample ledger and report, three FAQ rows linking to `/faq`, a closing "Join the waitlist" CTA, and no published price (pilot notice only, carried by the FAQ rather than a benefit tile). Sign-in and the dashboard stay reachable by direct URL. When signed in, the landing, About and FAQ nav shows a Dashboard link and the shared `LandingAccountNav` (Dashboard link and account menu with Sign out), named from the vendor profile's stall name. Landing surfaces (checkout card, FAQ rows) use one small `rounded-lg` radius and the landing has no glow or background wash, per the shared public page rules. `@merqo/ui` is pinned to merqo-ui commit 8d2da3ab (v0.67.0), whose `AppLinkProvider` is mounted once in the root layout so its client exports navigate client-side without a `LinkComponent` prop. The pin also supplies the `PricingLadder`, which the vendor plan page renders (the navigation plan chip is its `TierChip`) from merqo's public plan catalog (paykit stores no prices); the ladder hides the qkit-only Event Pass block. Money and time render through its `Money`, `Timestamp`, `formatMoney` and `formatDateTime` (S$ amounts, dates like "7 Nov 2026", all in Singapore time). The dashboard Home, Stats and Reports pages use its `StatTile` (`card`), `DataTable`, `EmptyState`, `ElevatedCard`, `Section` and link-mode `SegmentedControl`. The dashboard also uses its `ConfirmDialog` (inquiry delete), `CopyButton` (booking ID), `downloadCsv` (earnings CSV) and `AsyncSubmitButton` (refund) rather than local copies. +The public landing is in pre-launch mode, headlined "Get paid by PayNow. Know who has paid.": an "Early access" badge, a hero with a switchable Waiting/Paid/Confirmed pay-card object, a three-step payment story on an iPhone and a vendor tablet (steps follow scroll on wide screens and are tapped through on narrow ones), an "After the payment" sample ledger and report, three FAQ rows linking to `/faq`, a closing "Join the waitlist" CTA, and no published price (pilot notice only, carried by the FAQ rather than a benefit tile). Sign-in and the dashboard stay reachable by direct URL. When signed in, the landing, About and FAQ nav shows a Dashboard link and the shared `LandingAccountNav` (Dashboard link and account menu with Sign out), named from the vendor profile's stall name. Landing surfaces (checkout card, FAQ rows) use one small `rounded-lg` radius and the landing has no glow or background wash, per the shared public page rules. `@merqo/ui` is pinned to merqo-ui commit 5a08fd87 (v0.68.0), whose `AppLinkProvider` is mounted once in the root layout so its client exports navigate client-side without a `LinkComponent` prop. The pin also supplies the `PricingLadder`, which the vendor plan page renders (the navigation plan chip is its `TierChip`) from merqo's public plan catalog (paykit stores no prices); the ladder hides the qkit-only Event Pass block. Money and time render through its `Money`, `Timestamp`, `formatMoney` and `formatDateTime` (S$ amounts, dates like "7 Nov 2026", all in Singapore time). The dashboard Home, Stats and Reports pages use its `StatTile` (`card`), `DataTable`, `EmptyState`, `ElevatedCard`, `Section` and link-mode `SegmentedControl`. The dashboard also uses its `ConfirmDialog` (inquiry delete), `CopyButton` (booking ID), `downloadCsv` (earnings CSV) and `AsyncSubmitButton` (refund) rather than local copies. The hosted pay page (`/pay/{id}`) shows "Paying " above the amount (the vendor's payee name, falling back to their inquiry-form business name), reports claim and upload failures inline instead of in toasts, shows a plain retry notice when the payment cannot be loaded, and honours a checkout's `expires_at`: a pending order past it shows "This order has expired" instead of the QR (claimed and confirmed ones are unaffected), with a "Pay within N mins" line while it is open. diff --git a/package.json b/package.json index 457ddaf..671ee4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paykit", - "version": "0.11.3", + "version": "0.12.0", "private": true, "packageManager": "pnpm@11.10.0", "engines": { @@ -20,7 +20,7 @@ "prepare": "husky" }, "dependencies": { - "@merqo/ui": "github:merqo-io/merqo-ui#8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03", + "@merqo/ui": "github:merqo-io/merqo-ui#5a08fd875ad6c96f096fbcb4d56ed50eb238f33e", "@sentry/nextjs": "10.76.2", "@supabase/ssr": "^0.10.3", "@supabase/supabase-js": "2.110.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd39e9b..2e53982 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: .: dependencies: '@merqo/ui': - specifier: github:merqo-io/merqo-ui#8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03 - version: https://codeload.github.com/merqo-io/merqo-ui/tar.gz/8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03(@eslint-community/eslint-plugin-eslint-comments@4.8.1(eslint@9.39.5(jiti@2.7.0)))(@playwright/test@1.61.1)(@supabase/ssr@0.10.3(@supabase/supabase-js@2.110.4))(@supabase/supabase-js@2.110.4)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(eslint-plugin-sonarjs@4.2.2(eslint@9.39.5(jiti@2.7.0)))(eslint@9.39.5(jiti@2.7.0))(next-themes@0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(next@16.4.6(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.61.1)(@types/node@24.19.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(radix-ui@1.6.2(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sonner@1.7.4(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(tailwindcss@4.3.2)(zod@4.6.6) + specifier: github:merqo-io/merqo-ui#5a08fd875ad6c96f096fbcb4d56ed50eb238f33e + version: https://codeload.github.com/merqo-io/merqo-ui/tar.gz/5a08fd875ad6c96f096fbcb4d56ed50eb238f33e(@eslint-community/eslint-plugin-eslint-comments@4.8.1(eslint@9.39.5(jiti@2.7.0)))(@playwright/test@1.61.1)(@supabase/ssr@0.10.3(@supabase/supabase-js@2.110.4))(@supabase/supabase-js@2.110.4)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(eslint-plugin-sonarjs@4.2.2(eslint@9.39.5(jiti@2.7.0)))(eslint@9.39.5(jiti@2.7.0))(next-themes@0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(next@16.4.6(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.61.1)(@types/node@24.19.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(radix-ui@1.6.2(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sonner@1.7.4(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(tailwindcss@4.3.2)(zod@4.6.6) '@sentry/nextjs': specifier: 10.76.2 version: 10.76.2(@opentelemetry/core@2.10.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.10.0(@opentelemetry/api@1.9.1))(next@16.4.6(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.61.1)(@types/node@24.19.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react@19.2.7)(webpack@5.109.2(lightningcss@1.32.0)(sharp@0.35.5(@types/node@24.19.1))) @@ -977,9 +977,9 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03': - resolution: {gitHosted: true, tarball: https://codeload.github.com/merqo-io/merqo-ui/tar.gz/8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03} - version: 0.67.0 + '@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/5a08fd875ad6c96f096fbcb4d56ed50eb238f33e': + resolution: {gitHosted: true, tarball: https://codeload.github.com/merqo-io/merqo-ui/tar.gz/5a08fd875ad6c96f096fbcb4d56ed50eb238f33e} + version: 0.68.0 engines: {node: '>=24'} peerDependencies: '@eslint-community/eslint-plugin-eslint-comments': '>=4.8.1' @@ -6180,7 +6180,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03(@eslint-community/eslint-plugin-eslint-comments@4.8.1(eslint@9.39.5(jiti@2.7.0)))(@playwright/test@1.61.1)(@supabase/ssr@0.10.3(@supabase/supabase-js@2.110.4))(@supabase/supabase-js@2.110.4)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(eslint-plugin-sonarjs@4.2.2(eslint@9.39.5(jiti@2.7.0)))(eslint@9.39.5(jiti@2.7.0))(next-themes@0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(next@16.4.6(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.61.1)(@types/node@24.19.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(radix-ui@1.6.2(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sonner@1.7.4(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(tailwindcss@4.3.2)(zod@4.6.6)': + '@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/5a08fd875ad6c96f096fbcb4d56ed50eb238f33e(@eslint-community/eslint-plugin-eslint-comments@4.8.1(eslint@9.39.5(jiti@2.7.0)))(@playwright/test@1.61.1)(@supabase/ssr@0.10.3(@supabase/supabase-js@2.110.4))(@supabase/supabase-js@2.110.4)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(eslint-plugin-sonarjs@4.2.2(eslint@9.39.5(jiti@2.7.0)))(eslint@9.39.5(jiti@2.7.0))(next-themes@0.4.6(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(next@16.4.6(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.61.1)(@types/node@24.19.1)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(radix-ui@1.6.2(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sonner@1.7.4(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(tailwindcss@4.3.2)(zod@4.6.6)': dependencies: '@icons-pack/react-simple-icons': 13.13.0(react@19.2.7) class-variance-authority: 0.7.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ea929e1..e40c33c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,7 @@ allowBuilds: esbuild: true sharp: true unrs-resolver: true - "@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03": true + "@merqo/ui@https://codeload.github.com/merqo-io/merqo-ui/tar.gz/5a08fd875ad6c96f096fbcb4d56ed50eb238f33e": true "@sentry/cli": false tesseract.js: false diff --git a/src/app/dashboard/README.md b/src/app/dashboard/README.md index 24f126b..87d2ea7 100644 --- a/src/app/dashboard/README.md +++ b/src/app/dashboard/README.md @@ -52,7 +52,7 @@ for page render/data failures; it offers "Try again" and a "Back to dashboard" l free. The old `stats/` and `reports/earnings/` URLs redirect to the matching tab. - `plan/` shows the current plan and points to the Merqo account; merqo owns pricing. - `profile/` saves shared stall name/social links and Supabase account metadata. -- The account menu carries the shared "Text size" row (`textSizeKey="paykit:scale:dashboard"`), saved per browser. +- The account menu lists "Text size · 100%" under a "Preferences" label; it opens a preset submenu (75% to 200%, `textSizeKey="paykit:scale:dashboard"`), saved per browser. - `layout.tsx` labels the account menu with `accountLabel(user, stall_name)` from `@merqo/ui`: the stall name, else the auth name, else the email local part. `page.tsx` (Home, titled "Home") renders the "Get set up" checklist above the summary, from diff --git a/src/app/dashboard/dashboard-nav.dom.test.tsx b/src/app/dashboard/dashboard-nav.dom.test.tsx index 37290ae..087eeee 100644 --- a/src/app/dashboard/dashboard-nav.dom.test.tsx +++ b/src/app/dashboard/dashboard-nav.dom.test.tsx @@ -59,11 +59,12 @@ describe("DashboardNav", () => { ).toHaveAttribute("href", "/dashboard"); }); - it("shows the Text size row when the account menu opens", async () => { + it("shows the Preferences group and Text size row when the account menu opens", async () => { const user = userEvent.setup(); render(); await user.click(screen.getByRole("button", { name: /account menu/i })); - expect(screen.getByText("Text size")).toBeInTheDocument(); + expect(screen.getByText("Preferences")).toBeInTheDocument(); + expect(screen.getByText("Text size · 100%")).toBeInTheDocument(); }); it("account menu holds Payment setup, Profile, Plan, help and feedback, theme, text size, then Sign out", async () => { @@ -79,9 +80,7 @@ describe("DashboardNav", () => { "Feedback", "Payment setup", "Theme · System", - "A-", - "100%", - "A+", + "Text size · 100%", "Sign out", ]); expect(screen.getByRole("menuitem", { name: /^Plan/ })).toHaveAttribute( From b614c87324e476032750591c71d9f3bfc15c5d23 Mon Sep 17 00:00:00 2001 From: Clarence Lee <35331421+cljiahao@users.noreply.github.com> Date: Wed, 2 Dec 2026 08:48:06 +0800 Subject: [PATCH 4/4] fix(transactions): keep Refund reachable at 390px by folding actions on phones (#325) Co-authored-by: Claude Sonnet 5.5 --- CHANGELOG.md | 6 +++ README.md | 2 +- src/app/dashboard/transactions/README.md | 2 +- .../transaction-table.dom.test.tsx | 40 +++++++++++++++++-- .../transactions/transaction-table.tsx | 32 ++++++++++++++- 5 files changed, 75 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ee560..c4a1887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- On phones the Payments table now shows Status under the amount and puts Proof and Refund in one Actions cell, so Refund is reachable at 390px without scrolling. + ## [0.12.0] - 2026-12-02 ### Changed diff --git a/README.md b/README.md index 9a4f0e3..3ca41be 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Paykit no longer mounts. The transaction status badge on `@merqo/ui`'s shared `StatusBadge` dot+pill shape) carries a persistent tap-to-open hint (`@merqo/ui`'s `InfoTooltip`, `trigger="tap"`) explaining what the "Marked paid" (`claimed`) and "Received" (`confirmed`) labels mean, -so that distinction is always available (the Payments ledger also offers a "View screenshot" dialog on rows with a stored payment proof, `src/app/dashboard/transactions/proof-dialog.tsx`) — tap, not the +so that distinction is always available (the Payments ledger also offers a "View screenshot" dialog on rows with a stored payment proof (on phones, with Refund in one Actions cell), `src/app/dashboard/transactions/proof-dialog.tsx`) — tap, not the component's hover default, since a native hover hint has no touch equivalent and most vendors check this on a phone. The landing nav's signed-in menu diff --git a/src/app/dashboard/transactions/README.md b/src/app/dashboard/transactions/README.md index 8c0e294..e31ef3c 100644 --- a/src/app/dashboard/transactions/README.md +++ b/src/app/dashboard/transactions/README.md @@ -21,7 +21,7 @@ across every kit — plus, for Pro vendors, a per-payment refund action. renders `Kit`/`Reference`/`Amount`/`Status`/`Created` columns through `@merqo/ui` DataTable, plus a `Refund` column with `RefundDialog` when `isPro`. Amounts are shown with `Money` from `@merqo/ui` ("S$4.50"), in a right-aligned column. Empty state is the shared dashed `EmptyState` ("No payments yet"); the table sits in an - horizontally scrollable wrapper at every width; the Kit and Created columns are `hidden sm:table-cell`, so phones see Reference, Amount, Status and the action buttons. The Refund gate (Pro and confirmed) is the shared `canRefund` in `transaction-table.tsx`. + horizontally scrollable wrapper at every width; the Kit and Created columns are `hidden sm:table-cell`, and on phones the Status, Proof and Refund columns are hidden too: Status shows under the amount and Proof/Refund fold into one stacked `Actions` cell (`sm:hidden`), so Refund fits a 390px viewport without scrolling. The Refund gate (Pro and confirmed) is the shared `canRefund` in `transaction-table.tsx`. - `transaction-notices.tsx` — `HiddenNote` (older payments Free hides) and `FreeRangeNote` ("Free shows the last 30 days."). A failed read renders the shared `ListError` ("Couldn't load payments"); the filter select uses `FILTER_SELECT_CLASS`. - `transaction-status-badge.tsx` — `TransactionStatusBadge({ status })` diff --git a/src/app/dashboard/transactions/transaction-table.dom.test.tsx b/src/app/dashboard/transactions/transaction-table.dom.test.tsx index ce6f81f..c533e1c 100644 --- a/src/app/dashboard/transactions/transaction-table.dom.test.tsx +++ b/src/app/dashboard/transactions/transaction-table.dom.test.tsx @@ -36,7 +36,7 @@ describe("TransactionTable proof", () => { within(screen.getByRole("table")).getAllByRole("button", { name: "View screenshot", }), - ).toHaveLength(1); + ).toHaveLength(2); // desktop Proof column + phone Actions cell }); it("has no Proof column when no row has a screenshot", () => { @@ -54,7 +54,7 @@ describe("TransactionTable", () => { expect(table.getByText("qkit")).toBeInTheDocument(); expect(table.getByText("A-001")).toBeInTheDocument(); expect(table.getByText("S$4.50")).toBeInTheDocument(); - expect(table.getByText("Received")).toBeInTheDocument(); + expect(table.getAllByText("Received")[0]).toBeInTheDocument(); }); it("hides the Kit and Created columns on phones only", () => { @@ -90,12 +90,44 @@ describe("TransactionTable", () => { it("shows the Refund column and button for a Pro vendor's confirmed transaction", () => { render(); expect( - within(screen.getByRole("table")).getByRole("button", { + within(screen.getByRole("table")).getAllByRole("button", { name: /refund/i, }), - ).toBeInTheDocument(); + ).toHaveLength(2); expect( screen.getByRole("columnheader", { name: /refund/i }), ).toBeInTheDocument(); }); + + it("keeps Refund and Proof reachable on phones via one Actions cell", () => { + render( + , + ); + for (const name of ["Status", "Proof", "Refund"]) { + expect(screen.getByRole("columnheader", { name })).toHaveClass( + "hidden", + "sm:table-cell", + ); + } + const actions = screen.getByRole("columnheader", { name: "Actions" }); + expect(actions).toHaveClass("sm:hidden"); + const cell = screen + .getAllByRole("cell") + .find((c) => c.className.includes("sm:hidden")); + expect( + within(cell as HTMLElement).getByRole("button", { name: /refund/i }), + ).toBeInTheDocument(); + expect( + within(cell as HTMLElement).getByRole("button", { + name: "View screenshot", + }), + ).toBeInTheDocument(); + }); + + it("adds no Actions column for a Free vendor without proofs", () => { + render(); + expect( + screen.queryByRole("columnheader", { name: "Actions" }), + ).not.toBeInTheDocument(); + }); }); diff --git a/src/app/dashboard/transactions/transaction-table.tsx b/src/app/dashboard/transactions/transaction-table.tsx index d7a2447..3b4f858 100644 --- a/src/app/dashboard/transactions/transaction-table.tsx +++ b/src/app/dashboard/transactions/transaction-table.tsx @@ -27,10 +27,19 @@ const BASE_COLUMNS: DataTableColumn[] = [ { header: "Amount", align: "end", - cell: (tx) => , + // Status folds under the amount on phones so the row fits ~335px. + cell: (tx) => ( +
+ + + + +
+ ), }, { header: "Status", + className: "hidden sm:table-cell", cell: (tx) => , }, { @@ -48,6 +57,7 @@ function canRefund(tx: Transaction, isPro: boolean) { const REFUND_COLUMN: DataTableColumn = { header: "Refund", + className: "hidden sm:table-cell", cell: (tx) => canRefund(tx, true) ? : null, }; @@ -57,11 +67,30 @@ function proofColumn( ): DataTableColumn { return { header: "Proof", + className: "hidden sm:table-cell", cell: (tx) => proofIds.has(tx.id) ? : null, }; } +// Phones get one stacked Actions cell instead of separate Proof and Refund +// columns, which together overflow a 390px viewport and clip Refund. +function actionsColumn( + proofIds: ReadonlySet, + isPro: boolean, +): DataTableColumn { + return { + header: "Actions", + className: "sm:hidden", + cell: (tx) => ( +
+ {proofIds.has(tx.id) ? : null} + {canRefund(tx, isPro) ? : null} +
+ ), + }; +} + export function TransactionTable({ transactions, isPro, @@ -101,6 +130,7 @@ export function TransactionTable({ ...BASE_COLUMNS, ...(withProof.size > 0 ? [proofColumn(withProof)] : []), ...(isPro ? [REFUND_COLUMN] : []), + ...(withProof.size > 0 || isPro ? [actionsColumn(withProof, isPro)] : []), ]; return (