Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to loopkit are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [0.7.0] - 2026-12-02

### Changed

- Updated `@merqo/ui` to v0.68.0. In the account menu, Text size is now a "Text size · 100%" submenu with a preset list (75% to 200%) under a new Preferences heading, replacing the inline A-/A+ buttons.
- Documented the shared storage and media-query helper move in the root and card-check component READMEs.

## [0.6.5] - 2026-12-02

### Changed

- Stamps earned from qkit orders are now Free. The dashboard qkit setting no longer asks for Pro, `saveQkitEarnConfigAction` no longer checks the plan, and migration `0072` drops the `is_pro` check from `qkit_earn_resolve_program`, so a free vendor's stamp program shows on every qkit order by default too. The program-count limit and other Pro features are unchanged. Migration `0072` must be applied to hosted staging and prod by hand.

## [0.6.4] - 2026-12-01

### Changed

- The visits trend, the Counter's last-program memory, the "Serve a customer" button and the retired-card notice now use the shared `useMediaQuery` and `readStored`/`writeStored` helpers from `@merqo/ui`. The last-program value is now stored as JSON, so a device with the old raw value uses the default program until the vendor next opens the Counter.

## [0.6.3] - 2026-12-01

### Changed
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Day keys, short dates and dollars-to-cents conversion come from `@merqo/ui` (`sgDayKey`, `formatShortDate`, `dollarsToCents`), not local helpers.

The visits trend, Counter last-program memory, "Serve a customer" button and retired-card notice read and write browser storage and media queries through `@merqo/ui`'s `readStored`/`writeStored`/`useMediaQuery` (see `src/features/card-check/components/README.md`). The account menu's Text size is a Preferences submenu from `@merqo/ui` v0.68.0.

Shared UI is pinned to audited commit `989d934c1cc8d957ff383934debf8ef083b6b6a4`. The lockfile and exact build allowlist select this same source, including image lifecycle cleanup, malformed storage-URL handling and bounded money inputs.

`DESIGN.md` records loopkit's own public-page design values and links the shared rules, including the stamp card's current edge.
Expand Down Expand Up @@ -53,7 +55,7 @@ output instead of a hand-copied string, so it can't drift from what the
engine actually computes — see
`../docs/superpowers/specs/2026-08-25-tour-example-badge-drift-fix-design.md`
in the workspace root. Migrated onto
the shared `@merqo/ui` component package (pinned at v0.63.0, commit `13c3d3f9`, in `package.json`; email links land on `/auth/confirm`, see `src/app/auth/README.md`): the
the shared `@merqo/ui` component package (pinned at v0.68.0, commit `5a08fd87`, in `package.json`; email links land on `/auth/confirm`, see `src/app/auth/README.md`): the
dashboard nav/account dropdown, `useAsyncAction`, `InfoTooltip`,
`ImageUploader`, `DashboardTour`, the landing page's
sticky header (`LandingNav`, via `src/components/landing/nav.tsx`), and
Expand Down Expand Up @@ -390,8 +392,8 @@ flips it from a switch there (`src/app/dashboard/customer-notify-settings.tsx`,
under RLS (`for all` own-row policy, not service-role-only). See
`docs/superpowers/specs/2026-08-16-customer-notify-vendor-toggle-design.md`.

Separately, every Pro vendor with a stamp program shows it on qkit orders by default and can switch it off
(migration `0071`; a vendor with no `qkit_earn_config` row offers its oldest active stamp program)
Separately, every vendor with a stamp program (Free or Pro) shows it on qkit orders by default and can switch it off
(migrations `0071`, `0072`; a vendor with no `qkit_earn_config` row offers its oldest active stamp program)
so customers can earn a stamp from a completed
qkit order (`src/app/dashboard/qkit-earn-settings.tsx`) — this is a pull-model
claim link, not push automation: qkit shows a stamp card on the
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loopkit",
"version": "0.6.3",
"version": "0.7.0",
"private": true,
"packageManager": "pnpm@11.10.0",
"engines": {
Expand All @@ -23,7 +23,7 @@
},
"dependencies": {
"@hookform/resolvers": "5.2.2",
"@merqo/ui": "github:merqo-io/merqo-ui#8d2da3abcb4e5c3bab2b3a3482c740797e2d5c03",
"@merqo/ui": "github:merqo-io/merqo-ui#5a08fd875ad6c96f096fbcb4d56ed50eb238f33e",
"@supabase/ssr": "^0.10.3",
"@supabase/supabase-js": "2.110.0",
"@zxing/browser": "^0.2.1",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
allowBuilds:
"@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
supabase: true
esbuild: true
sharp: true
Expand Down
14 changes: 7 additions & 7 deletions src/app/dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Shared controls and `cn` used by this folder's modules are imported from `@merqo
- `stamp-actions.ts` — server actions that change a card: `stampAction` (`add_stamp`, `rewardReady` via `getProgress` so every type's engine decides), `adjustStampAction` (manual `±` correction with a required reason via `loopkit.adjust_stamp`, free-tier), `recordVisitAction` (engine play path for Lucky Tap/Sprout with a server-side roll and `record_visit_checked`), `redeemPlantAction` and `regenerateCardAction` (credential rotation that keeps progress)
- `lookup-actions.ts` — read-only server actions: `resolveTokenAction` (scanned token to a `kind: "card" | "voucher"` result, falling back to `voucher_by_token` on a card miss) and `lookupAction` (a card's per-type progress by phone, no visit recorded)
- `redeem-actions.ts` — server actions that redeem: `redeemAction` (resets a full card, then alerts the vendor on Telegram and the customer when `vendor_notify_settings` allows it; a missing row means on and notify failures never change the result), `redeemVoucherAction` (catalog-mode Points Club voucher via `redeem_voucher_by_token`, mapping `already_redeemed`/`expired` to friendly copy) and `applyPointsOffsetAction` (offset-mode points deduction returning the dollar figure)
- `settings-actions.ts` — vendor settings actions: `saveQkitEarnConfigAction` (Pro-gated qkit-order earn program) and `saveCustomerNotifySettingsAction` (customer redemption-notify toggle, not Pro-gated), both upserting on `vendor_id`
- `settings-actions.ts` — vendor settings actions: `saveQkitEarnConfigAction` (qkit-order earn program, Free for every vendor) and `saveCustomerNotifySettingsAction` (customer redemption-notify toggle, not Pro-gated), both upserting on `vendor_id`
- `activity/`
- `card-link.tsx` — client `CardLinkActions`: copy-link (`@merqo/ui`'s `CopyButton`, keeping the sonner toasts) and print-QR buttons for the shop QR block
- `card.ts` — exports the shared `StampCard` type `{ id, phone, stamp_count }` used across actions and form components
Expand All @@ -32,8 +32,8 @@ Shared controls and `cn` used by this folder's modules are imported from `@merqo
- `loading.tsx` — `DashboardLoading` skeleton fallback (pulse placeholders for header and cards) shown while the dashboard route segment streams
- `page.tsx` — `DashboardPage` server component: `requireVendor` + `applyDueCutovers`, loads programs (redirects to `/setup` on zero), fetches `getVendorStats` / `countExpiredVouchers` / `listActivity(limit 6)` / `getVendorOverviewInputs` / `getVendorProfile` in parallel, wires them through `buildOverviewModel`, and renders the Overview: a head row (greeting + stall name + date + `<ServeCta>`) carrying `data-tour="shop-qr"` (the onboarding tour's step-1 anchor), then `<Briefing>` / `<BaseStrip>` / `<VisitsTrend>` / `<WorthALook>` / `<RecentActivity>` in the main column and `<RewardCostPanel>` / `<YourPrograms>` in a right rail (a `lg:` two-zone grid when the vendor has 2+ programs, one centred `max-w-[46rem]` column otherwise). A zero-enrolled vendor sees just the head row and a "no customers yet" card (`@merqo/ui`'s `ElevatedCard`). No `isPro()` gating (Phase 1 ships ungated)
- `overview/` — the Overview's presentational components (`briefing`, `base-strip`, `visits-trend`, `worth-a-look`, `recent-activity`, `reward-cost-panel`, `your-programs`), each with a `*.dom.test.tsx`
- `serve-cta.tsx` — client `ServeCta`: the "Serve a customer" button, links to `/dashboard/counter?p=<id>` for the last program served on this device (reads `localStorage` key `loopkit:last-counter-program` via `useSyncExternalStore`, the Counter writes it), falling back to the server-provided default
- `serve-cta.dom.test.tsx` — jsdom tests: stored program wins when owned, falls back to the default when the stored id is not owned or `localStorage` throws
- `serve-cta.tsx` — client `ServeCta`: the "Serve a customer" button, links to `/dashboard/counter?p=<id>` for the last program served on this device (reads `localStorage` key `loopkit:last-counter-program` via `readStored` inside `useSyncExternalStore`, the Counter writes it as JSON; a legacy raw-string value reads as null and falls back until the Counter rewrites it), falling back to the server-provided default
- `serve-cta.dom.test.tsx` — jsdom tests: stored program wins when owned, falls back to the default when the stored id is not owned, is a legacy raw string, or `localStorage` throws
- `plan/`
- `profile/`
- `program-display.test.ts` — unit tests for `PROGRAM_TYPE_BADGE` and `describeProgram` across every program type
Expand All @@ -44,8 +44,8 @@ Shared controls and `cn` used by this folder's modules are imported from `@merqo
- `referrals/`
- `points-offset-form.dom.test.tsx` — jsdom tests for `PointsOffsetForm`: input defaults to the card's full balance and Apply calls through, Apply disables once the entered amount exceeds the card's balance
- `points-offset-form.tsx` — client `PointsOffsetForm`: a small inline apply-points form (not an AlertDialog like `redeem-button.tsx`/`redeem-voucher/`'s confirm screen, since there's a number to pick here) — calls `applyPointsOffsetAction` and reports the updated card plus the dollar figure back to the caller for the vendor to apply manually at their own register
- `qkit-earn-settings.dom.test.tsx` — jsdom tests for `QkitEarnSettings`: the not-Pro note, the on-by-default switch and its every-qkit-order copy (never claiming the stamp is awarded automatically), the no-stamp-program note, and picking a program and toggling the switch
- `qkit-earn-settings.tsx` — client `QkitEarnSettings` form: switch + program picker that calls `saveQkitEarnConfigAction`, with a not-available note for non-Pro vendors. The stamp card shows on every qkit order by default (migration `0071`), and turning the switch off saves `enabled = false`. With no stamp program it shows a note to create one. Wrapped in `@merqo/ui`'s `ElevatedCard`
- `qkit-earn-settings.dom.test.tsx` — jsdom tests for `QkitEarnSettings`: the on-by-default switch and its every-qkit-order copy (never claiming the stamp is awarded automatically), the no-stamp-program note, and any vendor picking a program and toggling the switch
- `qkit-earn-settings.tsx` — client `QkitEarnSettings` form: switch + program picker that calls `saveQkitEarnConfigAction`. Free for every vendor. The stamp card shows on every qkit order by default (migration `0071`), and turning the switch off saves `enabled = false`. With no stamp program it shows a note to create one. Wrapped in `@merqo/ui`'s `ElevatedCard`
- `redeem-button.dom.test.tsx` — jsdom test asserting `RedeemButton`'s confirm dialog shows the exact stamp count and carryover wording
- `redeem-button.tsx` — client `RedeemButton`: ConfirmDialog-confirmed redeem control that calls `redeemAction` and reports the reset card back to the caller
- `redeem-voucher/`
Expand Down Expand Up @@ -86,12 +86,12 @@ Each page exports its own `metadata.title`, shown through the root `loopkit | %s

card-link test pins the clipboard-failure copy.

`qkit-earn-settings.tsx` stays Pro-gated: the qkit stamp card is on for every Pro vendor with a stamp program until they switch it off.
`qkit-earn-settings.tsx` is Free: the qkit stamp card is on for every vendor with a stamp program until they switch it off.

Dates and times on these pages render through `@merqo/ui`'s `formatDate`/`formatDateTime` (Singapore time).

- Route `loading.tsx` files use `@merqo/ui`'s `ListSkeleton` and `StatTileSkeleton` (each a `role="status"` region with its own sr-only label) under `components/loading-header.tsx`. `visits-bars.tsx` imports `formatShortDate` from `@merqo/ui` (the local `lib/format.ts` re-export is gone). It is a client component (its server caller `stats/visits-chart.tsx` and the client `overview/visits-trend.tsx` import it unchanged): bars are 44px tap targets on coarse pointers in a horizontally scrollable row, and a status line shows the tapped day's date and count, because a `title` never shows on touch. `plan/page.tsx` uses `PageHeader`; `serve-customer.tsx` no longer passes `pending` to `ActiveCard`. `counter/use-serve-customer.ts`'s `confirmRedeemPlant` and `confirmRegenerate` return promises that reject on failure so `ConfirmDialog` stays open with the message inline.

The account menu shows the shared "Text size" row (A-, 100%, A+): `dashboard-nav.tsx` passes `textSizeKey="loopkit:scale:dashboard"` to `SharedDashboardNav` (`@merqo/ui` v0.67.0), so the scale applies to the dashboard only and persists per browser.
The account menu shows the shared "Text size · 100%" submenu (a preset list under the Preferences label): `dashboard-nav.tsx` passes `textSizeKey="loopkit:scale:dashboard"` to `SharedDashboardNav` (`@merqo/ui` v0.68.0), so the scale applies to the dashboard only and persists per browser.

`scan-button.tsx` renders its link and hero variants with the shared `Button` (44px minimum height) instead of native buttons.
Loading
Loading